]> git.eshelyaron.com Git - emacs.git/log
emacs.git
19 months agosoap-client.el: Revert dd0727e1ec1f, add compatibility comment
Thomas Fitzsimmons [Thu, 11 May 2023 10:01:32 +0000 (06:01 -0400)]
soap-client.el: Revert dd0727e1ec1f, add compatibility comment

* lisp/net/soap-client.el (soap-decode-date-time): Call
encode-time using apply, for GNU ELPA backward compatibility.
Remove some tabs.
(soap-type-is-array?): Reword docstring to accommodate checkdoc.

19 months ago; * lisp/files.el (Safe File Variables): Remove redundant text.
Eli Zaretskii [Thu, 11 May 2023 16:06:18 +0000 (19:06 +0300)]
; * lisp/files.el (Safe File Variables): Remove redundant text.

19 months ago; Fix last change
Eli Zaretskii [Thu, 11 May 2023 13:52:50 +0000 (16:52 +0300)]
; Fix last change

* lisp/files.el (safe-local-variable-directories):
* doc/lispref/variables.texi (File Local Variables):
* doc/emacs/custom.texi (Safe File Variables): Fix wording of
documentation in last change.  (Bug#61901)

19 months agoAdd safe-local-variable-directories variable.
Antero Mejr [Tue, 9 May 2023 20:51:14 +0000 (20:51 +0000)]
Add safe-local-variable-directories variable.

This variable can be set to automatically load risky dir-local
variables from a list of trusted directories.

* lisp/emacs-lisp/files.el (safe-local-variable-directories,
hack-local-variables-filter, hack-local-variables-confirm): New
variable and associated logic.
* test/lisp/files-tests.el
(files-tests-safe-local-variable-directories): Add tests for same.
* doc/emacs/custom.texi (Safe File Variables): Add documentation for
same.
* doc/lispref/variables.texi (File Local Variables): Add documentation
for same.
* etc/NEWS (Lisp Changes in Emacs 30.1): Add news entry for
same.  (Bug#61901)

19 months ago; Fix byte-compilation warnings in --without-x build
Eli Zaretskii [Thu, 11 May 2023 13:25:46 +0000 (16:25 +0300)]
; Fix byte-compilation warnings in --without-x build

* lisp/x-dnd.el (mwheel):
* lisp/term/haiku-win.el (mwheel): Require.
* lisp/progmodes/prog-mode.el (treesit-node-at):
* lisp/dynamic-setting.el (reconsider-frame-font): Declare.
(Bug#63415)

19 months agoMore descriptive character escape syntax error messages (bug#63436)
Mattias Engdegård [Thu, 11 May 2023 09:49:06 +0000 (11:49 +0200)]
More descriptive character escape syntax error messages (bug#63436)

* src/lread.c (invalid_escape_syntax_error): Remove.
(read_char_escape): Make certain messages more specific
than just "Invalid escape character syntax" to help finding
and understanding the error.

19 months agoMerge branch 'emacs-29'
Stefan Monnier [Wed, 10 May 2023 15:18:43 +0000 (11:18 -0400)]
Merge branch 'emacs-29'

19 months agoMake c-emacs-features use the proper binding of parse-sexp-lookup-properties
Alan Mackenzie [Fri, 14 Apr 2023 10:33:03 +0000 (10:33 +0000)]
Make c-emacs-features use the proper binding of parse-sexp-lookup-properties

This is relevant for bug #58558, although it does not fix it.  Due to a wrong
ordering of with-current-buffer and a let form, the function overwrote the
global value of parse-sexp-lookup-properties and two other variables.

* lisp/progmodes/cc-defs.el (c-emacs-features): Change the nesting of
with-current-buffer and let so that the let bindings get used.

19 months ago; * lisp/obsolete/autoload.el (make-directory-autoloads): Doc fix.
Eli Zaretskii [Wed, 10 May 2023 13:51:17 +0000 (16:51 +0300)]
; * lisp/obsolete/autoload.el (make-directory-autoloads): Doc fix.

19 months ago; Fix example in ELisp manual
Eli Zaretskii [Wed, 10 May 2023 13:47:14 +0000 (16:47 +0300)]
; Fix example in ELisp manual

* doc/lispref/minibuf.texi (Yes-or-No Queries): Fix example.
(Bug#63399)

19 months ago; Fix wording in Emacs manual
Eli Zaretskii [Wed, 10 May 2023 13:36:14 +0000 (16:36 +0300)]
; Fix wording in Emacs manual

* doc/emacs/search.texi (Replacement and Lax Matches): Fix
wording.  (Bug#63398)

19 months ago; Fix minor documentation issue ion replace.el
Eli Zaretskii [Wed, 10 May 2023 13:01:28 +0000 (16:01 +0300)]
; Fix minor documentation issue ion replace.el

* lisp/replace.el (query-replace, query-replace-regexp): Doc fix.
(Bug#63397)

19 months agoClean up files created by arc-mode-tests
Mattias Engdegård [Wed, 10 May 2023 12:36:32 +0000 (14:36 +0200)]
Clean up files created by arc-mode-tests

* test/lisp/arc-mode-tests.el (arc-mode-test-zip-ensure-ext):
Remove created files at the end of the test.

19 months agowith-display-message: Workaround for bug#63253
Stefan Monnier [Wed, 10 May 2023 02:30:52 +0000 (22:30 -0400)]
with-display-message: Workaround for bug#63253

Running arbitrary ELisp code from an atimer is still dangerous,
at least because the regexp engine is not-reentrant, so let's patch up
the case we bumped into.  There are probably many other such holes :-(

* src/alloc.c (garbage_collection_inhibited): Make it non-static.

* src/xdisp.c (garbage_collection_inhibited): Declare it.
(set_message, clear_message): Use it as a proxy for "we're in
a dangerous context like within `probably_quit`".

19 months agotramp-ssh-controlmaster-options shouldn't return nil
Benson Chu [Tue, 9 May 2023 15:05:32 +0000 (17:05 +0200)]
tramp-ssh-controlmaster-options shouldn't return nil

* lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options):
Should never return nil, but empty string.

Copyright-paperwork-exempt: yes

19 months ago; * test/src/treesit-tests.el: declare functions to silence warnings
Mattias Engdegård [Tue, 9 May 2023 11:37:26 +0000 (13:37 +0200)]
; * test/src/treesit-tests.el: declare functions to silence warnings

19 months ago; * lisp/treesit.el (treesit-node-top-level): cleaner and faster
Mattias Engdegård [Tue, 9 May 2023 11:28:20 +0000 (13:28 +0200)]
; * lisp/treesit.el (treesit-node-top-level): cleaner and faster

19 months agoSpeed up skip-chars-{forward|reverse} with char classes
Mattias Engdegård [Mon, 8 May 2023 16:38:33 +0000 (18:38 +0200)]
Speed up skip-chars-{forward|reverse} with char classes

* src/regex-emacs.h (re_wctype_t): Add RECC_NUM_CLASSES.
* src/syntax.c (skip_chars, in_classes): Use an array on the stack
instead of a Lisp list for storing character classes.
Don't check all classes if there is a match in one.
Remove useless handle_iso_classes argument.

19 months agoEglot: Replace eglot-execute-command with new eglot-execute
João Távora [Tue, 9 May 2023 09:34:52 +0000 (10:34 +0100)]
Eglot: Replace eglot-execute-command with new eglot-execute

Hopefully helps with https://github.com/joaotavora/eglot/discussions/1070 and
https://github.com/emacs-sideline/sideline/issues/5

* lisp/progmodes/eglot.el (eglot-execute-command): Obsolete.
(eglot-execute): New generic.
(eglot--read-execute-code-action): Use eglot-execute.

19 months ago; Don't use literal non-ASCII characters in Texinfo
Eli Zaretskii [Tue, 9 May 2023 09:06:32 +0000 (12:06 +0300)]
; Don't use literal non-ASCII characters in Texinfo

* doc/emacs/mule.texi (Input Methods): Don't use non-ASCII
characters in Texinfo sources, where Texinfo provides an ASCII command
to insert it.

19 months agoFido-mode: never shadow 'external' completion style
João Távora [Fri, 5 May 2023 18:44:11 +0000 (19:44 +0100)]
Fido-mode: never shadow 'external' completion style

As explained in the manual (20.7.2 Fast minibuffer selection)
'fido-mode' and 'fido-vertical-mode' give priority the "flex"
completion style.

In fact, bug#62015 was recently fixed in commit because that priority
was not taking place correctly and some completions were missed.

However, an exception must be made for the 'external' completion
style.

That style, made available by the lisp/external-completion.el library,
is specifically designed to work with backends that provide only a
partial view of all completions.  If we allow 'flex' to step in front
of 'external' it could mean that 'flex' matches something and
'external' isn't triggered as it probably should.

To reproduce have the rust-mode ELPA package and the rust-analyzer LSP
server handy.  Then:

  emacs -Q -f package-initialize main.rs

Where main.rs is this content:

  fn foo1()    {} fn foo2()    {} fn foo3() {}
  fn foobar1() {} fn foobar2() {} fn foobar3() {}

The rust-analyzer server can be quickly configured to return only 3
workspace symbols max, so evaluate:

  (setq-default eglot-workspace-configuration
                '(:rust-analyzer
                    (:workspace (:symbol (:search (:limit 3))))))

Now start M-x eglot and M-x fido-vertical-mode and type C-u M-. to
find an arbitrary symbol in this one-file project.

Type 'f'.  You will see the three foo's are listed, correctly.

Now type '3'.   You will only see "foo3".

But that's wrong because "foobar3" was available, if only the server
had been asked for it.  This commit fixes the situation and no
completions are lost.

As an unfortunate side-effect of this commit, the fontification of
completions-common-part on the matches is lost, but that is not worse
than missing out on completions and there are better ways to recover
the fontification anyway (in external-completion.el).

See also:
https://github.com/joaotavora/eglot/discussions/1219#discussioncomment-5818336

* lisp/icomplete.el (icomplete--fido-ccd): Do not touch entries
with 'external in them.

Do not merge to master.
Backport:

(cherry picked from commit 0e8d8a72284f6b3aaa1bbce73d41c7d84bbc4d3c)

19 months ago; * lisp/leim/quail/persian.el: Fix a typo in last commit.
Eli Zaretskii [Tue, 9 May 2023 05:34:43 +0000 (08:34 +0300)]
; * lisp/leim/quail/persian.el: Fix a typo in last commit.

19 months agoAvoid crashes in --without-all build trying to scale non-ASCII char
Eli Zaretskii [Tue, 9 May 2023 05:20:57 +0000 (08:20 +0300)]
Avoid crashes in --without-all build trying to scale non-ASCII char

* src/fontset.c (face_for_char): Display a non-ASCII character as
glyphless if the ASCII face has no fontset.  (Bug#63283)

19 months agoImprove instructions for dealing with Emacs crashes
Eli Zaretskii [Tue, 9 May 2023 04:52:04 +0000 (07:52 +0300)]
Improve instructions for dealing with Emacs crashes

* doc/emacs/trouble.texi (Crashing): Show the variant of the
'addr2line' command for MS-Windows.

19 months agoFix treesit-node-top-level (bug#63374)
Yuan Fu [Mon, 8 May 2023 19:58:19 +0000 (12:58 -0700)]
Fix treesit-node-top-level (bug#63374)

* lisp/treesit.el (treesit-node-top-level): Fix the use of
rx-to-string.

19 months agoImproved transliterations + improved bidi insertion support for Farsi
Mohsen Banan [Sun, 7 May 2023 17:11:55 +0000 (10:11 -0700)]
Improved transliterations + improved bidi insertion support for Farsi

* lisp/leim/quail/persian.el ("farsi-transliterate-banan"):
Improve and add transliterations.  (Bug#63361)

19 months agoExtend secrets.el by lock/unlock item
Philipp Uhl [Mon, 8 May 2023 11:33:42 +0000 (13:33 +0200)]
Extend secrets.el by lock/unlock item

* lisp/net/secrets.el (secrets-lock-item, secrets-unlock-item):
New defuns.
(secrets-get-secret): Use `secrets-unlock-item'.  (Bug#62952)

19 months agoFix crash when creating a child frame in NS (bug#63107)
Alan Third [Thu, 27 Apr 2023 19:08:23 +0000 (20:08 +0100)]
Fix crash when creating a child frame in NS (bug#63107)

* src/nsterm.m ([EmacsView initFrameFromEmacs:]): Have a second go at
creating the toolbar.
([EmacsWindow createToolbar:]): If there is already a toolbar or the
EmacsView's layer is not an EmacsLayer, then do nothing.

(cherry picked from commit 3adc1e7f37901235bda83ea65a90644b7b0a8dbf)

19 months agoFix outgoing mime type regression (Bug#62815)
Andrew G Cohen [Sun, 30 Apr 2023 01:55:42 +0000 (09:55 +0800)]
Fix outgoing mime type regression (Bug#62815)

* lisp/net/mailcap.el (mailcap-mime-extensions,
mailcap-parse-mimetype-file, mailcap-mime-types): Don't regexp-quote
mimetypes in a context where they should be strings.
(mailcap--regexp-quote-type): Remove.

(cherry picked from commit 605414d018da47f99dec5019142f584b6eb174c8)

19 months agoFix crash when creating a child frame in NS (bug#63107)
Alan Third [Thu, 27 Apr 2023 19:08:23 +0000 (20:08 +0100)]
Fix crash when creating a child frame in NS (bug#63107)

* src/nsterm.m ([EmacsView initFrameFromEmacs:]): Have a second go at
creating the toolbar.
([EmacsWindow createToolbar:]): If there is already a toolbar or the
EmacsView's layer is not an EmacsLayer, then do nothing.

19 months agodefine-minor-mode: sanitize mode function messages
Nicholas Vollmer [Sun, 7 May 2023 04:06:18 +0000 (00:06 -0400)]
define-minor-mode: sanitize mode function messages

* emacs-lisp/easy-mmode.el (define-minor-mode): Ensure mode's
pretty name is not interprted as a message formatting string,
e.g., if the mode name contains a '%'.  (Bug#63343)

19 months agoFix beginning/end-of-defun with tree-sitter
Eli Zaretskii [Sun, 7 May 2023 06:13:10 +0000 (09:13 +0300)]
Fix beginning/end-of-defun with tree-sitter

* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Push mark, as other beginning/end-of-defun
functions do.

19 months ago; Fix last change
Andreas Schwab [Sat, 6 May 2023 20:27:55 +0000 (22:27 +0200)]
; Fix last change

19 months agoSimplify check for non-empty list
Andreas Schwab [Sat, 6 May 2023 20:17:19 +0000 (22:17 +0200)]
Simplify check for non-empty list

* lisp/gnus/nntp.el (nntp-with-open-group): Simplify check for
non-empty list.

19 months agoFix indent for enums in csharp-mode
Theodor Thornhill [Sat, 6 May 2023 19:13:15 +0000 (21:13 +0200)]
Fix indent for enums in csharp-mode

* lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Check for
keywords containing 'enum' on the line before an opening bracket, and
make it behave like a class-open token.

19 months ago; Expand 'package-vc-install' documentation
Philip Kaludercic [Sat, 6 May 2023 18:51:39 +0000 (20:51 +0200)]
; Expand 'package-vc-install' documentation

* lisp/emacs-lisp/package-vc.el (package-vc-install): Go into further
detail on the handling of the REV argument.  (Bug#60418)

19 months agoFix portability problem in lisp/Makefile.in
Po Lu [Sat, 6 May 2023 12:43:22 +0000 (20:43 +0800)]
Fix portability problem in lisp/Makefile.in

* lisp/Makefile.in (check-defun-dups): Avoid POSIX command
substitutions.

19 months agoFix portability problem in toplevel Makefile
Po Lu [Sat, 6 May 2023 12:42:22 +0000 (20:42 +0800)]
Fix portability problem in toplevel Makefile

* Makefile.in (sanity-check, preferred-branch-is-current): Avoid
POSIX command substitution, to make Makefile work with the SVR4
shell.

19 months agoTeach c-ts-mode about the 'restrict' keyword
Eli Zaretskii [Sat, 6 May 2023 12:15:42 +0000 (15:15 +0300)]
Teach c-ts-mode about the 'restrict' keyword

* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Add
"restrict" and "_Atomic" type qualifiers.  (Bug#63323)

19 months ago* lisp/x-dnd.el (x-dnd-after-move-frame): Skip dead frames. (Bug#63312)
Eli Zaretskii [Sat, 6 May 2023 11:16:36 +0000 (14:16 +0300)]
* lisp/x-dnd.el (x-dnd-after-move-frame): Skip dead frames.  (Bug#63312)

19 months ago; Updated Elispref-Manual: `nil' cannot be defun'ed
Shynur [Fri, 7 Apr 2023 03:45:28 +0000 (11:45 +0800)]
; Updated Elispref-Manual: `nil' cannot be defun'ed

* doc/lispref/functions.texi (Function Cells): Fix inaccuracy.
(Bug#62746)

19 months agoFix doc strings of 'mark-sexp' and 'mark-word'
Eli Zaretskii [Sat, 6 May 2023 08:47:31 +0000 (11:47 +0300)]
Fix doc strings of 'mark-sexp' and 'mark-word'

* lisp/emacs-lisp/lisp.el (mark-sexp):
* lisp/simple.el (mark-word): Clarify the doc strings in various
usage cases.  (Bug#62892)

19 months agoFix interactive forms in some Lisp packages
Eli Zaretskii [Sat, 6 May 2023 08:29:58 +0000 (11:29 +0300)]
Fix interactive forms in some Lisp packages

* lisp/woman.el (woman-reset-emulation):
* lisp/treesit.el (treesit--explorer-jump):
* lisp/speedbar.el (speedbar-toggle-etags):
* lisp/filesets.el (filesets-convert-patterns):
* lisp/calculator.el (calculator-saved-move):
* lisp/progmodes/gud.el (gud-basic-call):
* lisp/progmodes/ebrowse.el (ebrowse-redraw-marks)
(ebrowse-view-file-other-frame):
* lisp/progmodes/dcl-mode.el (dcl-indent-to):
* lisp/net/socks.el (socks-open-connection):
* lisp/net/ntlm.el (ntlm-build-auth-request):
* lisp/emacs-lisp/backtrace.el (backtrace-expand-ellipsis):
* lisp/calc/calc-prog.el (calc-edit-macro-finish-edit):
* lisp/calc/calc-misc.el (calc-info-goto-node):
* lisp/net/dictionary.el (dictionary-new-search)
(dictionary-definition, dictionary-switch-tooltip-mode): Fix
interactive functions where the 'interactive' form did not supply
the mandatory arguments.  (Bug#62864)

19 months ago; * etc/EGLOT-NEWS: Fix misspellings.
Eli Zaretskii [Sat, 6 May 2023 06:45:05 +0000 (09:45 +0300)]
; * etc/EGLOT-NEWS: Fix misspellings.

19 months ago; * etc/EGLOT-NEWS: Fix wording of last change.
Eli Zaretskii [Sat, 6 May 2023 06:38:20 +0000 (09:38 +0300)]
; * etc/EGLOT-NEWS: Fix wording of last change.

19 months agoAllow X-Message-SMTP-Method to include more MTAs
Andrew G Cohen [Wed, 3 May 2023 03:37:45 +0000 (11:37 +0800)]
Allow X-Message-SMTP-Method to include more MTAs

* lisp/gnus/message.el (message-multi-smtp-send-mail): Allow the
X-Message-SMTP-Method header to override the default mailer with not
only smtp and sendmail but other MTAs as well.
* doc/misc/message.texi: Document changes to the usage of
X-Message-SMTP-Method.

19 months agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Dmitry Gutov [Sat, 6 May 2023 00:59:59 +0000 (03:59 +0300)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

19 months agopackage-upgrade: Implement the upgrading of built-ins
Dmitry Gutov [Sat, 6 May 2023 00:54:59 +0000 (03:54 +0300)]
package-upgrade: Implement the upgrading of built-ins

* lisp/emacs-lisp/package.el (package--upgradeable-packages):
Add new argument.  When INCLUDE-BUILTINS is non-nil, also search
among package--builtins (bug#62720).
(package-upgrade): Use the new argument.  Bind
package-install-upgrade-built-in when necessary.  Mark the package
as selected if it was previously an "active built-in".
(package-upgrade-all): Update the docstring.

19 months agoMerge from origin/emacs-29
Dmitry Gutov [Sat, 6 May 2023 00:41:54 +0000 (03:41 +0300)]
Merge from origin/emacs-29

79a886ba368 (package-upgrade): Don't remove the package from 'package...
c0ab4e9ca93 Eglot: re-rename eglot-upgrade to eglot-upgrade-eglot
b4e90070f96 Fix arguments of xml.c functions as displayed in Help buf...
b1bda8228e5 More fixes for NetBSD/vax
a2d4cd06f45 Improve VHDL mode highlighting
2f3a514b6db Clarify documentation wrt floating point division by zero...
94e984e6700 Make loaddefs-generate slightly more tolerant
aba41d2c4bb ; Minor doc cleanups in go-ts-mode.el
b42ccb2e5c1 ; Minor grammar fix in treesit manual.
ab44c8a6f9d Fix order of rcirc-connect arguments
8eb6e33691d Fix rcirc messages printing in the wrong place
2901a3443c7 Prevent unnecessary modifications of 'package-vc-selected...
eaad302bd6f Rename eglot-update to eglot-upgrade
eaf25b9c6ae go-ts-mode: Use iota query only if supported (Bug#63086)
cc090294d77 (rng-complete-tag): Add the (ignored) argument to the :co...
21ec6c1d5cc Update to Transient v0.3.7-219-g3ded15b
8d5aa8df4ad Fix inserting selection data into Mozilla programs
57562c3fd0a Recognize defstruct slot names in various eieio functions
b93eb68cc30 Use 'calendar-buffer' instead of fixed string

# Conflicts:
# etc/EGLOT-NEWS

19 months ago; Merge from origin/emacs-29
Dmitry Gutov [Sat, 6 May 2023 00:36:29 +0000 (03:36 +0300)]
; Merge from origin/emacs-29

The following commit was skipped:

e338a8ac41d Handle point not at EOB in minibuffer-choose-completion

19 months agoMerge from origin/emacs-29
Dmitry Gutov [Sat, 6 May 2023 00:36:29 +0000 (03:36 +0300)]
Merge from origin/emacs-29

fceaf230b06 Note that Emacs pauses when handling sentinel errors

19 months ago(package-upgrade): Don't remove the package from 'package-selected-packages'
Dmitry Gutov [Sat, 6 May 2023 00:32:08 +0000 (03:32 +0300)]
(package-upgrade): Don't remove the package from 'package-selected-packages'

* lisp/emacs-lisp/package.el (package-upgrade):
Don't remove the package from 'package-selected-packages', fixing
the problem described in https://debbugs.gnu.org/62720#718.

19 months agoAdd interface for finding users in erc-server-PRIVMSG
F. Jason Park [Fri, 28 Apr 2023 13:34:09 +0000 (06:34 -0700)]
Add interface for finding users in erc-server-PRIVMSG

* lisp/erc/erc-backend.el (erc-server-PRIVMSG): Call new hook
`erc--user-from-nick-function' for turning the sender's nick into a
channel user, if any.
* lisp/erc/erc-button.el (erc-button--add-phantom-speaker): Redo
completely using simplified API.
(erc-button--fallback-user-function): Add internal function-interface
variable for finding an `erc-server-user' object when the usual places
disappoint.
(erc-button--get-phantom-user): Add new function, a getter for
`erc-button--phantom-users'.
(erc-button--phantom-users-mode): Replace advice subscription for
`erc-button--modify-nick-function' with one for
`erc-button--user-from-nick-function' and one for
`erc-button--fallback-user-function'.
(erc-button--get-user-from-speaker-naive): Remove unused function.
(erc-button--add-nickname-buttons): Call
`erc-button--fallback-user-function' when a user can't be found in
`erc-server-users' or `erc-channel-users'.
* lisp/erc/erc.el (erc--user-from-nick-function): New
function-interface variable for determining an `erc-server-user'
`erc-channel-user' pair from the sender's nick.
(erc--examine-nick): Add new function to serve as default value for
`erc--user-from-nick-function'.  (Bug#60933)

19 months agoImprove erc-button--modify-nick-function interface
F. Jason Park [Sat, 15 Apr 2023 16:52:05 +0000 (09:52 -0700)]
Improve erc-button--modify-nick-function interface

* lisp/erc/erc-button.el (erc-button--check-nicknames-entry): Remove
unused let binding.
(erc-button--preserve-bounds): Remove unused function.
(erc-button--nick): New struct type to serve as collection plate for
`erc-button--modify-nick-function' consumers.
(erc-button--modify-nick-function): Reexplain interface, now based on
`erc-button--nick' object.  Change default value to `identity'.
(erc-button--add-phantom-speaker): Redo to expect `erc-button--nick'
object.
(erc-button-add-nickname-buttons): Rework slightly to construct an
`erc-button--nick' object for feeding to
`erc-button--modify-nick-function'.  Only run the latter when an
`erc-server-user' has successfully been found.  (Bug#60933)

19 months agoRevise FORM-as-function interface in erc-button-alist
F. Jason Park [Sat, 15 Apr 2023 16:52:05 +0000 (09:52 -0700)]
Revise FORM-as-function interface in erc-button-alist

* lisp/erc/erc-button.el (erc-button-alist): Remove redundant "<URL:
foo>" entry, which adds nothing beyond highlighting the surrounding
bookends at the expense of doubling up on face properties for no
reason.  Revise the FORM-as-function interface by removing the dynamic
binding of face options and treating all implementers as replacements
for `erc-button-add-button'.
(erc-button--maybe-warn-arbitrary-sexp): Make more robust by having it
handle all accepted FORM types other than booleans.
(erc-button-add-buttons-1): Rework to only check FORM field once.
(erc-button--substitute-command-keys-in-region,
erc-button--display-error-with-buttons): Rename former as latter and
change signature to conform to new `erc-button-add-buttons' interface.
(erc-button--display-error-notice-with-keys): Call renamed helper.
* test/lisp/erc/erc-button-tests.el (erc-button-alist--url,
erc-button-tests--form, erc-button-tests--some-var,
erc-button-tests--erc-button-alist--function-as-form,
erc-button-alist--function-as-form,
erc-button-tests--erc-button-alist--nil-form,
erc-button-alist---nil-form): Add tests and helpers.  (Bug#60933)

19 months agoPreprocess prompt input linewise in ERC
F. Jason Park [Sun, 30 Apr 2023 14:12:56 +0000 (07:12 -0700)]
Preprocess prompt input linewise in ERC

* etc/ERC-NEWS: Mention revised role of `erc-pre-send-functions'
relative to line splitting.
* lisp/erc/erc-common.el (erc-input): Add new slot `refoldp' to allow
`erc-pre-send-functions' members to indicate that splitting should
occur a second time after all members have had their say.
(erc--input-split): Specify some defaults for overridden slots and
explicitly declare some types for good measure.
* lisp/erc/erc-goodies.el (erc-noncommands-mode,
erc-noncommands-enable, erc-noncommands-disable): Replace
`erc-pre-send-functions' with `erc--input-review-functions'.
* lisp/erc/erc-ring.el (erc-ring-enable, erc-ring-disable,
erc-ring-mode): Subscribe to `erc--input-review-functions' instead of
`erc-pre-send-functions' for `erc--add-to-input-ring'.
* lisp/erc/erc.el (erc-pre-send-functions): Note some nuances
regarding line splitting in doc string and note that a new slot is
available.
(erc--pre-send-split-functions, erc--input-review-functions): Rename
former to latter, while also obsoleting.  Remove large comment.  Add
new default member `erc--run-input-validation-checks'.
(erc-send-modify-hook): Replace the obsolete `erc-send-pre-hook' and
`erc-send-this' with `erc-pre-send-functions' in doc string.
(erc--check-prompt-input-for-excess-lines): Don't trim trailing
blanks.  Rework to also report overages in characters as well as
lines.
(erc--run-input-validation-hooks): New function to adapt an
`erc--input-split' object to `erc--check-prompt-input-functions'.
(erc-send-current-line): Run `erc--input-review-functions' in place of
the validation hooks they've subsumed.  Call `erc--send-input-lines'
instead of the now retired but not deprecated `erc-send-input'.
(erc--run-send-hooks, erc--send-input-lines): New functions that
together form an alternate version of `erc-send-input'.  They operate
on input linewise but make accommodations for older interfaces.
* test/lisp/erc/erc-tests.el (erc-ring-previous-command): Replace
`erc-pre-send-functions' with `erc--input-review-functions'.
(erc-tests--with-process-input-spy): Shadow
`erc--input-review-functions'.
(erc-check-prompt-input-for-excess-lines): Don't expect trailing
blanks to be trimmed.
(erc--run-send-hooks): New test.  (Bug#62947)

19 months agoRedo line splitting for outgoing messages in ERC
F. Jason Park [Mon, 17 Apr 2023 07:01:15 +0000 (00:01 -0700)]
Redo line splitting for outgoing messages in ERC

* lisp/erc/erc-backend.el (erc--reject-unbreakable-lines): New
variable, an escape hatch for somewhat regaining pre-5.6
line-splitting behavior.
(erc--split-line): New utility function that doesn't rely on
column-oriented filling.
* lisp/erc/erc.el (erc--pre-send-split-functions): Append
`erc--split-lines' to value.
(erc--split-lines): New function to re-split current selection of
lines.
(erc-send-input): Hard-code line preparation instead of calling
`erc--pre-send-split-functions', in order to bake in traditional
behavior before move to "pre-splitting".
* test/lisp/erc/erc-scenarios-base-split-line.el: New file.
* test/lisp/erc/erc-tests.el (erc--split-line): New test.
(erc-send-current-line): Don't expect a flood argument when
interpreting a command because it's not passed along to the command's
handler.  This was previously misleading because it assigned undue
significance to something that had no bearing on the fate of a
command.
* test/lisp/erc/resources/base/flood/ascii.eld: New file.
* test/lisp/erc/resources/base/flood/koi8-r.eld: New file.
* test/lisp/erc/resources/base/flood/utf-8.eld: New file.
* test/lisp/erc/resources/erc-d/erc-d.el: Don't decode input.
(Bug#62947)

19 months agoDon't send multiline commands as messages in ERC
F. Jason Park [Tue, 18 Apr 2023 06:09:49 +0000 (23:09 -0700)]
Don't send multiline commands as messages in ERC

* lisp/erc/erc.el (erc-command-regexp): Relocate from further down in
same file.
(erc--check-prompt-input-for-multiline-command): Reject slash commands
containing multiple lines during input validation and before running
additional hooks.
(erc--discard-trailing-multiline-nulls): Don't mark input that begins
with a possible "slash command" as constituting a plain message just
because it has a trailing newline.  It's relatively easy to add a
newline by accident, which can result in the unintended sharing of a
command line.  Also, ERC already has a /SAY command that allows a user
to send a message starting a literal command.
* test/lisp/erc/erc-tests.el (erc-send-whitespace-lines): Fix test to
expect validation error when non-blank lines follow a slash command.
(Bug#62947)

19 months agoRestore module var toggles in ERC's Custom buffers
F. Jason Park [Fri, 14 Apr 2023 07:07:31 +0000 (00:07 -0700)]
Restore module var toggles in ERC's Custom buffers

* lisp/erc/erc-common.el (erc--neuter-custom-variable-state): Remove
function.  ERC famously toggles global minor-mode vars during normal
operations, which adds noise to its customization buffers because
`customize-variable-state' always sees an activated module's mode
variable as having "CHANGED".  To suppress this annoyance, a
workaround was employed that used a dishonest `:get' function to
simply return the "saved value," when present.  While this improved
the Customize experience, it also misled users, which likely wasn't
justified.
(erc--make-show-me-widget): Add helper to avoid forward declarations.
(erc--prepare-custom-module-type): Don't deprive users of a working
minor-mode toggle.
(erc--find-feature): New function to guess the feature of a module's
containing library.
(define-erc-module): Remove `:get' keyword.  Specify `:require'
instead, whose value may be nil.  Users who currently have mode vars
in their `custom-file' won't be impacted by this addition because
those `custom-set-variables' entries will still lack a REQUEST list
and hence won't incur a startup penalty.  And new users intent on
using the toggle will hopefully do so with the knowledge they're
opting in to requiring ERC on startup, which is not the case if they
follow the recommended practice of using `erc-modules' instead.
(erc-with-server-buffer): Inline `erc-server-buffer'.
* test/lisp/erc/erc-tests.el (erc-process-input-line): Use helper.
(define-erc-module--global): Change expected expansion.  (Bug#60935)

19 months agoSimplify erc-button movement commands
F. Jason Park [Tue, 11 Apr 2023 00:58:05 +0000 (17:58 -0700)]
Simplify erc-button movement commands

* etc/ERC-NEWS: Mention TAB being bound to new command `erc-tab' and
`erc-previous-button' now stopping at the start of buttons.
* lisp/erc/erc-button.el (erc-button-mode, erc-button-enable,
erc-button-disable): Add and remove `erc-button-next' to
`erc--tab-functions' hook, which is tantamount to binding the command
in the read-only area of an ERC buffer.
(erc-button-next-function): Deprecate and remove from client code path
because this module doesn't concern itself with prompt input and thus
no longer needs to conform to the `completion-at-point-functions'
interface.
(erc-button--prev-next-predicate-functions): New variable, a hook to
determine whether to continue searching for a button.  Other modules
should utilize this as needed.
(erc-button--end-of-button-p): Add function to serve as default value
for `erc-button--continue-predicate'.
(erc--button-next): Add generalized button-movement function.
(erc-button-next, erc-button-previous): Make `erc-button-previous'
behave more predictably by having it land at the beginning of buttons.
And remove roundabout appeal to HOF in `erc-button-next'.
(erc-button-previous-of-nick): New command to jump to previous
appearance of nick at point.
* lisp/erc/erc-fill.el (erc-fill-wrap, erc-fill-wrap-enable,
erc-fill-wrap-disable): Add and remove merge-related hookee from
`erc-button--prev-next-predicate-functions'.
(erc-fill--wrap-merged-button-p): New function to detect redundant
speakers.
* lisp/erc/erc.el (erc-complete-functions): Quote TAB in doc string.
(erc-mode-map): Bind `erc-tab' to TAB.
(erc--tab-functions, erc-tab): Add new command and hook to serve as
unified dispatch for TAB-related operations.  It calls `c-a-p' in the
input area and defers to module code in the read-only message area.
* test/lisp/erc/erc-button-tests.el: New file.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate): Run
finalizer for transient keymap timer.
* test/lisp/erc/erc-tests.el
(erc-button--display-error-notice-with-keys): Move to new dedicated
test file for erc-button and fix expected behavior of
`erc-button-previous'.  (Bug#62834)

19 months agoAdd erc-timestamp property to invisible messages
F. Jason Park [Wed, 26 Apr 2023 14:05:49 +0000 (07:05 -0700)]
Add erc-timestamp property to invisible messages

* lisp/erc/erc-fill.el (erc-fill--wrap-beginning-of-line): Pretend
nicks with an empty string as a `display' prop are `invisible-p' and
break out of hidden "merged" nicks after moving.  (Bug#60936.)
* lisp/erc/erc-match.el (erc-hide-fools): Add comment.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Always add
`erc-timestamp' and `cursor-sensor-functions' properties but respect
tradition and don't actually stamp any invisible messages.

19 months agoActually define erc-default-server-functions
F. Jason Park [Fri, 21 Apr 2023 14:30:18 +0000 (07:30 -0700)]
Actually define erc-default-server-functions

* lisp/erc/erc-backend.el: Remove top-level `add-hook' for
`erc-default-server-functions'.
* lisp/erc/erc.el (erc-default-server-hook,
erc-default-server-functions): Officially deprecate the former and
rename it to the latter.
(erc-default-server-handler): Mark obsolete because its replacement
took over years ago.
(erc-debug-missing-hooks): Append instead of mutate.

19 months agoIgnore erc-reconnect-display after a timeout
F. Jason Park [Fri, 21 Apr 2023 02:20:59 +0000 (19:20 -0700)]
Ignore erc-reconnect-display after a timeout

* lisp/erc/erc-backend.el (erc--server-reconnect-display-timer): New
variable to store active timer that, upon firing, zeroes out
`erc--server-last-reconnect-count'.
(erc--server-last-reconnect-on-disconnect): New function to run on
`erc-disconnected-hook'.
(erc--server-last-reconnect-display-reset): New function to ensure the
reconnect-display period ends.
* lisp/erc/erc.el (erc-reconnect-display-timeout): New option to
control how long `erc-reconnect-display' affects the displaying of new
buffers following an automatic reconnection.
(erc-process-input-line): Ensure user input marks the end of the
reconnect-display period.
(erc-cmd-JOIN): Don't bother resetting
`erc--server-last-reconnect-count' because it's now handled by its
sometime caller, `erc-process-input-line'.
(erc-connection-established): Schedule timer and register hook to
reset last-reconnect count and terminate the reconnect-display period.
* test/lisp/erc/erc-scenarios-base-buffer-display.el:
(erc-scenarios-base-buffer-display--reconnect-common): Add new args to
test fixture to allow for asserting display properties at various
stages throughout a session.
(erc-scenarios-base-reconnect-options--buffer,
erc-scenarios-base-buffer-display--defwin-recbury-intbuf): Rename
former to latter and rework to better reflect realistic settings
for the relevant display options.
(erc-scenarios-base-reconnect-options--default,
erc-scenarios-base-buffer-display--defwino-recbury-intbuf): Rename
former to latter and rework to be more realistic.
(erc-scenarios-base-buffer-display--count-reset-timeout): New
test for new option `erc-reconnect-display-timeout'.  (Bug#62833)

19 months agoExtend erc-interactive-display to cover /JOINs
F. Jason Park [Tue, 11 Apr 2023 00:58:05 +0000 (17:58 -0700)]
Extend erc-interactive-display to cover /JOINs

* lisp/erc/erc.el (erc-display): Mention that buffer-related display
options live in the customization group `erc-buffers'.
(erc-buffer-display, erc-join-buffer): Swap alias and aliased so that
the favored name, `erc-buffer-display', appears in the definition and
in the Customize menu.  Also note related buffer-display options in
the doc string.
(erc-query-display, erc-interactive-display): Make the former an alias
of the latter, new in ERC 5.6, because their roles were functionally
redundant and thus confusing.  Inherit the default value from
`erc-query-display' because users are more familiar with the pop-up
window behavior than a single-window replacement.
(erc-reconnect-display): Use preferred name for cross-referencing
fallback option `erc-buffer-display' in doc string, and explain how
/reconnect handling differs.
(erc--setup-buffer-hook): Add new internal hook for modules that
operate on windows and frames, such as erc-speedbar and
erc-status-sidebar.
(erc-open): Run `erc--setup-buffer-hook' after `erc-setup-buffer' so
hook members know their code isn't tied to `erc-setup-buffer' itself,
which may be used in other contexts, but rather to a new ERC buffer on
which some display-related action has just been performed.
(erc--called-as-input-p): New variable for "slash" commands, like
`erc-cmd-FOO', to detect whether they're being called "interactively"
as a result of input given at ERC's prompt.
(erc-process-input-line): Bind `erc--called-as-input-p' when running
slash commands.
(erc-cmd-JOIN): When called interactively, schedule a callback to wrap
the response handler and control how new buffers are thus displayed.
(erc-cmd-QUERY): Use preferred alias for `erc-query-display'.
* test/lisp/erc/erc-scenarios-base-buffer-display.el:
(erc-scenarios-base-buffer-display--interactive-default): New test.
* test/lisp/erc/erc-tests.el (erc-process-input-line,
erc-select-read-args, erc-tls, erc--interactive): Change expected
default value of `erc-interactive-display' from `buffer' to
`window'.  (Bug#62833)

19 months agoMove ERC's buffer-display tests to separate file
F. Jason Park [Fri, 21 Apr 2023 02:23:54 +0000 (19:23 -0700)]
Move ERC's buffer-display tests to separate file

* test/lisp/erc/erc-scenarios-base-buffer-display.el: New file.
* test/lisp/erc/erc-scenarios-base-reconnect.el
(erc-scenarios-common--base-reconnect-options,
erc-scenarios-base-reconnect-options--buffer,
erc-scenarios-base-reconnect-options--default): Move to new file and
rename.  (Bug#62833)
* test/lisp/erc/resources/erc-d/erc-d-tests.el (erc-d-run-linger):
Lengthen timeout.
* test/lisp/erc/resources/erc-d/erc-d.el (erc-d--m): Ensure buffer is
live before inserting.

19 months agoRevive option erc-query-on-unjoined-chan-privmsg
F. Jason Park [Thu, 13 Apr 2023 07:00:02 +0000 (00:00 -0700)]
Revive option erc-query-on-unjoined-chan-privmsg

* etc/ERC-NEWS: Mention reinstated and renamed legacy option
`erc-query-on-unjoined-chan-privmsg' as well as a change in behavior
for `erc-auto-query', when nil.  Also fix erroneous ChangeLog
reference in 5.5 section.
* lisp/erc/erc-backend.el (erc-server-PRIVMSG): Consider flag
`erc-receive-query-display-defer' and revived option
`erc-query-unjoined-chan-privmsg' when deciding whether to create a
new query buffer.  And only "open" a buffer for an unknown target when
the latter option is non-nil.
* lisp/erc/erc.el (erc-cmd-QUERY): Make error more informative.
(erc-query): Revise deprecation message.
(erc-auto-query, erc-receive-query-display): Swap alias and aliased
and add option to `erc-buffers' group.  Mention the nonstandard
meaning of nil and update package-version to signify a behavioral
change, even though the default value remains untouched.
(erc-receive-query-display-defer): Add new variable, a compatibility
switch to access legacy behavior for `erc-auto-query'.
(erc-query-on-unjoined-chan-privmsg,
erc-ensure-target-buffer-on-privmsg): Revise doc string and add alias.
Change package-version to ERC 5.6 due to slightly refined meaning.
* test/lisp/erc/erc-scenarios-base-attach.el: New file.
* test/lisp/erc/resources/base/channel-buffer-revival/reattach.eld:
New file.  (Bug#62833)

19 months agoMake old-struct test more robust
Mattias Engdegård [Thu, 4 May 2023 15:47:05 +0000 (17:47 +0200)]
Make old-struct test more robust

* test/lisp/emacs-lisp/cl-lib-tests.el (old-struct):
Use the `vector` constructor instead of vector literals to
avoid failing because of `type-of` constant-folding.

19 months agoConstant-propagate cons and vector literals
Mattias Engdegård [Thu, 4 May 2023 15:37:17 +0000 (17:37 +0200)]
Constant-propagate cons and vector literals

* lisp/emacs-lisp/byte-opt.el (byte-optimize--substitutable-p):
Allow quoted lists and conses, and vector literals, to be substituted
from lexical variables.  This can eliminate variable bindings and
create new constant folding opportunities.

19 months agoRemove useless handling of erroneous code in Lisp optimiser
Mattias Engdegård [Thu, 4 May 2023 15:31:15 +0000 (17:31 +0200)]
Remove useless handling of erroneous code in Lisp optimiser

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
((closure ...) ...) is a malformed function call; treat it as such.
Better malformed function warning location.

19 months agoDon't inline funcall to literal lambda form
Mattias Engdegård [Thu, 4 May 2023 15:28:08 +0000 (17:28 +0200)]
Don't inline funcall to literal lambda form

* lisp/emacs-lisp/byte-opt.el (byte-optimize-funcall): Don't convert

  (funcall '(lambda ...) ...) -> ((lambda ...) ...)

because that would inline what is essentially an `eval` of a
function using dynamic binding rules into lexbound code.

19 months agoFido-mode: never shadow 'external' completion style
João Távora [Fri, 5 May 2023 18:44:11 +0000 (19:44 +0100)]
Fido-mode: never shadow 'external' completion style

As explained in the manual (20.7.2 Fast minibuffer selection)
'fido-mode' and 'fido-vertical-mode' give priority the "flex"
completion style.

In fact, bug#62015 was recently fixed in commit because that priority
was not taking place correctly and some completions were missed.

However, an exception must be made for the 'external' completion
style.

That style, made available by the lisp/external-completion.el library,
is specifically designed to work with backends that provide only a
partial view of all completions.  If we allow 'flex' to step in front
of 'external' it could mean that 'flex' matches something and
'external' isn't triggered as it probably should.

To reproduce have the rust-mode ELPA package and the rust-analyzer LSP
server handy.  Then:

  emacs -Q -f package-initialize main.rs

Where main.rs is this content:

  fn foo1()    {} fn foo2()    {} fn foo3() {}
  fn foobar1() {} fn foobar2() {} fn foobar3() {}

The rust-analyzer server can be quickly configured to return only 3
workspace symbols max, so evaluate:

  (setq-default eglot-workspace-configuration
                '(:rust-analyzer
                    (:workspace (:symbol (:search (:limit 3))))))

Now start M-x eglot and M-x fido-vertical-mode and type C-u M-. to
find an arbitrary symbol in this one-file project.

Type 'f'.  You will see the three foo's are listed, correctly.

Now type '3'.   You will only see "foo3".

But that's wrong because "foobar3" was available, if only the server
had been asked for it.  This commit fixes the situation and no
completions are lost.

As an unfortunate side-effect of this commit, the fontification of
completions-common-part on the matches is lost, but that is not worse
than missing out on completions and there are better ways to recover
the fontification anyway (in external-completion.el).

See also:
https://github.com/joaotavora/eglot/discussions/1219#discussioncomment-5818336

* lisp/icomplete.el (icomplete--fido-ccd): Do not touch entries
with 'external in them.

19 months agoImprove ange-ftp-file-remote-p
Michael Albinus [Fri, 5 May 2023 17:39:22 +0000 (19:39 +0200)]
Improve ange-ftp-file-remote-p

* lisp/net/ange-ftp.el (ange-ftp-file-remote-p): Handle hop
identification.

19 months agoFix dired and tramp where `ls` does not have the `-N` option
Mattias Engdegård [Fri, 5 May 2023 17:19:51 +0000 (19:19 +0200)]
Fix dired and tramp where `ls` does not have the `-N` option

This includes BSD ls, also used by macOS (bug#63142).

* lisp/dired.el (dired-insert-directory):
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
Test whether -N is understood by ls since that option is used along
with --dired.  Remove -N when we remove --dired.

19 months agoEglot: re-rename eglot-upgrade to eglot-upgrade-eglot
João Távora [Fri, 5 May 2023 13:51:09 +0000 (14:51 +0100)]
Eglot: re-rename eglot-upgrade to eglot-upgrade-eglot

* doc/misc/eglot.texi (Getting the latest version): Mention
eglot-upgrade-eglot.

* etc/EGLOT-NEWS: Mention eglot-upgrade-eglot.

* lisp/progmodes/eglot.el (eglot-upgrade-eglot): Rename from
eglot-update.
(eglot-update): New compatibility alias.

19 months agoFix arguments of xml.c functions as displayed in Help buffers
Eli Zaretskii [Fri, 5 May 2023 07:08:59 +0000 (10:08 +0300)]
Fix arguments of xml.c functions as displayed in Help buffers

* lisp/subr.el (libxml-parse-xml-region)
(libxml-parse-html-region): Adjust advertised-calling-convention
to the changes in commit cc33c6cf3a.  (Bug#63291)

19 months agoMore fixes for NetBSD/vax
Po Lu [Fri, 5 May 2023 06:13:37 +0000 (14:13 +0800)]
More fixes for NetBSD/vax

* src/sysdep.c (init_signals) [__vax__]: Treat SIGILL
as a floating point error on VAXen.
Otherwise, (log 0.0) crashes Emacs.

19 months agoImprove VHDL mode highlighting
Cyril Arnould [Wed, 3 May 2023 19:40:18 +0000 (19:40 +0000)]
Improve VHDL mode highlighting

* lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist): Differentiate
between ModelSim errors, warnings, and notes when highlighting
them.  Add a new entry for Xilinx Vivado.  (Bug#63251)

Copyright-paperwork-exempt: yes

19 months ago; Use a Bourne shell-compatible form for command substitution
Jim Porter [Fri, 5 May 2023 05:43:13 +0000 (22:43 -0700)]
; Use a Bourne shell-compatible form for command substitution

* build-aux/git-hooks/post-commit:
* build-aux/git-hooks/pre-push: Use `` instead of $().

19 months ago; Allow spaces in directory names for Git hooks
Jim Porter [Fri, 5 May 2023 04:04:46 +0000 (21:04 -0700)]
; Allow spaces in directory names for Git hooks

* build-aux/git-hooks/post-commit:
* build-aux/git-hooks/pre-push: Quote "$HOOKS_DIR" to allow spaces.

19 months agoMake vc-hg-annotate-command async
Spencer Baugh [Thu, 27 Apr 2023 16:11:45 +0000 (12:11 -0400)]
Make vc-hg-annotate-command async

There's no benefit in this running the process synchrounously, and
it's annoying for it to block the Emacs UI.

* lisp/vc/vc-hg.el (vc-hg-annotate-command):
Run asynchronously (bug#63123).

19 months agoSuspend timers when reading Tramp process output
Michael Albinus [Thu, 4 May 2023 18:42:24 +0000 (20:42 +0200)]
Suspend timers when reading Tramp process output

* lisp/net/tramp-compat.el (xdg): Require.
(tramp-compat-temporary-file-directory): Set it to
$XDG_CACHE_HOME/emacs if possible.

* lisp/net/tramp.el (tramp-debug-to-file): Fix docstring.
(tramp-wrong-passwd-regexp): Add "Authentication failed" string
(from doas).
(tramp-debug-message): Simplify backtrace check.
(with-tramp-locked-connection): Suppress timers.  (Bug#49954, Bug60534)

* test/lisp/net/tramp-tests.el (tramp-test09-insert-file-contents):
Adapt test.
(tramp-test45-asynchronous-requests): Remove :unstable tag.
Adapt test.

19 months ago; Fix post-commit and pre-push hooks in worktrees again
Jim Porter [Thu, 4 May 2023 16:22:40 +0000 (09:22 -0700)]
; Fix post-commit and pre-push hooks in worktrees again

* build-aux/git-hooks/post-commit:
* build-aux/git-hooks/pre-push: Use "$(dirname $0)" to get the hooks
directory.

19 months agoClarify documentation wrt floating point division by zero and NaN
Po Lu [Thu, 4 May 2023 14:08:44 +0000 (22:08 +0800)]
Clarify documentation wrt floating point division by zero and NaN

* doc/lispref/numbers.texi (Float Basics)
(Arithmetic Operations): Document what happens on a VAX.
Tested on NetBSD 9.3.

19 months agoMake loaddefs-generate slightly more tolerant
Robert Pluim [Thu, 4 May 2023 12:07:08 +0000 (14:07 +0200)]
Make loaddefs-generate slightly more tolerant

There are packages in the wild, such as vlf-20191126.2250, which have
entries that are not terminated by three ';', but by two.  Tolerate
such entries.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Search for two
';' as a delimiter, not three.  (Bug#63236)

19 months ago; Minor doc cleanups in go-ts-mode.el
Eli Zaretskii [Thu, 4 May 2023 13:37:39 +0000 (16:37 +0300)]
; Minor doc cleanups in go-ts-mode.el

* lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p)
(go-ts-mode--other-type-node-p, go-mod-ts-mode--in-directive-p):
Doc fixes.

19 months ago; Minor grammar fix in treesit manual.
Basil L. Contovounesios [Thu, 4 May 2023 10:16:57 +0000 (12:16 +0200)]
; Minor grammar fix in treesit manual.

19 months agoFix order of rcirc-connect arguments
Philip Kaludercic [Mon, 1 May 2023 11:53:52 +0000 (13:53 +0200)]
Fix order of rcirc-connect arguments

* lisp/net/rcirc.el (rcirc): Pass SERVER-ALIAS before CLIENT-CERT.
(rcirc-connect): Take SERVER-ALIAS before CLIENT-CERT.

This is necessary for the 'rcirc-reconnect' trick to work that applies
the contents of 'rcirc-connection-info' to 'rcirc-connect', otherwise
the server alias gets lost as certfp information.

This addresses a change made in b79cb838a477ee5a5c3660e81264991ff833a82f.

19 months agoFix rcirc messages printing in the wrong place
Thuna [Wed, 23 Nov 2022 03:14:36 +0000 (04:14 +0100)]
Fix rcirc messages printing in the wrong place

* lisp/net/rcirc.el (rcirc-send-message): Print the message before
sending it to the server.
(rcirc-print): Get the time with subsecond precision.
* lisp/calendar/parse-time.el (parse-time-string
parse-iso8601-time-string): Accept optional second FORM arguments,
with the same meaning as in `decode-time'.  Mention as such in the
docstring.  (Bug#59501)

Copyright-paperwork-exempt: yes

19 months agoPrevent unnecessary modifications of 'package-vc-selected-packages'
Philip Kaludercic [Sun, 30 Apr 2023 18:21:04 +0000 (20:21 +0200)]
Prevent unnecessary modifications of 'package-vc-selected-packages'

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Handle the
structure of correctly, not as an alist but a list of alists.
(package-vc--archive-spec-alist, package-vc--archive-spec-alists,
package-vc--desc->spec, package-vc--read-archive-data,
package-vc--download-and-read-archives, package-vc--unpack): Rename
'package-vc--archive-spec-alist' to 'package-vc--archive-spec-alists'.

19 months agoRename eglot-update to eglot-upgrade
Dmitry Gutov [Wed, 3 May 2023 22:39:15 +0000 (01:39 +0300)]
Rename eglot-update to eglot-upgrade

* doc/misc/eglot.texi (Getting the latest version):
Update the reference.

* lisp/progmodes/eglot.el (eglot-upgrade): Rename from
'eglot-update', as discussed on emacs-devel, in line with
'package-upgrade'.

19 months agogo-ts-mode: Use iota query only if supported (Bug#63086)
Randy Taylor [Wed, 26 Apr 2023 15:15:45 +0000 (11:15 -0400)]
go-ts-mode: Use iota query only if supported (Bug#63086)

iota query support was added on January 5, 2022.  To support older
versions of the tree-sitter-go grammar (like the latest tagged version,
v0.19.1, which was released on March 3, 2021), check if the query is
supported before trying to use it.

* lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p): New
function.
(go-ts-mode--font-lock-settings): Use it.

19 months ago(rng-complete-tag): Add the (ignored) argument to the :company-kind function
Dmitry Gutov [Wed, 3 May 2023 20:58:27 +0000 (23:58 +0300)]
(rng-complete-tag): Add the (ignored) argument to the :company-kind function

* lisp/nxml/rng-nxml.el (rng-complete-tag): Add the (ignored)
argument to the :company-kind function.  Fixes the "Wrong number
of arguments" error reported at
https://github.com/company-mode/company-mode/issues/1386.

19 months ago* lisp/emacs-lisp/package.el (package-buffer-info): Fix thinko
Stefan Monnier [Wed, 3 May 2023 17:18:08 +0000 (13:18 -0400)]
* lisp/emacs-lisp/package.el (package-buffer-info): Fix thinko

19 months agoUpdate to Transient v0.3.7-219-g3ded15b
Jonas Bernoulli [Wed, 3 May 2023 13:02:31 +0000 (15:02 +0200)]
Update to Transient v0.3.7-219-g3ded15b

19 months agoFix inserting selection data into Mozilla programs
Po Lu [Wed, 3 May 2023 12:02:01 +0000 (20:02 +0800)]
Fix inserting selection data into Mozilla programs

* lisp/select.el (xselect-convert-to-text-uri-list): Don't
return any value when converting non-DND selections to this
drag-and-drop target.

Reported by Tobias Bading <tbading@web.de>.

19 months agoRecognize defstruct slot names in various eieio functions
Thuna [Wed, 19 Apr 2023 21:43:22 +0000 (23:43 +0200)]
Recognize defstruct slot names in various eieio functions

* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Set
each slot's name's 'slot-name' property so that
'eieio--known-slot-name-p' can recognize them.  (Bug#62959)

Copyright-paperwork-exempt: yes

19 months agoTramp code cleanup
Michael Albinus [Wed, 3 May 2023 11:26:35 +0000 (13:26 +0200)]
Tramp code cleanup

* doc/lispref/files.texi (Magic File Names): Order alphabetically.

* lisp/net/tramp.el (tramp-file-name-for-operation):
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Order alphabetically.

* lisp/net/tramp.el (tramp-handle-file-user-uid)
(tramp-handle-file-group-gid, tramp-read-id-output):
* lisp/net/tramp-archive.el (tramp-archive-handle-file-group-gid):
(tramp-archive-handle-file-user-uid): Fix docstring.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test44-user-group-ids): Fix docstring.

19 months ago; * lisp/dired.el (dired-insert-directory): Fix a typo in a comment.
Eli Zaretskii [Wed, 3 May 2023 11:15:42 +0000 (14:15 +0300)]
; * lisp/dired.el (dired-insert-directory): Fix a typo in a comment.

19 months agoFontify "extern foo ();" correctly inside a function
Alan Mackenzie [Wed, 3 May 2023 10:01:14 +0000 (10:01 +0000)]
Fontify "extern foo ();" correctly inside a function

This fixes bug#63224.

* lisp/progmodes/cc-engine.el (c-forward-type): Handle the "("
as a special case by trying to parse it with
c-forward-declarator and accepting it as a typeless function
when that fails.

19 months ago; * lisp/simple.el (blink-matching-open): retain props in bootstrap
Mattias Engdegård [Wed, 3 May 2023 09:09:37 +0000 (11:09 +0200)]
; * lisp/simple.el (blink-matching-open): retain props in bootstrap