1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00
Commit Graph

570 Commits

Author SHA1 Message Date
Eli Zaretskii
538fc1d0e0 Fix mode-line display in Calendar mode
* lisp/help.el (substitute-command-keys): New optional argument
NO-FACE, to avoid putting the 'help-key-binding' face on the key
bindings.
* lisp/calendar/calendar.el (calendar-mode-line-entry): Call
'substitute-command-keys' with the new optional argument non-nil.
(Bug#52366)

* doc/lispref/help.texi (Keys in Documentation): Document the new
optional argument of 'substitute-command-keys'.

* etc/NEWS: Announce the addition of a new argument to
'substitute-command-keys'.
2021-12-08 16:22:10 +02:00
Juri Linkov
8230a47ecc * lisp/help.el (help--analyze-key): Prefer posn-set-point over mouse-set-point
* lisp/help.el (help--analyze-key): Use posn-set-point instead of
mouse-set-point that runs the hook mouse-leave-buffer-hook via
mouse-minibuffer-check.  Using posn-set-point also unnecessitates
extra conditions added in bug#51421.

* lisp/isearch.el (isearch-describe-key, isearch-describe-mode):
Add precautions to not call isearch-update when the executed
command exited isearch-mode (bug#51173).
2021-12-01 19:36:00 +02:00
Lars Ingebrigtsen
a34466731b Fix typo in describe-map-tree doc string
* lisp/help.el (describe-map-tree): Fix typo in doc string.
2021-11-01 02:43:36 +01:00
Eli Zaretskii
492b927909 Fix help commands for menu-bar menus
* lisp/help.el (help--analyze-key): Fix "C-h c" and "C-h k" on
menu-bar menu items.  (Bug#51421)
2021-10-27 16:09:47 +03:00
Juri Linkov
59df93e2dd * lisp/help.el (help--analyze-key): Add new arg BUFFER (bug#51173).
* lisp/help.el (describe-key): Use BUFFER as arg for help--analyze-key.
(describe-key-briefly): Change arg UNTRANSLATED deprecated in 27.1
to BUFFER.

* lisp/gnus/gnus-art.el (gnus-article-describe-key)
(gnus-article-describe-key-briefly): Call describe-key and
describe-key-briefly with first arg as a cons with raw keys,
and the BUFFER arg set to the current buffer.
2021-10-20 20:54:57 +03:00
Juri Linkov
9ed53b022d * lisp/help.el (help--analyze-key): Avoid mouse-set-point for non-mouse events
(bug#51173)
2021-10-13 22:17:27 +03:00
Juri Linkov
a20e013d56 ; * lisp/help.el (help--analyze-key): Add comment. 2021-09-30 10:05:00 +03:00
Lars Ingebrigtsen
1aaeed903a Signal an error in `search-forward-help-for-help'
* lisp/help.el (search-forward-help-for-help): Error out instead
of showing an empty buffer (bug#50881).
2021-09-29 17:43:16 +02:00
Juri Linkov
2d1564103e * lisp/mouse.el (context-menu-map): Fix when menu is a command (bug#50851)
* lisp/help.el (help--analyze-key): Get information at the position
of mouse click such as 'C-h k' on a context menu item (bug#50067).
2021-09-28 22:00:41 +03:00
Juri Linkov
da50b7ec13 * lisp/outline.el (outline-minor-mode-cycle-filter): New defcustom (bug#50679)
(outline-minor-mode-cycle--bind): New helper function.
(outline-minor-mode-cycle-map): Rename from outline-mode-cycle-map.
(outline-mode-map): Revert part of 6458e16f33 to disassociate
keymaps outline-mode-map and outline-minor-mode-cycle-map.
(outline-font-lock-keywords, outline-minor-mode-highlight-buffer):
Use outline-minor-mode-cycle-map instead of outline-mode-cycle-map.

* lisp/help.el (describe-bindings): Rename outline-mode-cycle-map
to outline-minor-mode-cycle-map.
2021-09-23 19:14:56 +03:00
Mattias Engdegård
3b7b181bde Use string-search instead of string-match[-p]
`string-search` is easier to understand, less error-prone, much
faster, does not pollute the regexp cache, and does not mutate global
state.  Use it where applicable and obviously safe (erring on the
conservative side).

* admin/authors.el (authors-canonical-file-name)
(authors-scan-change-log):
* lisp/apropos.el (apropos-command)
(apropos-documentation-property, apropos-symbols-internal):
* lisp/arc-mode.el (archive-arc-summarize)
(archive-zoo-summarize):
* lisp/calc/calc-aent.el (math-read-factor):
* lisp/calc/calc-ext.el (math-read-big-expr)
(math-format-nice-expr, math-format-number-fancy):
* lisp/calc/calc-forms.el (math-read-angle-brackets):
* lisp/calc/calc-graph.el (calc-graph-set-range):
* lisp/calc/calc-keypd.el (calc-keypad-press):
* lisp/calc/calc-lang.el (tex, latex, math-read-big-rec):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-user-define-permanent, math-define-exp):
* lisp/calc/calc.el (calc-record, calcDigit-key)
(calc-count-lines):
* lisp/calc/calcalg2.el (calc-solve-for, calc-poly-roots)
(math-do-integral):
* lisp/calc/calcalg3.el (calc-find-root, calc-find-minimum)
(calc-get-fit-variables):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/java.el (semantic-java-expand-tag):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/cedet/semantic/wisent/python.el
(semantic-python-instance-variable-p):
* lisp/cus-edit.el (get):
* lisp/descr-text.el (describe-text-sexp):
* lisp/dired-aux.el (dired-compress-file):
* lisp/dired-x.el (dired-make-relative-symlink):
* lisp/dired.el (dired-glob-regexp):
* lisp/dos-fns.el (dos-convert-standard-filename, dos-8+3-filename):
* lisp/edmacro.el (edmacro-format-keys):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/lisp-mnt.el (lm-keywords-list):
* lisp/emacs-lisp/warnings.el (display-warning):
* lisp/emulation/viper-ex.el (viper-ex-read-file-name)
(ex-print-display-lines):
* lisp/env.el (read-envvar-name, setenv):
* lisp/epa-mail.el (epa-mail-encrypt):
* lisp/epg.el (epg--start):
* lisp/erc/erc-backend.el (erc-parse-server-response):
* lisp/erc/erc-dcc.el (erc-dcc-member):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-server)
(erc-speedbar-expand-channel, erc-speedbar-expand-user):
* lisp/erc/erc.el (erc-send-input):
* lisp/eshell/em-glob.el (eshell-glob-entries):
* lisp/eshell/esh-proc.el (eshell-needs-pipe-p):
* lisp/eshell/esh-util.el (eshell-convert):
* lisp/eshell/esh-var.el (eshell-envvar-names):
* lisp/faces.el (x-resolve-font-name):
* lisp/ffap.el (ffap-file-at-point):
* lisp/files.el (wildcard-to-regexp, shell-quote-wildcard-pattern):
* lisp/forms.el (forms--update):
* lisp/frameset.el (frameset-filter-unshelve-param):
* lisp/gnus/gnus-art.el (article-decode-charset):
* lisp/gnus/gnus-kill.el (gnus-kill-parse-rn-kill-file):
* lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy):
* lisp/gnus/gnus-msg.el (gnus-summary-resend-message-insert-gcc)
(gnus-inews-insert-gcc):
* lisp/gnus/gnus-rfc1843.el (rfc1843-decode-article-body):
* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output)
(gnus-search--complete-key-data):
* lisp/gnus/gnus-spec.el (gnus-parse-simple-format):
* lisp/gnus/gnus-sum.el (gnus-summary-refer-article):
* lisp/gnus/gnus-util.el (gnus-extract-address-components)
(gnus-newsgroup-directory-form):
* lisp/gnus/gnus-uu.el (gnus-uu-grab-view):
* lisp/gnus/gnus.el (gnus-group-native-p, gnus-short-group-name):
* lisp/gnus/message.el (message-check-news-header-syntax)
(message-make-message-id, message-user-mail-address)
(message-make-fqdn, message-get-reply-headers, message-followup):
* lisp/gnus/mm-decode.el (mm-dissect-buffer):
* lisp/gnus/nnheader.el (nnheader-insert):
* lisp/gnus/nnimap.el (nnimap-process-quirk)
(nnimap-imap-ranges-to-gnus-ranges):
* lisp/gnus/nnmaildir.el (nnmaildir--ensure-suffix):
* lisp/gnus/nnmairix.el (nnmairix-determine-original-group-from-path):
* lisp/gnus/nnrss.el (nnrss-match-macro):
* lisp/gnus/nntp.el (nntp-find-group-and-number):
* lisp/help-fns.el (help--symbol-completion-table-affixation):
* lisp/help.el (help-function-arglist):
* lisp/hippie-exp.el (he-concat-directory-file-name):
* lisp/htmlfontify.el (hfy-relstub):
* lisp/ido.el (ido-make-prompt, ido-complete, ido-copy-current-word)
(ido-exhibit):
* lisp/image/image-converter.el (image-convert-p):
* lisp/info-xref.el (info-xref-docstrings):
* lisp/info.el (Info-toc-build, Info-follow-reference)
(Info-backward-node, Info-finder-find-node)
(Info-speedbar-expand-node):
* lisp/international/mule-diag.el (print-fontset-element):
* lisp/language/korea-util.el (default-korean-keyboard):
* lisp/linum.el (linum-after-change):
* lisp/mail/ietf-drums.el (ietf-drums-parse-address):
* lisp/mail/mail-utils.el (mail-dont-reply-to):
* lisp/mail/rfc2047.el (rfc2047-encode-1, rfc2047-decode-string):
* lisp/mail/rfc2231.el (rfc2231-parse-string):
* lisp/mail/rmailkwd.el (rmail-set-label):
* lisp/mail/rmailsum.el (rmail-header-summary):
* lisp/mail/smtpmail.el (smtpmail-maybe-append-domain)
(smtpmail-user-mail-address):
* lisp/mail/uce.el (uce-reply-to-uce):
* lisp/man.el (Man-default-man-entry):
* lisp/mh-e/mh-alias.el (mh-alias-gecos-name)
(mh-alias-minibuffer-confirm-address):
* lisp/mh-e/mh-comp.el (mh-forwarded-letter-subject):
* lisp/mh-e/mh-speed.el (mh-speed-parse-flists-output):
* lisp/mh-e/mh-utils.el (mh-collect-folder-names-filter)
(mh-folder-completion-function):
* lisp/minibuffer.el (completion--make-envvar-table)
(completion-file-name-table, completion-flex-try-completion)
(completion-flex-all-completions):
* lisp/mpc.el (mpc--proc-quote-string, mpc-cmd-special-tag-p)
(mpc-constraints-tag-lookup):
* lisp/net/ange-ftp.el (ange-ftp-send-cmd)
(ange-ftp-allow-child-lookup):
* lisp/net/mailcap.el (mailcap-mime-types):
* lisp/net/mairix.el (mairix-search-thread-this-article):
* lisp/net/pop3.el (pop3-open-server):
* lisp/net/soap-client.el (soap-decode-xs-complex-type):
* lisp/net/socks.el (socks-filter):
* lisp/nxml/nxml-outln.el (nxml-highlighted-qname):
* lisp/nxml/rng-cmpct.el (rng-c-expand-name, rng-c-expand-datatype):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1):
* lisp/obsolete/complete.el (partial-completion-mode)
(PC-do-completion):
* lisp/obsolete/longlines.el (longlines-encode-string):
* lisp/obsolete/nnir.el (nnir-compose-result):
* lisp/obsolete/terminal.el (te-quote-arg-for-sh):
* lisp/obsolete/tpu-edt.el (tpu-check-search-case):
* lisp/obsolete/url-ns.el (isPlainHostName):
* lisp/pcmpl-unix.el (pcomplete/scp):
* lisp/play/dunnet.el (dun-listify-string2, dun-get-path)
(dun-unix-parse, dun-doassign, dun-cat, dun-batch-unix-interface):
* lisp/progmodes/ebnf2ps.el: (ebnf-eps-header-footer-comment):
* lisp/progmodes/gdb-mi.el (gdb-var-delete)
(gdb-speedbar-expand-node, gdbmi-bnf-incomplete-record-result):
* lisp/progmodes/gud.el (gud-find-expr):
* lisp/progmodes/idlw-help.el (idlwave-do-context-help1):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode)
(idlwave-shell-filter-hidden-output, idlwave-shell-filter):
* lisp/progmodes/idlwave.el (idlwave-skip-label-or-case)
(idlwave-routine-info):
* lisp/progmodes/octave.el (inferior-octave-completion-at-point):
* lisp/progmodes/sh-script.el (sh-add-completer):
* lisp/progmodes/sql.el (defun):
* lisp/progmodes/xscheme.el (xscheme-process-filter):
* lisp/replace.el (query-replace-compile-replacement)
(map-query-replace-regexp):
* lisp/shell.el (shell--command-completion-data)
(shell-environment-variable-completion):
* lisp/simple.el (display-message-or-buffer):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/subr.el (split-string-and-unquote):
* lisp/tar-mode.el (tar-extract):
* lisp/term.el (term-command-hook, serial-read-name):
* lisp/textmodes/bibtex.el (bibtex-print-help-message):
* lisp/textmodes/ispell.el (ispell-lookup-words, ispell-filter)
(ispell-parse-output, ispell-buffer-local-parsing):
* lisp/textmodes/reftex-cite.el (reftex-do-citation):
* lisp/textmodes/reftex-parse.el (reftex-notice-new):
* lisp/textmodes/reftex-ref.el (reftex-show-entry):
* lisp/textmodes/reftex.el (reftex-compile-variables):
* lisp/textmodes/tex-mode.el (tex-send-command)
(tex-start-tex, tex-append):
* lisp/thingatpt.el (thing-at-point-url-at-point):
* lisp/tmm.el (tmm-add-one-shortcut):
* lisp/transient.el (transient-format-key):
* lisp/url/url-auth.el (url-basic-auth)
(url-digest-auth-directory-id-assoc):
* lisp/url/url-news.el (url-news):
* lisp/url/url-util.el (url-parse-query-string):
* lisp/vc/vc-cvs.el (vc-cvs-parse-entry):
* lisp/wid-browse.el (widget-browse-sexp):
* lisp/woman.el (woman-parse-colon-path, woman-mini-help)
(WoMan-getpage-in-background, woman-negative-vertical-space):
* lisp/xml.el:
* test/lisp/emacs-lisp/check-declare-tests.el
(check-declare-tests-warn):
* test/lisp/files-tests.el
(files-tests-file-name-non-special-dired-compress-handler):
* test/lisp/net/network-stream-tests.el (server-process-filter):
* test/src/coding-tests.el (ert-test-unibyte-buffer-dos-eol-decode):
Use `string-search` instead of `string-match` and `string-match-p`.
2021-08-09 11:35:56 +02:00
Lars Ingebrigtsen
620e35f09f Add a new function for separator lines
* lisp/help-fns.el (describe-symbol): Use it.

* lisp/help.el (describe-key): Use it.

* lisp/simple.el (separator-line): New face.
(make-separator-line): New function (bug#49630).
2021-07-19 15:48:20 +02:00
Juri Linkov
e0ebce5ce2 * lisp/help.el (describe-bindings-outline): New defcustom (bug#45147).
(describe-bindings): Use describe-bindings-outline.
(describe-bindings-internal): Remove function obsolete since 24.4.
2021-05-20 21:37:04 +03:00
Mattias Engdegård
12bab20920 Tidy file-matching regexps and remove some ineffective backslashes
* lisp/emacs-lisp/package.el (package--delete-directory):
* lisp/net/tramp-cmds.el (tramp-recompile-elpa):
Escape dot; replace $ with \'.
* lisp/help.el (help-for-help):
* lisp/transient.el (transient-font-lock-keywords):
Remove useless backslashes.
2021-05-06 15:53:48 +02:00
Andrea Corallo
40736357b8 Rename feature nativecomp' into native-compile'
* test/src/comp-tests.el : Rename feature `nativecomp' into
	`native-compile'.
	* test/lisp/help-fns-tests.el (help-fns-test-lisp-defun): Likewise.
	* src/comp.c (syms_of_comp): Likewise.
	* lisp/startup.el (normal-top-level): Likewise.
	* lisp/loadup.el: Likewise.
	* lisp/help.el (help-function-arglist): Likewise.
	* lisp/emacs-lisp/package.el (package--native-compile-async)
	(package--delete-directory): Likewise.
	* lisp/emacs-lisp/nadvice.el (advice--add-function): Likewise.
	* lisp/emacs-lisp/comp.el (comp-ensure-native-compiler): Likewise.
	* lisp/emacs-lisp/advice.el (ad-add-advice): Likewise.
2021-05-05 22:27:29 +02:00
Stefan Kangas
6c1c3204e4 Add new help command 'describe-command'
* lisp/help-fns.el (describe-command): New command.
(help-fns--describe-function-or-command-prompt): New helper
function to prompt for a function or function.  (Bug#46627)
(describe-function): Use above new helper function.

* lisp/help.el (help-map): Bind above new command to `C-h x'.
(help-for-help): Add this new command to the help summary.
* lisp/menu-bar.el (menu-bar-describe-menu): Add the new command to
the help menu.

* doc/emacs/help.texi (Help Summary, Name Help): Document
'describe-command', and update documentation on 'describe-function'.
* etc/tutorials/TUTORIAL: Change reference from 'describe-function' to
'describe-command'.
2021-05-02 15:04:00 +02:00
Stefan Kangas
04266a2cac Advertise PgUp/PgDn instead of SPC/DEL in help-for-help
* lisp/help-macro.el (make-help-screen):
* lisp/help.el (help-for-help): Advertise PgUp/PgDn instead of
SPC/DEL.
2021-04-30 19:30:28 +02:00
Stefan Kangas
2ab8d1ee3b Avoid missing whitespace in help-for-help
* lisp/help.el (help--for-help-make-commands): Avoid missing
whitespace before description of command.
Problem reported by Dmitry Gutov <dgutov@yandex.ru>.
2021-04-27 22:54:05 +02:00
Andrea Corallo
289000eee7 Merge branch 'feature/native-comp' into into trunk 2021-04-25 20:06:22 +02:00
Stefan Kangas
13a248f7e7 ; * lisp/help.el (help-for-help): Fix thinko. 2021-04-25 13:57:47 +02:00
Stefan Kangas
39bea8b59c Show correct lossage size in help-for-help
* lisp/help.el (help-for-help): Show correct lossage size.  Add
trailing newline.
Suggested by Gregory Heytings <gregory@heytings.org>.
2021-04-25 11:52:40 +02:00
Stefan Kangas
af464e4380 * lisp/help.el (help--for-help-make-sections): Fix typo. 2021-04-24 18:05:15 +02:00
Stefan Kangas
1fce528132 Redesign and improve the help-for-help (C-h C-h) command
* lisp/help.el (help-for-help): Redesign help screen; add sections,
rearrange and reword.
(help-for-help-header): New face.
(help--for-help-make-commands, help--for-help-make-sections): New
functions.
(help-for-help-buffer-name): New variable.

* lisp/help-macro.el (make-help-screen): New optional argument
BUFFER-NAME.  Fontify keys.

This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-02/msg01695.html
https://lists.gnu.org/r/emacs-devel/2021-03/msg00670.html
https://lists.gnu.org/r/emacs-devel/2021-04/msg00292.html
2021-04-24 15:18:03 +02:00
Andrea Corallo
6ca6c71cd0 Merge remote-tracking branch 'savannah/master' into native-comp 2021-03-19 15:28:00 +01:00
Glenn Morris
74c389526f Merge from origin/emacs-27
2c5f215419 Avoid crashes in Mew due to corrupted tool-bar label
7a23915618 * lisp/tooltip.el (tooltip): Doc fix for GTK.
c4bbe02cc4 * lisp/help.el (help-for-help-internal): Doc fix; use impe...

# Conflicts:
#	lisp/help.el
#	lisp/tooltip.el
2021-03-12 08:47:41 -08:00
Andrea Corallo
82bd6d57d5 Merge remote-tracking branch 'savannah/master' into native-comp 2021-03-12 16:42:51 +01:00
Stefan Kangas
48bfebc3b9 * lisp/help.el (help--describe-translation): Fix typo. 2021-03-10 01:23:25 +01:00
Stefan Kangas
4a112fd7a6 Add new face 'help-key-binding' for keybindings in help
* lisp/faces.el (help-key-binding): New face.
* lisp/help.el
(help-for-help): Rename from 'help-for-help-internal'.  Use
'substitute-command-keys' syntax.
(help): Make into alias for 'help-for-help'.
(help-for-help-internal): Make into obsolete alias for
'help-for-help'.
(help--key-description-fontified): New function to add the
'help-key-binding' face.
(help-key-description, substitute-command-keys)
(describe-map-tree, help--describe-command)
(help--describe-translation, describe-map):
* lisp/help-fns.el (help-fns--key-bindings, describe-mode):
Use above new function.
* lisp/isearch.el (isearch-help-for-help-internal): Use
`substitute-command-keys' syntax.
* lisp/help-macro.el (make-help-screen): Use
'substitute-command-keys' and 'help--key-description-fontified'.
Simplify.
* src/keymap.c (describe_key_maybe_fontify): New function to add
the 'help-key-binding' face to keybindings.
(describe_vector): Use above new keybinding.
(syms_of_keymap) <Qfont_lock_face, Qhelp_key_binding>: New
DEFSYMs.
(fontify_key_properties): New static variable.
* lisp/tooltip.el (tooltip-show): Avoid overriding faces in
specified tooltip text.
* test/lisp/help-tests.el (with-substitute-command-keys-test):
Don't test for text properties.
(help-tests-substitute-command-keys/add-key-face)
(help-tests-substitute-command-keys/add-key-face-listing):
New tests.
2021-03-08 04:23:08 +01:00
Stefan Kangas
c4bbe02cc4 * lisp/help.el (help-for-help-internal): Doc fix; use imperative. 2021-02-20 15:28:03 +01:00
Andrea Corallo
5db5064395 Merge remote-tracking branch 'savannah/master' into HEAD 2021-01-02 10:11:15 +01:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Paul Eggert
8c1fe1e5ef Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2021-01-01 00:32:32 -08:00
Andrea Corallo
033e96055c Merge remote-tracking branch 'savannah/master' into HEAD 2020-11-22 22:23:16 +01:00
Stefan Kangas
f08e6538dc Run menu-item :filter function before showing binding
* lisp/help.el (describe-map): Fix running `menu-item' :filter
functions.  This fixes a mistake in the previous conversion of this
defun from the old C function describe_map.  See the discussion in
Bug#39149.
* test/src/keymap-tests.el
(keymap---get-keyelt/runs-menu-item-filter)
(describe-buffer-bindings/menu-item-filter-show-binding)
(describe-buffer-bindings/menu-item-filter-hide-binding):
New tests.
(keymap-tests--test-menu-item-filter): New defun.
2020-11-15 00:54:07 +01:00
Andrea Corallo
2a8bf2222d Merge remote-tracking branch 'savannah/master' into dev 2020-11-14 22:07:54 +01:00
Stefan Kangas
95c04675ab Simplify getting value of text-quoting-style (Bug#44471)
* src/doc.c (text_quoting_style): Remove function by merging it...
(Ftext_quoting_style): ...here.  Rename from Fget_quoting_style.
(syms_of_doc): Update defsubr for Ftext_quoting_style.
* src/lisp.h (enum text_quoting_style): Remove enum.
* src/doprnt.c (doprnt):
* src/editfns.c (styled_format):
* lisp/help.el (substitute-command-keys): Update callers to use
text-quoting-style.
2020-11-09 21:08:28 +01:00
Andrea Corallo
75e8ee728f Merge remote-tracking branch 'savannah/master' into HEAD 2020-11-07 16:21:36 +01:00
Stefan Kangas
5ab5504def Fix mistake in Lisp conversion of describe-map-tree
* lisp/help.el (describe-map-tree): Fix mistake in conversion to Lisp
from the C function describe_map_tree; make the condition match the
now removed C code.  (Bug#44360)
2020-11-01 22:52:02 +01:00
Stefan Kangas
8ad9932f11 Don't bind standard-output in substitute-command-keys
This fixes a regression with regards to the old C version of
substitute-command-keys.

* lisp/help.el (substitute-command-keys): Don't bind standard-output.
See Bug#39149.
* test/lisp/help-tests.el
(help-tests--was-in-buffer): New variable.
(help-substitute-command-keys/menu-filter-in-correct-buffer): New
test.
2020-11-01 18:58:12 +01:00
Stefan Kangas
ce1856ec09 Insert describe-map-tree header into original buffer
* lisp/help.el (describe-map-tree): Insert header into the original
buffer, not in standard-output.
* test/src/keymap-tests.el
(describe-buffer-bindings/header-in-current-buffer)
(describe-buffer-bindings/returns-nil): New tests.
Ref: https://debbugs.gnu.org/39149#31
2020-11-01 15:53:43 +01:00
Andrea Corallo
99e7cc0da6 Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-23 20:08:58 +01:00
Stefan Kangas
420023a6f0 Prefer Lisp version of describer in help--describe-vector
* src/keymap.c (Fhelp__describe_vector):
* lisp/help.el (describe-map): Use Lisp versions of describe_command
and describe_translation.
* src/keymap.c (describe_command, describe_translation): Remove.
(describe_vector_basic): New function.
2020-10-18 17:25:23 +02:00
Stefan Kangas
afde53cd81 Improve substitute-command-keys performance
The previous conversion of describe_vector from C to Lisp for the
keymap and char table case lead to an unacceptable performance hit.
Moving back to the C version, as we do here, makes this function
around 50 times faster.

The Lisp version of `substitute-command-keys' was benchmarked using
the form `(documentation 'dired-mode)', which now takes less than 8 ms
on my machine.  This is around 16 times slower than the previous C
version.

Thanks to Stefan Monnier for helpful pointers on benchmarking.

* src/keymap.c (Fhelp__describe_vector): New defun to expose
describe_vector to Lisp for keymaps and char tables.
(syms_of_keymap): New defsubr for Fhelp__describe_vector.
* lisp/help.el (describe-map): Use above defun instead of Lisp
version.
(help--describe-vector): Remove defun; keep it commented out for now.
2020-10-18 17:25:23 +02:00
Stefan Kangas
5ad2bb0fa9 Translate describe_vector to Lisp
* lisp/help.el (help--describe-vector): New Lisp implementation of
describe_vector.
* src/keymap.c (Fdescribe_vector_internal): Remove defun.
(syms_of_keymap): Remove defsubr for Fdescribe_vector_internal.
2020-10-18 17:25:23 +02:00
Stefan Kangas
647b1c5142 Translate describe_map to Lisp
Third step in converting substitute-command-keys to Lisp.

* lisp/help.el (describe-map): New Lisp version of describe_map.
(help--describe-map-compare, help--describe-translation)
(help--describe-command, help--shadow-lookup): New helper
functions for describe-map.
(help--keymaps-seen, help--previous-description-column): New
variables.
* src/keymap.c
(Fkeymap__get_keyelt): New defun to expose get_keyelt to Lisp.
(Fdescribe_map_tree_old, Fdescribe_map): Remove defuns.
(Fdescribe_vector_internal): New defun to expose describe_vector to
Lisp in a way usable by describe-map.
(syms_of_keymap): New defsubrs for Fkeymap__get_keyelt and
Fdescribe_vector_internal.  Remove defsubrs for Fdescribe_map_tree_old
and Fdescribe_map.  Remove 'help--keymaps-seen'.

* test/lisp/help-tests.el
(help-tests-substitute-command-keys/shadow): Extend test.
(help-tests-substitute-command-keys/test-mode)
(help-tests-substitute-command-keys/compare-all)
(help-tests-describe-map-tree/no-menu-t)
(help-tests-describe-map-tree/no-menu-nil)
(help-tests-describe-map-tree/mention-shadow-t)
(help-tests-describe-map-tree/mention-shadow-nil)
(help-tests-describe-map-tree/partial-t)
(help-tests-describe-map-tree/partial-nil): New tests.
2020-10-18 17:25:19 +02:00
Stefan Kangas
afd31f9e62 Translate describe_map_tree to Lisp
This is the second step in converting substitute-command-keys to Lisp.

* lisp/help.el (describe-map-tree): New Lisp version of
describe_map_tree.
(substitute-command-keys): Update to use above function.
* src/keymap.c (Fdescribe_map): New defun to expose describe_map to
Lisp.
* src/keymap.c (syms_of_keymap): New variable 'help--keymaps-seen'; a
temporary kludge planned for removal.  New defsubr for Fdescribe_map.
2020-10-18 17:23:28 +02:00
Stefan Kangas
dcf9cd47ae Add new Lisp implementation of substitute-command-keys
This is only the first step towards a full Lisp implementation, and
does not remove the old C code.  On the contrary, it is partly based
on using the old C code, which is to be replaced in steps.  This also
makes it easy to test that it produces the same output as the old.

* src/doc.c (Fsubstitute_command_keys_old): Rename from
Fsubstitute_command_keys.
(Fget_quoting_style): New defun to expose text_quoting_style to Lisp.
(syms_of_doc): Expose above symbols.
* lisp/help.el (substitute-command-keys): New Lisp version of
substitute-command-keys.  (Bug#8951)

* src/keymap.c
(Fdescribe_map_tree): New defun to expose describe_map_tree to Lisp.
(syms_of_keymap): New defsubr for Fdescribe_map_tree.

* src/keyboard.c (help_echo_substitute_command_keys):
* src/doc.c (Fdocumentation, Fdocumentation_property):
* src/print.c (print_error_message):
* src/syntax.c (Finternal_describe_syntax_value): Fix calls to use new
Lisp implementation of substitute-command-keys.

* test/src/doc-tests.el: Remove file.
* test/lisp/help-tests.el: Add tests for substitute-command-keys
copied from above file.
2020-10-18 17:23:24 +02:00
Andrea Corallo
f8505fd3d4 Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-14 11:04:55 +02:00
Boruch Baum
ec9523a6ae Add a keybinding to the help menu to display manuals
* lisp/help.el (help-for-help-internal): Add a keybinding to
prompt for and display a manual (bug#43956).
2020-10-13 03:09:19 +02:00
Brian Leung
237fd33aef Fix some compilation warnings in non nativecomp build (bug#43892)
* lisp/emacs-lisp/advice.el (comp-subr-trampoline-install):
	Declare function.
	* lisp/emacs-lisp/find-func.el (comp-eln-to-el-h): Declare
	variable.
	* lisp/emacs-lisp/nadvice.el (comp-subr-trampoline-install):
	Declare function.
	* lisp/files.el (comp-eln-to-el-h): Declare variable.
	* lisp/help.el (subr-native-lambda-list): Declare function.
2020-10-12 21:25:50 +02:00