Mercurial > emacs
annotate lisp/help-at-pt.el @ 94414:d86cb59eea9f
2008-04-27 Carsten Dominik <dominik@science.uva.nl>
* org/org.el (org-html-level-start): Always have id's in HTML
(org-export-as-html): Use `org-link-protocols' to
retrieve the export form of the link.
(org-add-link-type): Final parameter renamed from PUBLISH. Better
documentation of how it is to be used. Avoid double entries for
the same link type.
(org-add-link-props): New function.
(org-modules-loaded): New variable.
(org-load-modules-maybe, org-set-modules): New function.
(org-modules): New option.
(org-mode, org-cycle, orgstruct-mode, org-run-like-in-org-mode)
(orgtbl-mode, org-store-link, org-insert-link-global)
(org-open-at-point): Call `org-load-modules-maybe'.
(org-search-view): Add more text properties.
(org-agenda-schedule, org-agenda-deadline): Allow also in
search-type agendas.
(org-search-view): Order of arguments has been changed.
Interpret prefix-arg as TODO-ONLY.
(org-agenda, org-run-agenda-series, org-agenda-manipulate-query):
Take new argument order of `org-search-view' into account.
(org-todo-only): New variable.
(org-search-syntax-table): New variable and function.
(org-search-view): Do the search with the special syntax table.
(define-obsolete-function-alias): Make work with XEmacs.
(org-add-planning-info): Use old date as default when modifying an
existing deadline or scheduled item.
(org-agenda-compute-time-span): Make argument N optional.
(org-agenda-format-date-aligned): Require `cal-iso'.
(org-agenda-list): Include week into into agenda heading, don't
list it at each date (only on Mondays).
(org-read-date-analyze): Define local variable `iso-date'.
(org-agenda-format-date-aligned): Remove dependency on
`calendar-time-from-absolute'.
(org-remember-apply-template, org-go-to-remember-target):
Interpret filenames relative to `org-directory'.
(org-complete): Silently fail when trying to complete
keywords that don't have a default value.
(org-get-current-options): Added a #+DATE: option.
(org-additional-option-like-keywords): Removed "DATE:" from the
list of additional keywords.
(org-export-as-html): Removed (current-time) as unnecessary second
argument of `format-time-string'.
(org-clock-find-position): Handle special case at end of
buffer.
(org-agenda-day-view): New argument DAY-OF-YEAR, pass it on to
`org-agenda-change-time-span'.
(org-agenda-week-view): New argument ISO-WEEK, pass it on to
`org-agenda-change-time-span'.
(org-agenda-month-view): New argument MONTH, pass it on to
`org-agenda-change-time-span'.
(org-agenda-year-view): New argument YEAR, pass it on to
`org-agenda-change-time-span'.
(org-agenda-change-time-span): New optional argument N, pass it on
to `org-agenda-compute-time-span'.
(org-agenda-compute-time-span): New argument N, interpret it by
changing the starting day.
(org-small-year-to-year): New function.
(org-scheduled-past-days): Respect
`org-scheduled-past-days'.
(org-auto-repeat-maybe): Make sure that repeating
dates are pushed into the future, and that the shift is at least
one interval, never 0.
(org-update-checkbox-count): Fix bug with checkbox
counting.
(org-add-note): New command.
(org-add-log-setup): Renamed from `org-add-log-maybe'.
(org-log-note-headings): New entry for plain notes (i.e. notes not
related to state changes or clocking).
(org-get-org-file): Check for availability of
`remember-data-file'.
(org-cached-entry-get): Allow a regexp value for
`org-use-property-inheritance'.
(org-use-property-inheritance): Allow regexp value. Fix bug in
customization type.
(org-use-tag-inheritance): Allow a list and a regexp value for
this variable.
(org-scan-tags, org-get-tags-at): Implement selective tag
inheritance.
(org-entry-get): Respect value `selective' for the INHERIT
argument.
(org-tag-inherit-p, org-property-inherit-p): New functions.
(org-agenda-format-date-aligned): Allow 10 characters for
weekday, to acomodate German locale.
(org-add-archive-files): New function.
(org-agenda-files): New argument `ext', to
get archive files as well.
(org-tbl-menu): Protect the use of variables that
are only available when org-table.el gets loaded.
(org-read-agenda-file-list): Error if `org-agenda-files' is a
single directory.
(org-open-file): Allow a batch process to trigger
waiting after executing a system command.
(org-store-link): Link to headline when there is not
target and no region in an org-mode buffer when creating a link.
(org-link-types-re): New variable.
(org-make-link-regexps): Compute `org-link-types-re'.
(org-make-link-description-function): New option.
(org-agenda-date, org-agenda-date-weekend): New faces.
(org-archive-sibling-heading): New option.
(org-archive-to-archive-sibling): New function.
(org-iswitchb): New command.
(org-buffer-list): New function.
(org-agenda-columns): Also try the #+COLUMNS line in
the buffer associated with the entry at point (or with the first
entry in the agenda view).
(org-modules): Add entry for org-bibtex.el.
(org-completion-fallback-command): Moved into `org-completion'
group.
(org-clock-heading-function): Moved to `org-progress' group.
(org-auto-repeat-maybe): Make sure that a note can
be enforces if `org-log-repeat' is `note'.
(org-modules): Allow additional symbols for external
packages.
(org-ctrl-c-ctrl-c): Allow for `org-clock-overlays' to be
undefined.
(org-clock-goto): Hide drawers after showing an
entry with `org-clock-goto.'
(org-shiftup, org-shiftdown, org-shiftright, org-shiftleft): Try
also a clocktable block shift.
(org-clocktable-try-shift): New function.
(org-columns-hscoll-title): New function.
(org-columns-previous-hscroll): New variable.
(org-columns-full-header-line-format): New variable.
(org-columns-display-here-title, org-columns-remove-overlays):
Install `org-columns-hscoll-title' in post-command-hook.
* org/org.el: Split into many small files.
* org/org-agenda.el: New file, split off from org.el.
* org/org-archive.el: New file, split off from org.el.
* org/org-bbdb.el: New file.
* org/org-bibtex.el: New file, split off from org.el.
* org/org-clock.el: New file, split off from org.el.
* org/org-colview.el: New file, split off from org.el.
* org/org-compat.el: New file, split off from org.el.
* org/org-exp.el: New file, split off from org.el.
* org/org-faces.el: New file, split off from org.el.
* org/org-gnus.el: New file, split off from org.el.
* org/org-info.el: New file, split off from org.el.
* org/org-infojs.el: New file.
* org/org-irc.el: New file.
* org/org-macs.el: New file, split off from org.el.
* org/org-mew.el: New file.
* org/org-mhe.el: New file, split off from org.el.
* org/org-publish.el: New file, split off from org.el.
* org/org-remember.el: New file, split off from org.el.
* org/org-rmail.el: New file, split off from org.el.
* org/org-table.el: New file, split off from org.el.
* org/org-vm.el: New file, split off from org.el.
* org/org-wl.el: New file, split off from org.el.
2008-04-27 Jason Riedy <jason@acm.org>
* lisp/org-table.el (orgtbl-to-generic): Add a :remove-nil-lines
parameter that supresses lines that evaluate to NIL.
(orgtbl-get-fmt): New inline function for
picking apart formats that may be lists.
(orgtbl-apply-fmt): New inline function for applying formats that
may be functions.
(orgtbl-eval-str): New inline function for strings that may be
functions.
(orgtbl-format-line, orgtbl-to-generic): Use and document.
(orgtbl-to-latex, orgtbl-to-texinfo): Document.
(*orgtbl-llfmt*, *orgtbl-llstart*)
(*orgtbl-llend*): Dynamic variables for last-line formatting.
(orgtbl-format-section): Shift formatting to support detecting the
last line and formatting it specially.
(orgtbl-to-generic): Document :ll* formats. Set to the non-ll
formats unless overridden.
(orgtbl-to-latex): Suggest using :llend to suppress the final \\.
(*orgtbl-table*, *orgtbl-rtn*): Dynamically
bound variables to hold the input collection of lines and output
formatted text.
(*orgtbl-hline*, *orgtbl-sep*, *orgtbl-fmt*, *orgtbl-efmt*,
(*orgtbl-lfmt*, *orgtbl-lstart*, *orgtbl-lend*): Dynamically bound
format parameters.
(orgtbl-format-line): New function encapsulating formatting for a
single line.
(orgtbl-format-section): Similar for each section. Rebinding the
dynamic vars customizes the formatting for each section.
(orgtbl-to-generic): Use orgtbl-format-line and
orgtbl-format-section.
(org-get-param): Now unused, so delete.
(orgtbl-gather-send-defs): New function to
gather all the SEND definitions before a table.
(orgtbl-send-replace-tbl): New function to find the RECEIVE
corresponding to the current name.
(orgtbl-send-table): Use the previous two functions and implement
multiple destinations for each table.
* doc/org.texi (A LaTeX example): Note that fmt may be a
one-argument function, and efmt may be a two-argument function.
(Radio tables): Document multiple destinations.
2008-04-27 Carsten Dominik <dominik@science.uva.nl>
* org/org-agenda.el (org-add-to-diary-list): New function.
(org-prefix-has-effort): New variable.
(org-sort-agenda-noeffort-is-high): New option.
(org-agenda-columns-show-summaries)
(org-agenda-columns-compute-summary-properties): New options.
(org-format-agenda-item): Compute the duration of the item.
(org-agenda-weekend-days): New variable.
(org-agenda-list, org-timeline): Use the proper faces for dates in
the agenda and timeline buffers.
(org-agenda-archive-to-archive-sibling): New command.
(org-agenda-start-with-clockreport-mode): New option.
(org-agenda-clockreport-parameter-plist): New option.
(org-agenda-clocktable-mode): New variable.
(org-agenda-deadline-leaders): Allow a function value for the
deadline leader.
(org-agenda-get-deadlines): Deal with new function value.
* lisp/org-clock.el (org-clock): New customization group.
(org-clock-into-drawer, org-clock-out-when-done)
(org-clock-in-switch-to-state, org-clock-heading-function): Moved
into the new group.
(org-clock-out-remove-zero-time-clocks): New option.
(org-clock-out): Use `org-clock-out-remove-zero-time-clocks'.
(org-dblock-write:clocktable): Allow a Lisp form for the scope
parameter.
(org-dblock-write:clocktable): Fixed bug with total time
calculation.
(org-dblock-write:clocktable): Request the unrestricted list of
files.
(org-get-clocktable): New function.
(org-dblock-write:clocktable): Make sure :tstart and :tend can not
only be strings but also integers (an absolute day number) and
lists (m d y).
* org/org-colview.el (org-columns-next-allowed-value)
(org-columns-edit-value): Limit the effort for updatig in the
agenda to recomputing a single file.
(org-columns-compute): Only write property value if it has
changed. This avoids raising the buffer-change-flag
unnecessarily.
(org-agenda-colview-summarize)
(org-agenda-colview-compute): New functions.
(org-agenda-columns): Call `org-agenda-colview-summarize'.
* org/org-exp.el (org-export-run-in-background): New option.
(org-export-icalendar): Allow a batch process to trigger waiting
after executing a system command.
(org-export-preprocess-string): Renamed-from
`org-cleaned-string-for-export'.
(org-export-html-style): Made target class look like normal text.
(org-export-as-html): Make use of the better proprocessing in
`org-cleaned-string-for-export'.
(org-cleaned-string-for-export): Better treatment of heuristic
targets, many more internal links will now work in HTML export.
(org-get-current-options): Incorporate LINK_UP, LINK_HOME, and
INFOJS.
(org-export-inbuffer-options-extra): New variable.
(org-export-options-filters): New hook.
(org-infile-export-plist): Find also the settings keywords in
`org-export-inbuffer-options-extra'.
(org-infile-export-plist): Allow multiple #+OPTIONS lines and
multiple #+INFOJS_OPT lines.
(org-export-html-handle-js-options): New function.
(org-export-html-infojs-setup): New option.
(org-export-as-html): Call `org-export-html-handle-js-options'.
Add autoload to all entry points.
(org-skip-comments): Function removed.
* org/org-table.el (org-table-make-reference): Extra parenthesis
around single fields, to make sure that algebraic formulas get
correctly interpreted by calc.
(org-table-current-column): No longer interactive.
* org/org-export-latex.el (org-export-latex-preprocess): Renamed
from `org-export-latex-cleaned-string'.
2008-04-27 Bastien Guerry <bzg@altern.org>
* org/org-publish.el (org-publish-get-base-files-1): New function.
(org-publish-get-base-files): Use it.
(org-publish-temp-files): New variable.
Don't require 'dired-aux anymore.
(org-publish-initial-buffer): New variable.
(org-publish-org-to, org-publish): Use it.
(org-publish-get-base-files-1): Bug fix: get
the proper list of files when recursing thru a directory.
(org-publish-get-base-files): Use the :exclude property to skip
both files and directories.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Sun, 27 Apr 2008 18:33:39 +0000 |
parents | 1e3a407766b9 |
children | ee5932bf781d |
rev | line source |
---|---|
53203 | 1 ;;; help-at-pt.el --- local help through the keyboard |
2 | |
79721 | 3 ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
53203 | 4 |
5 ;; Author: Luc Teirlinck <teirllm@auburn.edu> | |
6 ;; Keywords: help | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
12 ;; the Free Software Foundation; either version 3, or (at your option) |
53203 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64091 | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 ;; Boston, MA 02110-1301, USA. | |
53203 | 24 |
25 ;;; Commentary: | |
26 | |
27 ;; This file contains functionality to make the help provided by the | |
28 ;; help-echo text or overlay property available to the keyboard user. | |
29 ;; It also supports a more keyboard oriented alternative to | |
30 ;; `help-echo', namely a new text or overlay property `kbd-help'. | |
31 ;; | |
32 ;; It provides facilities to access the local help available at point | |
33 ;; either on demand, using the command `display-local-help', or | |
34 ;; automatically after a suitable idle time, through the customizable | |
35 ;; variable `help-at-pt-display-when-idle'. | |
36 ;; | |
37 ;; You can get a more global overview of the local help available in | |
38 ;; the buffer, using the commands `scan-buf-next-region' and | |
39 ;; `scan-buf-previous-region', which move to the start of the next or | |
40 ;; previous region with available local help and print the help found | |
41 ;; there. | |
42 ;; | |
54524
d3e10b0b1a2e
Move suggestions for key bindings to Commentary.
Juri Linkov <juri@jurta.org>
parents:
54283
diff
changeset
|
43 ;; Suggested key bindings: |
d3e10b0b1a2e
Move suggestions for key bindings to Commentary.
Juri Linkov <juri@jurta.org>
parents:
54283
diff
changeset
|
44 ;; |
d3e10b0b1a2e
Move suggestions for key bindings to Commentary.
Juri Linkov <juri@jurta.org>
parents:
54283
diff
changeset
|
45 ;; (global-set-key [C-tab] 'scan-buf-next-region) |
d3e10b0b1a2e
Move suggestions for key bindings to Commentary.
Juri Linkov <juri@jurta.org>
parents:
54283
diff
changeset
|
46 ;; (global-set-key [C-M-tab] 'scan-buf-previous-region) |
d3e10b0b1a2e
Move suggestions for key bindings to Commentary.
Juri Linkov <juri@jurta.org>
parents:
54283
diff
changeset
|
47 ;; |
53203 | 48 ;; You do not have to do anything special to use the functionality |
49 ;; provided by this file, because all important functions autoload. | |
50 | |
51 ;;; Code: | |
52 | |
53 (defgroup help-at-pt nil | |
54 "Features for displaying local help." | |
55 :group 'help | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59727
diff
changeset
|
56 :version "22.1") |
53203 | 57 |
58 ;;;###autoload | |
59 (defun help-at-pt-string (&optional kbd) | |
60 "Return the help-echo string at point. | |
61 Normally, the string produced by the `help-echo' text or overlay | |
62 property, or nil, is returned. | |
63 If KBD is non-nil, `kbd-help' is used instead, and any | |
64 `help-echo' property is ignored. In this case, the return value | |
65 can also be t, if that is the value of the `kbd-help' property." | |
66 (let* ((prop (if kbd 'kbd-help 'help-echo)) | |
67 (pair (get-char-property-and-overlay (point) prop)) | |
68 (val (car pair)) | |
69 (ov (cdr pair))) | |
70 (if (functionp val) | |
71 (funcall val (selected-window) (if ov ov (current-buffer)) (point)) | |
72 (eval val)))) | |
73 | |
74 ;;;###autoload | |
75 (defun help-at-pt-kbd-string () | |
76 "Return the keyboard help string at point. | |
77 If the `kbd-help' text or overlay property at point produces a | |
78 string, return it. Otherwise, use the `help-echo' property. If | |
79 this produces no string either, return nil." | |
80 (let ((kbd (help-at-pt-string t)) | |
81 (echo (help-at-pt-string))) | |
82 (if (and kbd (not (eq kbd t))) kbd echo))) | |
83 | |
84 ;;;###autoload | |
85 (defun display-local-help (&optional arg) | |
86 "Display local help in the echo area. | |
87 This displays a short help message, namely the string produced by | |
88 the `kbd-help' property at point. If `kbd-help' does not produce | |
89 a string, but the `help-echo' property does, then that string is | |
90 printed instead. | |
91 | |
92 A numeric argument ARG prevents display of a message in case | |
93 there is no help. While ARG can be used interactively, it is | |
94 mainly meant for use from Lisp." | |
95 (interactive "P") | |
96 (let ((help (help-at-pt-kbd-string))) | |
97 (if help | |
98 (message "%s" help) | |
99 (if (not arg) (message "No local help at point"))))) | |
100 | |
57798
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
101 (defvar help-at-pt-timer nil |
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
102 "Non-nil means that a timer is set that checks for local help. |
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
103 If non-nil, this is the value returned by the call of |
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
104 `run-with-idle-timer' that set that timer. This variable is used |
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
105 internally to enable `help-at-pt-display-when-idle'. Do not set it |
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
106 yourself.") |
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
107 |
53203 | 108 (defcustom help-at-pt-timer-delay 1 |
109 "*Delay before displaying local help. | |
110 This is used if `help-at-pt-display-when-idle' is enabled. | |
111 The value may be an integer or floating point number. | |
112 | |
113 If a timer is already active, there are two ways to make the new | |
114 value take effect immediately. After setting the value, you can | |
115 first call `help-at-pt-cancel-timer' and then set a new timer | |
54283
d0c3cadb7e21
(help-at-pt-timer-delay): Minor doc fix (remove stray space).
Luc Teirlinck <teirllm@auburn.edu>
parents:
53208
diff
changeset
|
116 with `help-at-pt-set-timer'. Alternatively, you can set this |
53203 | 117 variable through Custom. This will not set a timer if none is |
118 active, but if one is already active, Custom will make it use the | |
119 new value." | |
120 :group 'help-at-pt | |
121 :type 'number | |
57798
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
122 :initialize 'custom-initialize-default |
53203 | 123 :set (lambda (variable value) |
124 (set-default variable value) | |
57798
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
125 (and (boundp 'help-at-pt-timer) |
bb24af8f5452
(help-at-pt-timer): Move defvar up to avoid compiler warning.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57542
diff
changeset
|
126 help-at-pt-timer |
57802
edb9ccd02dbf
(help-at-pt-timer-delay, help-at-pt-display-when-idle): Remove
Luc Teirlinck <teirllm@auburn.edu>
parents:
57798
diff
changeset
|
127 (timer-set-idle-time help-at-pt-timer value t)))) |
53203 | 128 |
129 ;;;###autoload | |
130 (defun help-at-pt-cancel-timer () | |
131 "Cancel any timer set by `help-at-pt-set-timer'. | |
132 This disables `help-at-pt-display-when-idle'." | |
133 (interactive) | |
134 (let ((inhibit-quit t)) | |
135 (when help-at-pt-timer | |
136 (cancel-timer help-at-pt-timer) | |
137 (setq help-at-pt-timer nil)))) | |
138 | |
139 ;;;###autoload | |
140 (defun help-at-pt-set-timer () | |
141 "Enable `help-at-pt-display-when-idle'. | |
142 This is done by setting a timer, if none is currently active." | |
143 (interactive) | |
144 (unless help-at-pt-timer | |
145 (setq help-at-pt-timer | |
146 (run-with-idle-timer | |
147 help-at-pt-timer-delay t #'help-at-pt-maybe-display)))) | |
148 | |
59727
86b02098f260
(help-at-pt-display-when-idle): Add autoload cookie.
Luc Teirlinck <teirllm@auburn.edu>
parents:
57802
diff
changeset
|
149 ;;;###autoload |
53203 | 150 (defcustom help-at-pt-display-when-idle 'never |
151 "*Automatically show local help on point-over. | |
152 If the value is t, the string obtained from any `kbd-help' or | |
153 `help-echo' property at point is automatically printed in the | |
154 echo area, if nothing else is already displayed there, or after a | |
155 quit. If both `kbd-help' and `help-echo' produce help strings, | |
156 `kbd-help' is used. If the value is a list, the help only gets | |
157 printed if there is a text or overlay property at point that is | |
158 included in this list. Suggested properties are `keymap', | |
159 `local-map', `button' and `kbd-help'. Any value other than t or | |
160 a non-empty list disables the feature. | |
161 | |
162 This variable only takes effect after a call to | |
163 `help-at-pt-set-timer'. The help gets printed after Emacs has | |
164 been idle for `help-at-pt-timer-delay' seconds. You can call | |
165 `help-at-pt-cancel-timer' to cancel the timer set by, and the | |
166 effect of, `help-at-pt-set-timer'. | |
167 | |
168 When this variable is set through Custom, `help-at-pt-set-timer' | |
169 is called automatically, unless the value is `never', in which | |
170 case `help-at-pt-cancel-timer' is called. Specifying an empty | |
171 list of properties through Custom will set the timer, thus | |
172 enabling buffer local values. It sets the actual value to nil. | |
173 Thus, Custom distinguishes between a nil value and other values | |
174 that disable the feature, which Custom identifies with `never'. | |
175 The default is `never'." | |
176 :group 'help-at-pt | |
177 :type '(choice (const :tag "Always" | |
178 :format "%t\n%h" | |
179 :doc | |
180 "This choice can get noisy. | |
181 The text printed from the `help-echo' property is often only | |
182 relevant when using the mouse. If you mind about too many | |
183 messages getting printed in the echo area, use \"In certain | |
184 situations\". See the documentation there for more information." | |
185 t) | |
186 (repeat :tag "In certain situations" | |
187 ;; unless we specify 0 offset the doc string | |
188 ;; for this choice gets indented very | |
189 ;; differently than for the other two | |
190 ;; choices, when "More" is selected. | |
191 :offset 0 | |
192 :format "%{%t%}:\n%v%i\n%h" | |
193 :doc | |
194 "This choice lets you specify a list of \ | |
195 text properties. | |
196 Presence of any of these properties will trigger display of | |
197 available local help on point-over. | |
198 If you use this alternative through Custom without listing any | |
199 properties, a timer will be set anyway. This will enable buffer | |
200 local values. Use \"Never\" if you do not want a timer to be set. | |
201 | |
202 Suggested properties: | |
203 The `keymap' and `local-map' properties change keybindings in | |
204 parts of the buffer. Some of these keymaps are mode independent | |
205 and are not mentioned in the mode documentation. Hence, the help | |
206 text is likely to be useful. | |
207 Specifying `button' is relevant in Custom and similar buffers. | |
208 In these buffers, most, but not all, of the text shown this way is | |
209 available by default when using tab, but not on regular point-over. | |
210 The presence of a `kbd-help' property guarantees that non mouse | |
211 specific help is available." | |
212 :value (keymap local-map button kbd-help) | |
213 symbol) | |
214 (other :tag "Never" | |
215 :format "%t\n%h" | |
216 :doc | |
217 "This choice normally disables buffer local values. | |
218 If you choose this value through Custom and a timer checking for | |
219 local help is currently active, it will be canceled. No new | |
220 timer will be set. Call `help-at-pt-set-timer' after choosing | |
221 this option, or use \"In certain situations\" and specify no text | |
222 properties, to enable buffer local values." | |
223 never)) | |
224 :initialize 'custom-initialize-default | |
225 :set #'(lambda (variable value) | |
226 (set-default variable value) | |
227 (if (eq value 'never) | |
228 (help-at-pt-cancel-timer) | |
229 (help-at-pt-set-timer))) | |
230 :set-after '(help-at-pt-timer-delay) | |
57802
edb9ccd02dbf
(help-at-pt-timer-delay, help-at-pt-display-when-idle): Remove
Luc Teirlinck <teirllm@auburn.edu>
parents:
57798
diff
changeset
|
231 :require 'help-at-pt) |
53203 | 232 |
233 ;; Function for use in `help-at-pt-set-timer'. | |
234 (defun help-at-pt-maybe-display () | |
235 (and (or (eq help-at-pt-display-when-idle t) | |
236 (and (consp help-at-pt-display-when-idle) | |
237 (catch 'found | |
238 (dolist (prop help-at-pt-display-when-idle) | |
239 (if (get-char-property (point) prop) | |
240 (throw 'found t)))))) | |
241 (or (not (current-message)) | |
242 (string= (current-message) "Quit")) | |
243 (display-local-help t))) | |
244 | |
245 ;;;###autoload | |
246 (defun scan-buf-move-to-region (prop &optional arg hook) | |
247 "Go to the start of the next region with non-nil PROP property. | |
248 Then run HOOK, which should be a quoted symbol that is a normal | |
73330
400487787181
* dnd.el (dnd-handle-one-url): Fix typo in doc-string.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
249 hook variable, or an expression evaluating to such a symbol. |
53203 | 250 Adjacent areas with different non-nil PROP properties are |
251 considered different regions. | |
252 | |
253 With numeric argument ARG, move to the start of the ARGth next | |
254 such region, then run HOOK. If ARG is negative, move backward. | |
255 If point is already in a region, then that region does not count | |
256 toward ARG. If ARG is 0 and point is inside a region, move to | |
257 the start of that region. If ARG is 0 and point is not in a | |
258 region, print a message to that effect, but do not move point and | |
259 do not run HOOK. If there are not enough regions to move over, | |
260 an error results and the number of available regions is mentioned | |
261 in the error message. Point is not moved and HOOK is not run." | |
262 (cond ((> arg 0) | |
263 (if (= (point) (point-max)) | |
264 (error "No further `%s' regions" prop)) | |
265 (let ((pos (point))) | |
266 (dotimes (x arg) | |
267 (setq pos (next-single-char-property-change pos prop)) | |
268 (unless (get-char-property pos prop) | |
269 (setq pos (next-single-char-property-change pos prop)) | |
270 (unless (get-char-property pos prop) | |
271 (cond ((= x 0) | |
272 (error "No further `%s' regions" prop)) | |
273 ((= x 1) | |
274 (error "There is only one further `%s' region" prop)) | |
275 (t | |
276 (error | |
277 "There are only %d further `%s' regions" | |
278 x prop)))))) | |
279 (goto-char pos) | |
280 (run-hooks hook))) | |
281 ((= arg 0) | |
282 (let ((val (get-char-property (point) prop))) | |
283 (cond ((not val) | |
284 (message "Point is not in a `%s' region" prop)) | |
285 ((eq val (get-char-property (1- (point)) prop)) | |
286 (goto-char | |
287 (previous-single-char-property-change (point) prop)) | |
288 (run-hooks hook)) | |
289 (t (run-hooks hook))))) | |
290 ((< arg 0) | |
291 (let ((pos (point)) (val (get-char-property (point) prop))) | |
292 (and val | |
293 (eq val (get-char-property (1- pos) prop)) | |
294 (setq pos | |
295 (previous-single-char-property-change pos prop))) | |
296 (if (= pos (point-min)) | |
297 (error "No prior `%s' regions" prop)) | |
298 (dotimes (x (- arg)) | |
299 (setq pos (previous-single-char-property-change pos prop)) | |
300 (unless (get-char-property pos prop) | |
301 (setq pos (previous-single-char-property-change pos prop)) | |
302 (unless (get-char-property pos prop) | |
303 (cond ((= x 0) | |
304 (error "No prior `%s' regions" prop)) | |
305 ((= x 1) | |
306 (error "There is only one prior `%s' region" prop)) | |
307 (t | |
308 (error "There are only %d prior `%s' regions" | |
309 x prop)))))) | |
310 (goto-char pos) | |
311 (run-hooks hook))))) | |
312 | |
313 ;; To be moved to a different file and replaced by a defcustom in a | |
314 ;; future version. | |
315 (defvar scan-buf-move-hook '(display-local-help) | |
316 "Normal hook run by `scan-buf-next-region'. | |
317 Also used by `scan-buf-previous-region'. The hook is run after | |
318 positioning point.") | |
319 | |
320 ;;;###autoload | |
321 (defun scan-buf-next-region (&optional arg) | |
322 "Go to the start of the next region with non-nil help-echo. | |
323 Print the help found there using `display-local-help'. Adjacent | |
324 areas with different non-nil help-echo properties are considered | |
325 different regions. | |
326 | |
327 With numeric argument ARG, move to the start of the ARGth next | |
328 help-echo region. If ARG is negative, move backward. If point | |
329 is already in a help-echo region, then that region does not count | |
330 toward ARG. If ARG is 0 and point is inside a help-echo region, | |
331 move to the start of that region. If ARG is 0 and point is not | |
332 in such a region, just print a message to that effect. If there | |
333 are not enough regions to move over, an error results and the | |
334 number of available regions is mentioned in the error message. | |
335 | |
336 A potentially confusing subtlety is that point can be in a | |
337 help-echo region without any local help being available. This is | |
338 because `help-echo' can be a function evaluating to nil. This | |
339 rarely happens in practice." | |
340 (interactive "p") | |
341 (scan-buf-move-to-region 'help-echo arg 'scan-buf-move-hook)) | |
342 | |
343 ;;;###autoload | |
344 (defun scan-buf-previous-region (&optional arg) | |
345 "Go to the start of the previous region with non-nil help-echo. | |
346 Print the help found there using `display-local-help'. Adjacent | |
347 areas with different non-nil help-echo properties are considered | |
348 different regions. With numeric argument ARG, behaves like | |
349 `scan-buf-next-region' with argument -ARG.." | |
350 (interactive "p") | |
351 (scan-buf-move-to-region 'help-echo (- arg) 'scan-buf-move-hook)) | |
352 | |
353 (provide 'help-at-pt) | |
354 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
355 ;; arch-tag: d0b8b86d-d23f-45d0-a82d-208d6205a583 |
53203 | 356 ;;; help-at-pt.el ends here |