Glenn Morris [Mon, 2 Nov 2020 17:27:40 +0000 (09:27 -0800)]
Merge from origin/emacs-27
1fc9de4b81 Improve reproducibility of generated -pkg.el files da6234e2df Make sure pixel sizes are zero when setting window size fo... 2d15296db1 Fix failure of 'emacs --daemon' on Cygwin 8abce5b0c6 CC Mode: Only recognize foo (*bar) as a function pointer w... 85d1d8d768 Fix NEWS entry for fix of Bug#44080 2443b15a91 * src/buffer.c (syms_of_buffer) <fill-column>: Improve doc...
* test/src/dired-tests.el: Removed. Tests moved to
test/lisp/dired-tests.el.
* test/lisp/dired-tests.el (dired-test-bug27899): Tag it :unstable.
(dired-test-directory-files)
(dired-test-directory-files-and-attributes): New tests.
To be backward compatible, this function must return nil when there is
a symbol at point but no documentation for it. Before this fixed it
returned the string "<symbol-name>: nil".
* lisp/progmodes/elisp-mode.el (elisp--documentation-one-liner):
Check callback actually produced non-nil doc.
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring):
Only document the values we want to support, not the ones we
actually support.
(define-minor-mode): Partially revert to previous behaviour.
Stefan Kangas [Sun, 1 Nov 2020 21:49:12 +0000 (22:49 +0100)]
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)
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)
Glenn Morris [Sat, 31 Oct 2020 02:20:24 +0000 (19:20 -0700)]
Improve reproducibility of generated -pkg.el files
* lisp/emacs-lisp/package.el (package-generate-description-file):
Don't include the full name of the source file in the header,
since that varies non-reproducibly according to the build directory.
https://bugs.debian.org/972861
Note that elpa.gnu.org's admin/archive-contents.el does this by hand
and already only includes the nondirectory part.
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`.
Ken Brown [Thu, 29 Oct 2020 12:45:29 +0000 (08:45 -0400)]
Fix failure of 'emacs --daemon' on Cygwin
* src/emacs.c (DAEMON_MUST_EXEC): Define unconditionally on
Cygwin, not just if HAVE_NTGUI is defined. This fixes the failure
of 'emacs --daemon' to start on the non-w32 Cygwin builds.
(Bug#44285)