Eli Zaretskii [Fri, 10 Sep 2021 11:57:38 +0000 (14:57 +0300)]
Document 'tags-apropos-additional-actions' with Xref
* doc/emacs/maintaining.texi (Looking Up Identifiers): Rearrange
and reword documentation of 'xref-find-apropos' and
'xref-auto-jump-to-first-definition'. Add the description of
'tags-apropos-additional-actions'. Delete the comment with
not-yet implemented features that were available with
'tags-apropos'.
* etc/NEWS: Augment the wording of 'xref-find-apropos' entry.
* lisp/isearch.el (isearch-beginning-of-buffer)
(isearch-end-of-buffer): Fix their behavior when
isearch-repeat-on-direction-change is non-nil (bug#50466).
Change the default value of search-whitespace-regexp
* lisp/isearch.el (search-whitespace-regexp): Change the default
to always exclude newlines from the set (bug#21278). It used to
be mode-dependent whether newlines were included or not, and this
was confusing as a user interface.
Support tags-apropos-additional-actions in etags Xref backend
* lisp/progmodes/etags.el (xref-etags-apropos-location):
New class.
(xref-location-marker): New method definition.
(xref-make-etags-apropos-location): New function.
(etags--xref-apropos-additional): New function.
(xref-backend-apropos): Use it here.
Eli Zaretskii [Thu, 9 Sep 2021 17:08:56 +0000 (20:08 +0300)]
Fix a recent change wrt 'comint-max-line-length'
* lisp/progmodes/python.el (python-shell-send-string): Only heed
'comint-max-line-length' for subprocesses with which we
communicate via PTYs. (Bug#49822)
* lisp/comint.el (comint-max-line-length): Doc fix. Add a value
for MS-Windows.
Augusto Stoffel [Thu, 9 Sep 2021 13:48:37 +0000 (15:48 +0200)]
Better treatment of line length limits for the Python inferior
* lisp/comint.el (comint-max-line-length): New constant reflecting a
safe maximum line size that can be sent to an inferior process.
* lisp/progmodes/python.el
(python-shell-comint-watch-for-first-prompt-output-filter): Send setup
code to the inferior process only once and at this stage.
(python-shell-eval-setup-code, python-shell-eval-file-setup-code):
Move, unchanged, to an earlier point to avoid byte-compiler warnings.
(python-shell-send-string-no-output): Revert changes of e32c7d2a8d
(python-shell-send-string): Use 'comint-max-line-length' to decide
when to resort to temp files.
(python-shell-send-string, python-shell-send-file): Don't send setup
code each time (bug#49822).
* lisp/simple.el (pop-mark): Don't ding at the user if there's no
mark to pop (bug#44375). This function is used (in some
circumstances) when the user mouse-1-clicks links (in *Help*
buffer, for instance), which will then ding at the user before
following the link.
* lisp/progmodes/python.el
(python-shell-completion-native-disabled-interpreters): Remove
ipython from list, because it apparently works fine these days
(bug#50458).
Don't output "probably introduced" if we know the answer for sure
* lisp/help-fns.el (help-fns--customize-variable-version):
Factored out from `help-fns--customize-variable' to be able to see
whether it outputs anything.
(help-fns--run-describe-functions): New function.
(help-fns--activated-functions): New internal variable.
(describe-variable): Use new function.
(describe-face, describe-function-1): Ditto (bug#50463).
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.
Juri Linkov [Sun, 5 Sep 2021 17:16:33 +0000 (20:16 +0300)]
Improve tab-bar event handling (bug#41343)
* lisp/tab-bar.el (tab-bar--key-to-number): Rename from tab--key-to-number.
(tab-bar--event-to-item): New function from tab-bar-handle-mouse.
(tab-bar-mouse-select-tab, tab-bar-mouse-close-tab)
(tab-bar-mouse-context-menu, tab-bar-mouse-move-tab):
Use tab-bar--event-to-item.
* src/menu.c (x_popup_menu_1): Handle Qtab_bar in the second list element.
* src/xdisp.c (tty_get_tab_bar_item): Change arg 'end' to bool 'close_p'.
(tty_get_tab_bar_item): Detect if the close button was clicked.
(tty_handle_tab_bar_click): Return a list with caption that has
text properties.
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)