Harald Jörg [Tue, 7 Sep 2021 20:11:41 +0000 (22:11 +0200)]
cperl-mode.el: Use rx sequences for Perl grammar
Following advice by Mattias Engdegård, most uses of rx-to-string
were eliminated, and rx sequences used instead to define Perl
grammar components.
* lisp/progmodes/cperl-mode.el: (cperl-block-declaration-p): New
function, replaces regexp literals.
(cperl-imenu--function-name-regexp-perl): Deleted, use rx
sequences to find imenu entries instead.
(cperl-indent-line): Use rx components instead of regexp literals.
(cperl-sniff-for-indent): use `cperl-block-declaration-p' to
increase accuracy, use rx sequence for labels to replace
inaccurate regexp literals.
(cperl-block-p): Replace inline comment by docstring. Use
`cperl-block-declaration-p'.
(cperl-after-block-p): Use `cperl-block-declaration-p'.
(cperl-after-block-and-statement-beg): Replace inline comment by
docstring.
(cperl-imenu-package-keywords), (cperl-imenu-sub-keywords),
(cperl-imenu-pod-keywords) : New variables to sort imenu
entries into categories.
(cperl-imenu--create-perl-index): Use rx sequences to collect
imenu entries.
(cperl-init-faces): Use rx components instead of regexp literals
for labels.
* test/lisp/progmodes/cperl-mode-tests.el: Test rx sequences
instead of regexp strings
Eric Abrahamsen [Tue, 7 Sep 2021 18:51:39 +0000 (11:51 -0700)]
Don't let nndiary.el alter variables when loading file
* lisp/gnus/nndiary.el (nndiary-open-server): Move the manipulation of
`gnus-extra-headers' and `nnmail-extra-headers' into this function: it
should only happen if we're actually firing up an nndiary server.
Previously, simply attempting to complete a gnus-* prefixed symbol
could end up loading this file, and changing the variable values.
* lisp/net/browse-url.el (browse-url-default-windows-browser)
(browse-url-default-macosx-browser): Encode the URL before using
(in case it contains spaces) (bug#50435).
* lisp/net/browse-url.el (browse-url-url-encode-chars): Document
what the argument really is, and simplify the implementation
(bug#50435).
(browse-url-encode-url): Encode spaces.
Eli Zaretskii [Tue, 7 Sep 2021 13:03:27 +0000 (16:03 +0300)]
Improve documentation of new Xref options
* lisp/progmodes/xref.el (xref-auto-jump-to-first-definition)
(xref-auto-jump-to-first-xref): More accurate description in the
doc strings.
* doc/emacs/maintaining.texi (Looking Up Identifiers)
(Identifier Search, List Identifiers, Project File Commands): Fix
the documentation of 'xref-auto-jump-to-first-definition' and
'xref-auto-jump-to-first-xref' to be more accurate.
* etc/NEWS: More accurate wording of the entry about
'xref-auto-jump-to-first-definition' and
'xref-auto-jump-to-first-xref'.
Michael Albinus [Tue, 7 Sep 2021 12:36:06 +0000 (14:36 +0200)]
Do not expand default method, user, host in remote file name completion
* lisp/net/tramp.el (tramp-completion-handle-file-name-all-completions):
Do not expand default method, user, host. (Bug#50387)
(tramp-get-completion-methods): `partial-method' can be nil.
Support specifying just one command in project-switch-commands
* lisp/progmodes/project.el (project-switch-commands):
Describe the new possible type of value.
(project--switch-project-command):
New function, extract from project-switch-project.
(project-switch-project): If project-switch-commands's value is a
symbol, invoke that command without showing a menu.
Add possibility to override the default highlighting
* lisp/progmodes/bug-reference.el (bug-reference-fontify): Highlight
99th group if it exists.
(bug-reference-bug-regexp): Document that regexp group 99 can be used
to override the default behavior of highlighting the complete match.
(bug-reference--run-auto-setup): Use run-hook-with-args-until-success
instead of throw/catch.
Normalise nested `progn` forms in byte-code optimiser
* lisp/emacs-lisp/byte-opt.el (byte-optimize-body): Flatten body.
This simplifies the source tree and reduces the number of different
cases that other optimisations need to take into account.
Treat `ignore` as any other function during source-level optimisation,
to avoid having its warning-suppression effects cancelled by repeated
passes. Instead, define a custom code generation function.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't treat `ignore' specially here.
(side-effect-free-fns): Don't mark `ignore` as side-effect-free
or error-free (although it is), since that would allow the optimiser
to elide calls.
* lisp/emacs-lisp/bytecomp.el (ignore, byte-compile-ignore):
Define and register a code-gen function.
Optimise `member` and `assoc` (etc) with constant empty list
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-assq): New.
(byte-optimize-member, byte-optimize-assoc, byte-optimize-memq):
When the list argument is constant nil, the result is always nil.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
* lisp/dired-aux.el (dired-do-find-regexp-and-replace):
Disregard the customized value of xref-auto-jump-to-first-xref
(it breaks the xref-query-replace-in-results invocation).
* lisp/progmodes/xref.el (xref-auto-jump-to-first-xref):
Mention the caveat for users or xref distributed through ELPA.
Allen Li [Mon, 6 Sep 2021 08:59:54 +0000 (10:59 +0200)]
Make `gnus-group-use-permanent-levels' work better
* lisp/gnus/gnus-group.el (gnus-group-default-level): Removed implicit
setting of gnus-group-use-permanent-levels.
(gnus-group-list-groups): Set gnus-group-use-permanent-levels
explicitly.
(gnus-group-get-new-news): Set gnus-group-use-permanent-levels
explicitly (bug#50417).
(gnus-group-get-new-news): When the user has given a numeric
prefix, use that as the list level.
project--files-in-directory: Fix handling of ignores
* lisp/progmodes/project.el (project--files-in-directory):
Pass "." as the DIR argument to 'find' because otherwise the ignore
expression can match the project root directory name, which we don't
want to happen (bug#50240). Fixup the resulting file names at the end
with concatenation.
Originally I thought it could lead to worse performance, but the
results show equal or slightly better timings.
* lisp/progmodes/xref.el (xref-matches-in-directory):
Apply a similar fix.
(xref--find-ignores-arguments): Use file-name-as-directory, so
that when passed "." replace-match still had the expected effect.
* test/lisp/progmodes/project-tests.el (project-ignores-bug-50240):
New test.
* test/lisp/progmodes/xref-tests.el
(xref-matches-in-directory-filters-with-ignores): New test.
Prefer mailing lists to newgroups.
(History of Emacs): Rename from "Status of Emacs".
Move XEmacs node here.
(Emacs for other operating systems): Merge all the "non-Unix"
systems into a single node.
Improve the documentation around the read-key/minibuffer prompting
* lisp/subr.el (read-char-choice-use-read-key): Explain the
difference.
(read-char-choice): Mention the variables.
(y-or-n-p-use-read-key): Explain the difference.
(y-or-n-p): Mention the variable (bug#50390).
Eli Zaretskii [Sun, 5 Sep 2021 07:59:07 +0000 (10:59 +0300)]
Improve documentation of new Xref options
* doc/emacs/maintaining.texi (Looking Up Identifiers):
* etc/NEWS: Document the new Xref user options. Move a lost
Xref-related entry to the rest of them.
Augusto Stoffel [Sat, 4 Sep 2021 09:16:11 +0000 (11:16 +0200)]
Fixes for 'python-shell-send-string' and 'python-shell-send-file'
* lisp/progmodes/python.el (python-shell-send-string): use a temporary
file for sufficiently long strings.
(python-shell-send-file, python-shell-eval-file-setup-code): Avoid
showing "plumbing code" in the traceback (bug#32042).
Ian W [Sat, 4 Sep 2021 03:53:24 +0000 (20:53 -0700)]
Fix error handling in 'ispell-init-process'
* lisp/textmodes/ispell.el (ispell-init-process): When Ispell
initialization reports an error, call 'ispell-accept-output' only
if the Ispell process is still alive. (Bug#50370)
Michael Albinus [Sun, 5 Sep 2021 07:23:30 +0000 (09:23 +0200)]
Cleanup tramp-tests.el
* test/lisp/net/tramp-tests.el
(tramp--test--deftest-direct-async-process): Fix macro declaration.
(tramp-test29-start-file-process, tramp-test30-make-process):
Do not run connection type test for direct async processes.
Xref: automatic jumping to the first definition or reference
* lisp/progmodes/xref.el (xref-auto-jump-to-first-definition)
(xref-auto-jump-to-first-xref): New user options.
Discussed in bug#50067.
(xref--show-xrefs, xref--show-defs): Use them here.
(xref--auto-jump-first): New function, handles different values.
(xref-show-definitions-buffer)
(xref-show-definitions-buffer-at-bottom): Use it.
Eli Zaretskii [Sat, 4 Sep 2021 10:34:32 +0000 (13:34 +0300)]
Improve documentation of line truncation and wrapping
* doc/emacs/display.texi (Line Truncation, Visual Line Mode):
* doc/lispref/display.texi (Truncation): Document that turning on
line truncation disables wrapping, and vice versa.
* src/buffer.c (syms_of_buffer) <truncate-lines>:
* src/xdisp.c (syms_of_xdisp) <truncate-partial-width-windows>:
Warn against turning on when 'visual-line-mode' is in effect.
* lisp/simple.el (visual-line-mode): Document that this mode
disables line truncation. (Bug#29664)
Add support for customization group hyperlinks in doc strings
* lisp/help-mode.el (help-customization-group): New button.
(help-xref-customization-group-regexp): New const.
(help-make-xrefs): Use them to allow making customization group
buttons.
* lisp/hi-lock.el (hi-lock-mode): Tweak the doc string so that
running hi-lock-mode in a *Help* buffer showing this help text
won't issue an error (bug#20977).
* doc/emacs/calendar.texi: Document the change.
* lisp/calendar/diary-lib.el (diary-offset):
* test/lisp/calendar/icalendar-tests.el: Add a test (bug#50195).
Augusto Stoffel [Fri, 3 Sep 2021 12:26:51 +0000 (14:26 +0200)]
Change Python eval to send directly instead of using temporary files
* lisp/progmodes/python.el (python-shell-eval-setup-code): New
const for setting up eval (bug#49822).
(python-shell--encode-string): New function.
(python-shell-send-string): Use it to send commands directly
instead of writing to a temporary file.
(python-shell-send-string-no-output): Adjust sending.
(python-shell-send-file): Ditto.
* css-mode.el (css-property-alist, css-value-class-alist): Provide new
position related entries for use in css-property-alist. Make sure
that property-alist reflect the spec:
https://www.w3.org/TR/css-align-3/#property-index
Fix `describe-function' for autoloaded adviced functions
* lisp/emacs-lisp/nadvice.el (advice--make-single-doc): Factor
out.
(advice--make-docstring): From here (bug#23523). Also include
advices for autoloads.
Make recent timer changes more backwards-compatible
* lisp/emacs-lisp/timer.el (timerp, timer-event-handler): Make
backwards-compatible with old .elc files that have their own
versions of `timer-create'd structures.