Juri Linkov [Sun, 1 Nov 2020 21:35:41 +0000 (23:35 +0200)]
Transient input methods bound to 'C-x \' (bug#44266)
* lisp/international/mule-cmds.el (ctl-x-map): Bind 'C-x \' to
'transient-input-method'.
(input-method-function): New defcustom.
(transient-input-method): New command.
Stefan Kangas [Sun, 1 Nov 2020 14:27:17 +0000 (15:27 +0100)]
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
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring):
Clarify when minor modes are switched on/off when called from lisp
(bug#44341).
(define-minor-mode): Make calls from Lisp switch the mode on/off
as documented.
Mauro Aranda [Sun, 1 Nov 2020 13:10:08 +0000 (10:10 -0300)]
Fix saving a face setting with Customize
* lisp/cus-edit.el (custom-face-save): Make sure we back up into the
:shown-value property what the user has edited so far, if we are going
to recreate the custom-face widget. (Bug#44331)
* src/print.c (print_object): In case of Lisp_Int, print integers
as characters when Vinteger_output_format is Qt, and in hex format
when Vinteger_output_format is 16.
(Vinteger_output_format): New variable.
* test/src/print-tests.el (print-integer-output-format): New test.
Juri Linkov [Sat, 31 Oct 2020 19:38:26 +0000 (21:38 +0200)]
Improve goto-line in regard to narrowed buffers (bug#44294)
* lisp/simple.el (goto-line): Rewrite to first find the position
of the line where to go, then later don't widen the buffer
when the found position is still inside narrowed part of buffer.
* lisp/isearch.el (isearch-message-prefix): Warn about narrowed buffer
in case of no more matches found.
Amin Bandali [Sat, 31 Oct 2020 18:07:11 +0000 (14:07 -0400)]
Replace irc.freenode.net with chat.freenode.net
chat.freenode.net has been the preferred address for connecting to the
freenode IRC network for years now. Replace the occurrences of
irc.freenode.net with chat.freenode.net.
Modified globbing such as *.txt(W) for all world-writable files ending
in .txt apparently never worked correctly.
* lisp/eshell/em-pred.el (eshell-predicate-alist): Use correct
elisp syntax for octal constants.
(eshell-pred-file-mode): Return a boolean, not a number.
'assoc' is not side-effect-free; constprop its pure subset
Since a supplied test function can do anything, assoc is not
side-effect-free (bug#44018). However, with only two arguments it is
pure and should be optimised accordingly.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Remove 'assoc'.
(byte-optimize-assoc): Constant-propagate through 2-arg assoc calls.
* test/lisp/emacs-lisp/bytecomp-tests.el
(byte-opt-testsuite-arith-data): Add test cases.
Stefan Monnier [Sat, 31 Oct 2020 13:07:53 +0000 (09:07 -0400)]
* src/xdisp.c (syms_of_xdisp) <"scroll-minibuffer-conservatively">: New var
Fix bug#44070, which causes the minibuffer display to jump upon minor edit
(redisplay_window): Obey it.
* lisp/simple.el (end-of-buffer): Obey it.
* test/src/xdisp-tests.el (xdisp-tests--in-minibuffer): New macro,
extracted from `xdisp-tests--minibuffer-resizing`.
(xdisp-tests--minibuffer-resizing): Use it.
(xdisp-tests--minibuffer-scroll): New test.
Trim and explain set of safe forms for 'unsafep' (bug#44018)
* lisp/emacs-lisp/unsafep.el:
Add comment explaining the policy for which forms can be considered
'safe' in the sense of unsafep. Remove ones that didn't make the cut:
play-sound-file (large attack surface)
catch, throw (alter program flow, inject data)
replace-regexp-in-string (execute arbitary code)
error, signal (deceptive messages)
* test/lisp/emacs-lisp/unsafep-tests.el (unsafep-tests--unsafe):
Add test cases.
* etc/NEWS: Announce the change.
Parse GDB/MI results directly instead of going via JSON (bug#44173)
Translating GDB/MI into JSON is an unnecessary and fragile detour
that made it hard to deal with octal escapes in strings correctly.
Parse GDB/MI directly instead.
* lisp/progmodes/gdb-mi.el (gdb-mi-decode-strings): Adjust doc string.
(gdb-mi-decode, gud-gdbmi-marker-filter): Remove gdb-mi-decode.
(gdb-jsonify-buffer): Remove.
(gdb-mi--parse-tuple-or-list, gdb-mi--parse-c-string)
(gdb-mi--parse-value, gdb-mi--parse-result-or-value)
(gdb-mi--parse-results, gdb-mi--fix-key, gdb-mi--extend-fullname)
(gdb-mi--c-string-from-string): New functions.
(gdb-json-read-buffer, gdb-json-string, gdb-json-partial-output):
Rename to gdb-mi--read-buffer, gdb-mi--from-string and
gdb-mi--partial-output respectively. Remove useless FIX-LIST
argument. FIX-KEY is now a symbol, not a string. All callers updated.
(gdb-tooltip-print, gdbmi-bnf-log-stream-output, gdb-internals)
(gdb-console, gdb-done-or-error, gdb-get-source-file-list)
(gdb-get-prompt, gdb-get-source-file):
Use gdb-mi--c-string-from-string instead of 'read'.
* test/lisp/progmodes/gdb-mi-tests.el: New file.
Eli Zaretskii [Sat, 31 Oct 2020 09:41:53 +0000 (11:41 +0200)]
Speed up ls-lisp
This speeds up Dired by 25% in large directories.
* lisp/ls-lisp.el (ls-lisp--time-locale): New defvar.
(ls-lisp-format-time): calculate the locale for formatting times
only once and cache the value in 'ls-lisp--time-locale'.
(Bug#44273)
João Távora [Fri, 30 Oct 2020 22:09:36 +0000 (22:09 +0000)]
Shoosh byte-compilation warning in lisp/emacs-lisp/eldoc.el
Per bug#43609, elisp-eldoc-documentation-function is again in master,
but since it's now officially obsoleted, this backward compatibility
shim in eldoc--eval-expression-setup shouldn't unnecessarily trigger
warnings in master's code.
João Távora [Fri, 30 Oct 2020 21:47:44 +0000 (21:47 +0000)]
Don't make ElDoc doc buffer visible in buffer list by default
Fixes: bug#44334
* lisp/emacs-lisp/eldoc.el (eldoc-doc-buffer): No longer take
INTERACTIVE arg. Show buffer if invisible.
(eldoc--format-doc-buffer): Don't change buffer visibility.
(eldoc-display-in-buffer): Show buffer if invisible if by calling
eldoc-doc-buffer.
João Távora [Fri, 30 Oct 2020 18:43:20 +0000 (18:43 +0000)]
Bring back elisp-eldoc-documentation-function, marked obsolete
Fixes: bug#43609
It's not useful for ElDoc's eldoc-mode mechanism in Elisp, and nothing
in Emacs uses it, but it wasn't strictly marked internal, so it's best
to bring it back.
* lisp/progmodes/elisp-mode.el (elisp--documentation-one-liner):
New helper.
(elisp-eldoc-documentation-function): New function, with
obsoletion warning.
Don't call `syntax-propertize` from within narrowing
* lisp/progmodes/cperl-mode.el (cperl-forward-re): Revert last patch,
since it is now redundant.
* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127):
Remove unused var; fix test so it really catches the previous bug;
tweak the code to use mode-agnostic commands so it also works in `perl-mode`.
Harald Jörg [Fri, 30 Oct 2020 12:23:52 +0000 (13:23 +0100)]
Suppress a misleading message when closing a paren in a regex
* lisp/progmodes/cperl-mode.el (cperl-forward-re): Suppress an
error message about "End of string/RE not found" when we are
at the end of a narrowed buffer where the end of a RE is
temporarily unavailable (Bug#37127).
* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127):
Add a test to verify that the message is suppressed when
inappropriate, but appears when the RE *is* incomplete.
Stefan Kangas [Fri, 30 Oct 2020 11:48:30 +0000 (12:48 +0100)]
Clarify point position after text-property-search
* lisp/emacs-lisp/text-property-search.el
(text-property-search-forward, text-property-search-backward): Doc fix
to clarify placement of point after search.
* test/lisp/emacs-lisp/text-property-search-tests.el
(text-property-search--pos-test): New defun.
(text-property-search-forward-point-at-beginning)
(text-property-search-backward-point-at-end): New test.
Stefan Kangas [Wed, 28 Oct 2020 15:43:32 +0000 (16:43 +0100)]
Add shortdoc navigation commands
* lisp/emacs-lisp/shortdoc.el (text-property-search): Require.
(shortdoc-mode): New major mode.
(shortdoc-mode-map): New variable.
(shortdoc--goto-section): New macro.
(shortdoc-next, shortdoc-previous, shortdoc-next-section)
(shortdoc-previous-section): New commands.
(shortdoc-display-group): Use new shortdoc-models. Propertize
section header.
(shortdoc--display-function): Propertize function header.
* lisp/mail/emacsbug.el (submit-emacs-patch): Remove unneeded
'thanks' following Debbugs pseudo-header, which leaves other
pseudo-headers entered by the user unprocessed (bug#44322).
Harald Jörg [Thu, 29 Oct 2020 21:06:56 +0000 (22:06 +0100)]
cperl-mode: Make timeout test more robust
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-bug-10483): Increase the timeout to 2 seconds
and mark the test as expensive. Also, suppress it for Emacs
versions below 28, where the test times out though the function
works in manual tests. (Bug#44317)
* lisp/textmodes/bibtex.el (bibtex-include-OPTkey)
(bibtex-user-optional-fields, bibtex-BibTeX-entry-alist)
(bibtex-biblatex-entry-alist, bibtex-generate-url-list): Use :risky
tag instead of risky-local-variable property.
(bibtex-entry-format, bibtex-maintain-sorted-entries)
(bibtex-sort-entry-class, bibtex-dialect)
(bibtex-autokey-name-case-convert-function): Use :safe tag instead
of safe-local-variable property.
(bibtex-autokey-name-case-convert-function): Let custom function
default to 'identity', not 'ignore'.
(bibtex-strings, bibtex-reference-keys): Define with defvar-local
instead of defvar+make-variable-buffer-local.
Stefan Monnier [Thu, 29 Oct 2020 17:38:59 +0000 (13:38 -0400)]
* lisp/progmodes/tcl.el: Better match Tcl string formation rules (bug#39277)
(tcl--word-delimiters): New const.
(tcl--syntax-of-quote): New function.
(tcl-syntax-propertize-function): Use them.
(tcl-mode): Enable `syntax-propertize-multiline`.
Stefan Kangas [Wed, 28 Oct 2020 01:37:18 +0000 (02:37 +0100)]
Warn against using the MD4 hash function
* lisp/md4.el (md4): Warn against using it, since its security is
non-existent and it has been declared obsolete. It should probably
only be used by our NTLM support. Point users to secure-hash instead.
Tweak how `C-c C-r' computes the region in python-mode
* lisp/progmodes/python.el (python-shell-buffer-substring): Don't
extend the region to the start of the line (bug#39398), but allow
sending the actual region as marked.