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.
Fix intermittent rmail-summary-delete-forward problem
* lisp/mail/rmailsum.el (rmail-summary-delete-forward):
`rmail-delete-message' may apparently clear
`rmail-current-message' sometimes, so save the message number
before deleting (bug#39612).
* lisp/progmodes/gdb-mi.el (gdb-tooltip-print-1, gud-watch)
(gdb-var-list-children, gdb-edit-value)
(gdb-bind-function-to-buffer, gdb-place-breakpoints)
(gdb-preempt-existing-or-display-buffer):
Expose lambdas to the compiler as lexical closures instead of building
them the old-fashioned way. Remove #' before lambda.
Fix history problem in `M-x shell' when started twice
* lisp/comint.el (comint-input-ring-file-name): Avoid having this
variable being killed on mode restart while the other ring
variables aren't (bug#39667). This would mean that `M-x
shell'/`C-d'/`M-x shell' didn't save commands entered after the
second `M-x shell'.
ERT: escape control characters in pretty-printed error output
* lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline):
Escape control characters which would otherwise be blasted directly to
the terminal (when running noninteractively) with unpleasant results.
* lisp/calendar/solar.el (solar-moment): Use initial values for binary
search that won't end the loop prematurely and yield incorrect
answers.
* test/lisp/calendar/solar-tests.el: New file.
Since ntlm.el is distributed as a separate package in GNU ELPA and
should be able to run on older Emacs versions without bignums,
we cannot make use of them here. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-10/msg01665.html.
Instead, we add a small poor man's bignum implementation.
* lisp/net/ntlm.el (ntlm--bignat-of-int, ntlm--bignat-add)
(ntlm--bignat-shift-left, ntlm--bignat-mul-byte, ntlm--bignat-mul)
(ntlm--bignat-of-string, ntlm--bignat-of-digits)
(ntlm--bignat-to-int64): New.
(ntlm--time-to-timestamp): Use the ntlm--bignat- functions instead
of Lisp integers.
* test/lisp/net/ntlm-tests.el: New file.
Don't do compilation-transform-file-match-alist if there's no file name
* lisp/progmodes/compile.el (compilation-error-properties): There
may not be a file name (bug#40111). In that case, don't do the
`compilation-transform-file-match-alist' thing.
Don't skip empty lines when fitting mini frame to buffer (Bug#44080)
* lisp/window.el (fit-mini-frame-to-buffer,
window--resize-mini-frame, fit-frame-to-buffer,
fit-frame-to-buffer-1): By default, fit a mini frame without skipping its
buffer's leading or trailing empty lines.
* src/frame.c (resize-mini-frames): Update doc-string.
* lisp/cus-start.el (resize-mini-frames): Update for customize.
* doc/lispref/minibuf.texi (resize-mini-frames): Update description.
Paul Pogonyshev [Tue, 27 Oct 2020 08:43:55 +0000 (09:43 +0100)]
Don't leak result of nested byte-compilation to outer level
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Bind
`byte-compiler-error-flag' instead of setting it (bug#41065).
This fixes a problem of "leaking" the flag when compiling
something that then compiles something that errors out (i.e., an
"inner" compile).
mvar [Tue, 27 Oct 2020 08:27:51 +0000 (09:27 +0100)]
Fontify strings in {} better in tcl-mode
* lisp/progmodes/tcl.el (tcl-syntax-propertize-function):
Propertize {} forms after commands as strings (bug#39277).
(tcl-set-font-lock-keywords): Fontify as strings. This allows
things like puts {"foo} to be fontified correctly.
* lisp/help-mode.el (help-mode-revert-buffer): Don't require
confirmation before reverting (bug#44202). This mimics how most
other non-file reverting functions work.
Stefan Kangas [Mon, 26 Oct 2020 23:49:28 +0000 (00:49 +0100)]
Don't use obsolete variable write-contents-hooks
* lisp/mh-e/mh-show.el (mh-display-msg):
* lisp/textmodes/rst.el: Don't use obsolete variable
write-contents-hooks.
Problem reported by Stefan Monnier <monnier@iro.umontreal.ca>.
Stefan Kangas [Mon, 26 Oct 2020 23:35:46 +0000 (00:35 +0100)]
Remove XEmacs compat code from hashcash.el
* lisp/mail/hashcash.el (hashcash-point-at-bol)
(hashcash-point-at-eol): Make obsolete.
(hashcash-token-substring): Don't use the above now obsolete aliases.
Make vc-responsible-backend choose the most specific backend
* lisp/vc/vc.el (vc-responsible-backend): Search through all the
VC backends instead of the first one, and choose the one that's
most specific (bug#42966).