Commit graph

513 commits

Author SHA1 Message Date
Lars Ingebrigtsen
8ef8da13f6 Fix typo in last help-fns--insert-menu-bindings change
* lisp/help-fns.el (help-fns--insert-menu-bindings): Fix typo in
last change.
2022-10-03 21:35:43 +02:00
Lars Ingebrigtsen
71735be475 Improve help-fns--insert-menu-bindings formatting
* lisp/help-fns.el (help-fns--insert-menu-bindings): Make this
work better for menus that turn out to not be reachable after all
-- i.e., don't insert " and " before the heading in certain cases.
2022-10-03 21:32:01 +02:00
Lars Ingebrigtsen
e3fa41ac92 Fix *Help* output for native-comp functions from IELM
* lisp/help-fns.el (find-lisp-object-file-name): Don't claim that
native-comp functions that are defined outside of files (for
instance, created by calling `native-compile' in IELM) are in C
source (bug#57819).
2022-09-16 13:38:09 +02:00
Lars Ingebrigtsen
c4235eb26d Make help-fns--generalized-variable more resilient
* lisp/help-fns.el (help-fns--generalized-variable): Don't bug out
when a key binding isn't a symbol.
2022-09-14 01:40:17 +02:00
Stefan Kangas
6cd9e586cc New function substitute-quotes
* lisp/help.el (substitute-quotes): New function.  (Bug#51040)
* doc/lispref/help.texi (Keys in Documentation): Document
substitute-quotes.
* test/lisp/help-tests.el (help-tests-substitute-quotes): New test.

* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/emacs-lisp/cl-extra.el (cl--describe-class):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/help-fns.el (help-fns--parent-mode, help-fns--var-risky)
(help-fns--var-file-local, help-fns--var-bufferlocal)
(describe-face):
* lisp/help.el (substitute-command-keys):
* lisp/progmodes/octave.el (octave-help): Use the new function
instead of 'substitute-command-keys'.
2022-09-10 07:37:36 +02:00
Gregory Heytings
b648634982 ; * lisp/help-fns.el (help-fns--key-bindings): Fix previous change. 2022-09-06 00:15:49 +02:00
Gregory Heytings
c641848bce Simplify describe-function.
* lisp/help-fns.el (describe-function-1): Do not pass
'describe-function-orig-buffer' as argument to...
(help-fns--key-bindings): but use it directly there instead.
This simplifies 1d1158397b.
2022-09-05 23:30:14 +02:00
Lars Ingebrigtsen
500af031c8 Fix some help-fns test failures
* lisp/help-fns.el (help-fns--key-bindings): Fix test failures
from recent change.
2022-09-04 11:37:32 +02:00
Gregory Heytings
1d1158397b Look up keybindings in correct buffer in describe-function.
* lisp/help-fns.el (help-fns--key-bindings): New parameter.
Use it when looking up keybindings.
(describe-function-1): Add the buffer in which the command
was invoked as argument to 'help-fns--key-bindings'.
Fixes bug#57568.
2022-09-04 00:45:04 +02:00
Stefan Monnier
996f8d85d7 * lisp/help-fns.el (find-lisp-object-file-name): Revert last change 2022-09-03 10:33:02 -04:00
Stefan Monnier
c12838c73e * lisp/help-fns.el: Minor fixes
(describe-mode--minor-modes): Don't burp on minor modes that lack a docstring.
(describe-mode--minor-modes): Simplify eta-redex.
(find-lisp-object-file-name): Use `autoload-file`.
(help-fns--describe-function-or-command-prompt): Allow the user to
insist on choosing a function even if it appears not to exist.
2022-09-02 09:54:35 -04:00
Lars Ingebrigtsen
9d9798521e Don't mention obsolete generalized variables in *Help*
* lisp/help-fns.el (help-fns--generalized-variable): Don't mention
obsolete ones.
2022-08-23 12:23:09 +02:00
Lars Ingebrigtsen
643990336f Make *Help* display info about generalized variables
* lisp/help-fns.el (help-fns--generalized-variable): New function
to document generalized variables.
2022-08-22 00:37:29 +02:00
Stefan Monnier
1faeef7924 (compiled-function-p): New function (bug#56648)
* lisp/subr.el (compiled-function-p): New function.

* test/lisp/international/ucs-normalize-tests.el (ucs-normalize-part1):
* lisp/gnus/gnus.el (gnus):
* lisp/mh-e/mh-e.el (mh-version):
* lisp/emacs-lisp/macroexp.el (emacs-startup-hook):
* lisp/emacs-lisp/cl-macs.el (compiled-function):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition)
(byte-compile, display-call-tree):
* lisp/emacs-lisp/byte-opt.el (<toplevel-end>):
* lisp/emacs-lisp/advice.el (ad-compiled-p):
* lisp/cedet/semantic/bovine.el (semantic-bovinate-stream):
* lisp/loadup.el (macroexpand-all):
* admin/unidata/unidata-gen.el (unidata--ensure-compiled): Use it.

* lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
Add entries for it.
(pcase--split-pred): Use it.

* lisp/help-fns.el (help-fns-function-description-header): Use `functionp`.
(help-fns--var-safe-local): Use `compiled-function-p`.
2022-08-14 12:30:05 -04:00
Stefan Kangas
3d7d8ddc5a ; Fix typos 2022-08-08 14:23:29 +02:00
Stefan Kangas
a463dccdd0 Merge from origin/emacs-28
b4067394dc Set `default-directory' of Tramp archive connection buffer
2529e82002 ; * doc/lispref/functions.texi (Declare Form): Fix typo.
54c4ceb009 Update the documentation of 'declare' forms
7263631dca Fix bookmark support for Help functions in native-compilat...

# Conflicts:
#	lisp/help.el
2022-07-24 09:55:01 +02:00
Eli Zaretskii
7263631dca Fix bookmark support for Help functions in native-compilation builds
* lisp/help.el (describe-key--helper, describe-function--helper):
New helper functions.
(describe-key): Call 'describe-key--helper' instead of a
lambda-function.
* lisp/help-fns.el (describe-function): Call
'describe-function--helper' instead of a lambda-function.
(Bug#56643)
2022-07-23 11:11:47 +03:00
Stefan Kangas
df508ffd2b Merge from origin/emacs-28
ae1ace1cf4 Adjust help-fns.el tests for recent change
04bdcf4aaa * src/terminal.c (Fframe_terminal): Use active voice
7fa491a9e9 Improve 'terminal-live-p' docstring some more
b9ac8c29ae Improve terminal-live-p docstring
0b4c81a152 * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-vector): F...
8f8373170f * lisp/progmodes/cperl-mode.el: Don't mention obsolete arc...
25bc330a6d Make 'describe-function' say "byte-compiled" when appropriate
2b31e667be ;Improve documentation of locale-specific string comparison
2022-07-23 01:37:59 +02:00
Stefan Kangas
c8a586c1db Don't list obsolete in "other commands" help section
* lisp/help-fns.el (help-fns--list-local-commands): Don't list
obsolete commands.
2022-07-21 09:23:20 +02:00
Eli Zaretskii
25bc330a6d Make 'describe-function' say "byte-compiled" when appropriate
* lisp/help-fns.el (help-fns-function-description-header): Say
"byte-compiled" when describing byte-compiled functions.
2022-07-21 10:18:30 +03:00
Stefan Monnier
c32212bf96 (help-fns--first-release): Try and avoid false positives
We used to use a very "optimistic" regexp which worked well for
longish symbol names but suffered from too many false positives on
short names.  Use a more restrictive regexp, which should make the
recent "weed out" change unnecessary.

This in turn requires the use of '...' more consistently in etc/NEWS* files.

* lisp/help-fns.el (help-fns--first-release-regexp): New function.
(help-fns--first-release): Use it.  Fix minor issue with the Emacs
version regexp.
(help-fns--mention-first-release): Undo last change.

* etc/NEWS*: Replace `...' with '...'.  Indent code examples by at
least 2 spaces. Add previously missing '...' quotes around many of
the variables and functions described.
2022-07-18 22:22:34 -04:00
Lars Ingebrigtsen
9b5eb661bf Fix xref links in `C-h o'
* lisp/help-fns.el (describe-symbol): Make xref links happen in
all sections (bug#49587).

* lisp/help-fns.el (describe-symbol): Add back/forward links.

* lisp/help-mode.el (help-make-xrefs): Factor out links from
here...
(help-xref--navigation-buttons): To here.
2022-07-16 18:26:58 +02:00
Lars Ingebrigtsen
630bbe3932 Weed out some false positives in help-fns--mention-first-release
* lisp/help-fns.el (help-fns--mention-first-release): Weed out
things that give too many false positives (bug#49062).
2022-07-16 13:52:46 +02:00
Stefan Kangas
27c3a8b277 Remove some ineffectual calls to purecopy
* lisp/dired.el (dired-chown-program, dired-trivial-filenames):
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function):
* lisp/help-fns.el (help-fns--mention-shortdoc-groups):
* lisp/mail/mail-extr.el (mail-extr-full-name-prefixes)
(mail-extr-all-letters-but-separators, mail-extr-all-letters)
(mail-extr-first-letters, mail-extr-last-letters)
(mail-extr-bad-dot-pattern, mail-extr-full-name-suffix-pattern)
(mail-extr-alternative-address-pattern)
(mail-extr-trailing-comment-start-pattern)
(mail-extr-name-pattern, mail-extr-telephone-extension-pattern)
(mail-extr-ham-call-sign-pattern, mail-extr-normal-name-pattern)
(mail-extr-two-name-pattern)
(mail-extr-listserv-list-name-pattern)
(mail-extr-stupid-vms-date-stamp-pattern)
(mail-extr-hz-embedded-gb-encoded-chinese-pattern)
(mail-extr-x400-encoded-address-pattern)
(mail-extr-x400-encoded-address-field-pattern-format)
(mail-extr-x400-encoded-address-surname-pattern)
(mail-extr-x400-encoded-address-given-name-pattern)
(mail-extr-x400-encoded-address-full-name-pattern): Remove
ineffectual calls to purecopy.
2022-07-10 19:42:25 +02:00
Eli Zaretskii
a525c9f5c9 ; Fix doc strings in help-fns.el
* lisp/help-fns.el (help-fns-edit-mode-done)
(help-fns-edit-mode-cancel): Doc fixes.
2022-07-04 15:13:12 +03:00
Stefan Kangas
906b97edb9 New command help-fns-edit-mode-cancel
* lisp/help-fns.el (help-fns-edit-mode-cancel): New command.
(help-fns--edit-value-mode-map): Bind it to 'C-c C-k'.
(help-fns-edit-variable): Advertise it in help text.
2022-07-04 12:12:45 +02:00
Lars Ingebrigtsen
fb0d95984b Put the obsoletion earlier in the *Help* buffer
* lisp/help-fns.el (help-fns--obsolete): Remove indentation and fill.
(help-fns--var-obsolete): Ditto.
(describe-function-1): Output the obsoletion info first since it's
vital information.
(describe-variable): Ditto (bug#56251).
2022-06-28 15:22:13 +02:00
Lars Ingebrigtsen
19c44e2be3 Font-lock variable values in *Help*
* lisp/help-fns.el (describe-variable): Font-lock the variable
value (bug#47363).
2022-06-26 21:43:05 +02:00
Lars Ingebrigtsen
ac39c327b5 Tweak quoting in help-fns--compiler-macro
* lisp/help-fns.el (help-fns--compiler-macro): Fix quotes in help
text.
2022-06-20 02:12:06 +02:00
Lars Ingebrigtsen
0edc2f4901 Fix some declare-after-interactive functions
* lisp/progmodes/opascal.el (opascal-new-comment-line):
* lisp/image-mode.el (image-transform-fit-to-height):
* lisp/help-fns.el (help-fns-edit-variable):
* lisp/gnus/gnus-salt.el (gnus-pick-start-reading):
* lisp/eshell/esh-util.el (eshell-for):
* lisp/ldefs-boot.el (view-return-to-alist-update): Fix warnings
about declare after interactive.
2022-06-17 18:19:02 +02:00
Stefan Kangas
250f9e7f83 Improve help-enable-variable-value-editing help
* lisp/help-fns.el (help-enable-variable-value-editing): Expand
docstring to better explain what effect it has.
(help-fns-edit-variable): Use command substitution.
2022-06-17 16:30:51 +02:00
Lars Ingebrigtsen
488a4cd61b Allow editing all symbols in help-fns--editable-variable
* lisp/help-fns.el (help-fns--editable-variable): Allow editing
all symbols (bug#56038).
2022-06-17 16:30:16 +02:00
Lars Ingebrigtsen
fbc0cc0e9f Re-re-fix previous describe-function change
* lisp/help-fns.el (describe-function): Put back binding removed
by mistake in previous change.
2022-06-05 22:52:59 +02:00
Lars Ingebrigtsen
46822e9c5e Fix key binding buffer issue in describe-function better
* lisp/help-fns.el (describe-function): Revert previous change here.
(describe-function-1): Just use describe-function-orig-buffer
instead of the key-buffer binding -- this will also make the
rendering results correct when hitting `g' and `l'.
2022-06-05 22:48:28 +02:00
Lars Ingebrigtsen
3f388d7929 Make `C-h f' look up key bindings in the current buffer again
* lisp/help-fns.el (describe-function): Pass in the correct buffer
to look up key bindings in.
(describe-function-1): Use it.
2022-06-05 21:48:21 +02:00
Po Lu
d63d633a68 Handle invalid NEWS files during describe-function
* src/help-fns.el (help-fns--first-release): Don't error if
searching for a heading fails.
2022-05-24 21:01:24 +08:00
Lars Ingebrigtsen
ed34cbeae7 Audit symbol quoting in Lisp doc strings
* lisp/vc/vc-svn.el (vc-svn-dir-status-files):
* lisp/so-long.el (so-long-mode-maintain-preserved-variables):
* lisp/help-fns.el (help-fns--most-relevant-active-keymap):
* lisp/gnus/nnselect.el (nnselect-get-artlist):
(nnselect-store-artlist):
* lisp/forms.el (forms-enumerate):
* lisp/ffap.el (ffap-string-at-point):
* lisp/emacs-lisp/byte-run.el (define-obsolete-variable-alias):
Audit symbol quoting in Lisp doc strings.
2022-05-24 12:36:51 +02:00
Visuwesh
9ac40fb980 describe-keymap: Suggest symbol at point
* lisp/help-fns.el (describe-keymap): Suggest symbol at point
if it is a keymap.  (Bug#55393)
* etc/NEWS: Announce change in behavior of 'describe-keymap'.
2022-05-15 08:23:05 +03:00
Lars Ingebrigtsen
949180b8ab Put help-fns--compiler-macro last in the *Help* buffer
* lisp/help-fns.el (help-fns-describe-function-functions): Make
help-fns--compiler-macro the last entry (because it's not the most
interesting information).
2022-05-14 04:59:24 +02:00
Lars Ingebrigtsen
5f7dd959c2 Improve the *Help* output for compiler macros and the like
* doc/lispref/functions.texi (Advice and Byte Code): New node.

* lisp/help-fns.el (help-fns--compiler-macro): Also output data on
other byte compilation things, and link to the manual (bug#23264).
2022-05-14 04:13:56 +02:00
Lars Ingebrigtsen
1cda7cfb39 Respect help-window-keep-selected in shortdoc buttons
* lisp/help-fns.el (help-fns--mention-shortdoc-groups): Respect
help-window-keep-selected.

* lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Allow
reusing the window.
2022-05-06 16:21:07 +02:00
Lars Ingebrigtsen
c7d49f91da Fix another help-fns--insert-menu-bindings parsing problem
* lisp/help-fns.el (help-fns--insert-menu-bindings): Fix keymap
traversal when elements are symbols.
2022-04-28 12:16:35 +02:00
Juri Linkov
1e0c4883b7 * lisp/help-fns.el (help-fns--insert-menu-bindings): Don't highlight heading. 2022-04-27 10:36:41 +03:00
Lars Ingebrigtsen
dd5ca0eaf2 Make new menu *Help* output be more resilient
* lisp/help-fns.el (help-fns--insert-menu-bindings): Only insert
the heading if it turns out that we actually find the menu.
(help-fns--insert-bindings): Tweak calling convention.
2022-04-26 13:23:51 +02:00
Lars Ingebrigtsen
fd1ca094bc Change the display of menu bindings in *Help*
* lisp/help-fns.el (help-fns--insert-menu-bindings): New function
to describe menu entries more fully (bug#52870).
(help-fns--key-bindings): Use it.
2022-04-25 21:14:33 +02:00
Lars Ingebrigtsen
07f8fafe6b Further help-fns--editable-variable fixes
* lisp/help-fns.el (help-fns--editable-variable): Don't bug out on
non-symbols.
2022-04-24 16:03:12 +02:00
Po Lu
e2d870016c Allow looking up window system colors on Haiku
* lisp/help-fns.el (help-fns--editable-variable): Fix describing
variables which don't have symbol values.
* lisp/term/haiku-win.el (haiku-allowed-ui-colors): Set list of
allowed UI colors.
* src/haiku_support.cc (be_get_ui_color): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_get_color): Look for defined UI color.
(syms_of_haikufns): New defvar `haiku-allowed-ui-colors'.
* src/haikuterm.c (haiku_term_init): Fix coding style.
2022-04-24 05:37:22 +00:00
Lars Ingebrigtsen
655b39bd4b Don't have help-fns--editable-variable override link buttons
* lisp/help-fns.el (help-fns--editable-variable): Don't override
link buttons (bug#40774).
2022-04-23 17:01:55 +02:00
Lars Ingebrigtsen
01282cbd80 Allow editing variable values in *Help* buffers
* lisp/help-fns.el (help-enable-variable-value-editing): New user
option.
(describe-variable): Tag values for editing.
(help-fns--editable-variable, help-fns-edit-variable): New
functions (bug#36826).
(help-fns--edit-value-mode-map, help-fns--edit-value-mode)
(help-fns-edit-mode-done): New mode and commands.
2022-04-17 18:59:59 +02:00
Lars Ingebrigtsen
2ea3e7b246 Fix describe-mode--minor-modes formatting issue
* lisp/help-fns.el (describe-mode--minor-modes): Fix multi-line
local-minor paragraph.
2022-04-14 03:08:32 +02:00