Eli Zaretskii [Wed, 16 Aug 2023 17:42:16 +0000 (20:42 +0300)]
Fix horizontal scrolling of images with C-f
* lisp/image-mode.el (image-forward-hscroll): Calculate the
window-width more accurately, as the number of full columns that
fits in the window's text-area. (Bug#65187)
J M [Thu, 10 Aug 2023 22:23:20 +0000 (23:23 +0100)]
Update csharp tree-sitter support due to upstream changes
A change in tree-sitter-c-sharp grammar for csharp (commit
18a531), has removed the keyword void_keyword and advised
we should use predefined_type.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Support both old and new style of keywords in tree-sitter-c-sharp
grammar. (Bug#65113)
Matthew Tromp [Thu, 10 Aug 2023 14:41:24 +0000 (10:41 -0400)]
Substitute command keys in 'ielm-header' at use time
Before, command keys were substituted into the ielm-header when
ielm.el was loaded, which resulted in the substitutions depending on
the user's current buffer instead of the ielm buffer.
For example, if the user was in an info-mode buffer, the key would
appear as 'H' instead of 'C-h m'.
Now, the command key is substituted after the ielm buffer has been
created.
* lisp/ielm.el (ielm-header): Remove substitute-command-keys.
(inferior-emacs-lisp-mode): Add substitute-command-keys. (Bug#65213)
Eli Zaretskii [Sat, 12 Aug 2023 06:38:28 +0000 (09:38 +0300)]
Fix rare crashes in redisplay due to problems with fontsets
* src/xdisp.c (get_next_display_element): If we have no usable
face to display a character/composition, treat that as glyphless.
(produce_glyphless_glyph): If neither it->face nor its ASCII face
are usable, fall back to the frame's default font. (Bug#65198)
dannyfreeman [Mon, 7 Aug 2023 19:55:27 +0000 (15:55 -0400)]
Properly expand the JSX indentation rules in 'js-ts-mode'
* lisp/progmodes/js.el (js--treesit-indent-rules): Fix
'js-ts-mode' indent bug in JSX expressions. Before this
change, treesit indent mechanisms were trying to call this
compatibility function like a matching or anchor rule.
This resulted in an error when running `indent-for-tab-command`
while the cursor was in a JSX expression:
treesit--simple-indent-eval: Wrong number of
arguments: ((cl-struct-js--pitem-tags ido-cur-list t) nil "Indent rules
helper, to handle different releases of tree-sitter-javascript."
Eli Zaretskii [Thu, 10 Aug 2023 07:50:35 +0000 (10:50 +0300)]
Fix the -x switch in non-X builds
* src/emacs.c (main): Move the handling of the -x switch out of
the HAVE_X_WINDOWS condition, and simplify the rest of the code by
avoiding code duplication in HAVE_X_WINDOWS and !HAVE_X_WINDOWS
cases. (Bug#65048)
Eli Zaretskii [Thu, 10 Aug 2023 06:06:05 +0000 (09:06 +0300)]
Fix the effects and documentation of 'dired-free-space'
* lisp/dired.el (dired-free-space): Fix doc string and Custom tags.
(dired--insert-disk-space): When 'dired-free-space' is 'separate',
return the position of the beginning of the disk-space line, to be
compatible with pre-Emacs 29 behavior under
'dired-hide-details-mode'. (Bug#65186)
* doc/emacs/dired.texi (Misc Dired Features): Fix wording in
documentation of 'dired-free-space'.
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Don't use
`byte+native-compile' to select output directory but always axpect
it explicit through `native-compile-target-directory'.
(batch-byte+native-compile): Set `native-compile-target-directory'.
* test/src/comp-tests.el (comp-tests-bootstrap): Set
`native-compile-target-directory'.
Eli Zaretskii [Sun, 6 Aug 2023 06:33:44 +0000 (09:33 +0300)]
Fix reverting Rmail buffers
This bug happened because rmail.el relied on 'revert-buffer' to
return non-nil when it succeeds to revert, but a recent change
in 'revert-buffer' broke that promise in Emacs 29.1.
* lisp/files.el (revert-buffer--default, revert-buffer): Doc fix.
(revert-buffer): Return whatever 'revert-buffer-function' returns.
(Bug#65071)
Michael Albinus [Sat, 5 Aug 2023 16:07:58 +0000 (18:07 +0200)]
Sync with Tramp 2.6.2-pre
* doc/misc/tramp.texi (Overview): Use "scp" in example.
(Obtaining @value{tramp}): Prefer https: to git: URIs on Savannah.
(Ssh setup): Extend for MS Windows and ssh. Explain
tramp-use-ssh-controlmaster-options value `suppress'.
(File name completion): Remove completion styles restrictions.
(Ad-hoc multi-hops): Describe tramp-show-ad-hoc-proxies.
(Remote processes): Add reference to "Using ssh connection sharing".
* doc/misc/trampver.texi:
* lisp/net/trampver.el (tramp-version): Set to "2.6.2-pre".
* lisp/net/tramp.el (tramp-accept-process-output): Don't use TIMEOUT
anymore, default it to 0. When the connection uses a shared
socket possibly, accept also the output from other processes over
the same connection. (Bug#61350)
(tramp-handle-file-notify-rm-watch, tramp-action-process-alive)
(tramp-action-out-of-band, tramp-process-one-action)
(tramp-interrupt-process):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
* lisp/net/tramp-smb.el (tramp-smb-action-get-acl)
(tramp-smb-action-set-acl, tramp-smb-wait-for-output):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-action-sudo): Adapt callees.
* lisp/net/tramp.el (tramp-skeleton-file-exists-p): New defmacro,
which also handles host name completion.
(tramp-handle-file-exists-p):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-exists-p):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-exists-p):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-exists-p): Use it.
* lisp/net/tramp-container.el (tramp-container--completion-function):
Rename from `tramp-docker--completion-function'. Add argument
PROGRAM. Use it for "docker" and "podman" host name completion.
* lisp/net/tramp-crypt.el (tramp-crypt-handle-file-exists-p):
New defun.
(tramp-crypt-file-name-handler-alist): Add it.
* lisp/net/tramp-fuse.el (tramp-fuse-handle-file-exists-p): New defun.
(tramp-fuse-mount-timeout): Move up.
(tramp-fuse-mount-point): Use `tramp-fuse-mount-timeout'.
(tramp-fuse-unmount): Flush "mount-point" file property.
(tramp-fuse-mount-point, tramp-fuse-mounted-p): Support existing
mount points.
(tramp-fuse-mounted-p): The mount-spec could contain an optional
trailing slash. (Bug#64278)
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file)
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file):
Improve stability for WebDAV.
(tramp-rclone-handle-file-system-info): Check return code of
command.
* lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp)
(tramp-device-escape-sequence-regexp): Delete.
(tramp-sh-handle-insert-directory, tramp-barf-if-no-shell-prompt)
(tramp-wait-for-output): Use `ansi-color-control-seq-regexp'.
(tramp-use-ssh-controlmaster-options): Allow new value `suppress'.
(tramp-ssh-option-exists-p): New defun.
(tramp-ssh-controlmaster-options): Implement `suppress' actions.
Should never return nil, but empty string.
(tramp-perl-file-name-all-completions): Don't print status message.
(tramp-sh-handle-file-name-all-completions): Return nil when check
fails. (Bug#61890)
(tramp-run-test): Add VEC argument.
(tramp-sh-handle-file-executable-p)
(tramp-sh-handle-file-readable-p)
(tramp-sh-handle-file-directory-p)
(tramp-sh-handle-file-writable-p): Adapt callees.
(tramp-sh-handle-insert-directory):
(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. (Bug#63142)
(tramp-sh-handle-insert-directory, tramp-barf-if-no-shell-prompt)
(tramp-wait-for-output): Use `ansi-color-control-seq-regexp'.
(tramp-sh-handle-expand-file-name): `null-device' could be nil.
Reported by Richard Copley <rcopley@gmail.com>.
(tramp-sh-handle-make-process): Improve handling of
connection-type `pipe'. (Bug#61341)
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Use `tramp-fuse-handle-file-exists-p'.
(tramp-sshfs-handle-insert-file-contents): Move result out of
unwindform.
* lisp/net/tramp.el (tramp-string-empty-or-nil-p): New defsubst.
Use it everywhere when appropriate.
* lisp/net/tramp.el (tramp-methods) <->: Add.
(tramp-completion-file-name-handler-alist):
Add `expand-file-name', `file-exists-p', `file-name-directory' and
`file-name-nondirectory'.
(tramp-dissect-file-name): Do not extra check for
`tramp-default-method-marker'.
(tramp-completion-handle-expand-file-name)
(tramp-completion-handle-file-exists-p)
(tramp-completion-handle-file-name-directory)
(tramp-completion-handle-file-name-nondirectory): New defuns.
(tramp-completion-handle-file-name-all-completions): Remove duplicates.
(tramp-show-ad-hoc-proxies): New defcustom.
(tramp-make-tramp-file-name): Use it.
(tramp-make-tramp-hop-name): Don't add hop twice.
(tramp-shell-prompt-pattern): Remove escape characters.
(tramp-process-one-action, tramp-convert-file-attributes):
Use `ansi-color-control-seq-regexp'. (Bug#63539)
(tramp-wrong-passwd-regexp): Add "Authentication failed" string
(from doas).
(tramp-terminal-type): Fix docstring.
(tramp-process-one-action): Delete ANSI control escape sequences
in buffer. (Bug#63539)
(tramp-build-completion-file-name-regexp): Support user name
completion.
(tramp-make-tramp-file-name): Keep hop while in file
(tramp-set-completion-function): Check, that cdr of FUNCTION-LIST
entries is a string.
(tramp-completion-file-name-handler): Run only when
`minibuffer-completing-file-name' is non-nil.
(tramp-skeleton-write-region): Fix scoping. (Bug#65022)
(tramp-handle-memory-info): Work on newly created objects, or use
non-destructive operations.
(tramp-accept-process-output): Use `with-local-quit'.
(tramp-call-process, tramp-call-process-region):
Let-bind `temporary-file-directory'.
Jim Porter [Fri, 4 Aug 2023 16:31:59 +0000 (09:31 -0700)]
Fix loaddef generation with ";;;foo-autoload" cookies in external packages
This caused an issue where package-specific autoload cookies weren't
being correctly recognized, so they got dumped into the package's main
"<pkg>-autoloads.el" file, instead of "<pkg>-loaddefs.el" as they
should (bug#65023).
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Save match data when checking syntax.
Stefan Kangas [Fri, 4 Aug 2023 10:25:15 +0000 (12:25 +0200)]
Delete comment saying that project.el is experimental
* lisp/progmodes/project.el (Commentary): Delete comment saying that
the API is "still experimental". It is to be considered stable
starting with the version released with Emacs 29.
Ref: https://lists.gnu.org/r/emacs-devel/2023-07/msg00415.html
Eli Zaretskii [Fri, 4 Aug 2023 06:34:55 +0000 (09:34 +0300)]
Fix "Paste from Kill Menu" in non X toolkit builds
* src/keymap.c (possibly_translate_key_sequence): Don't signal an
error if 'key-valid-p' returns nil. Suggested by Stefan Monnier
<monnier@iro.umontreal.ca>. (Bug#64927)
Eli Zaretskii [Mon, 31 Jul 2023 18:50:45 +0000 (21:50 +0300)]
Fix 'string-pixel-width' under 'line-prefix'
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Disable
'line-prefix' and 'wrap-prefix' to avoid their effect on the
calculated string width. (Bug#64971)
; Fix backport of help-fns--analyze-function bug fix
* lisp/help-fns.el (help-fns--analyze-function):
Add back the NOERROR argument to function-alias-p, needed because
Emacs 29 doesn't prevent the creation of circular function aliases.
This fixes a failure in help-fns-tests.
(rx (in (?^ . ?a))) was incorrectly translated to "[^-a]".
Change it so that we get "[_-a^]" instead.
* lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with
`^` occurring first in a non-negated character alternative.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests.
This was originally installed on 2023-06-17 in the emacs-29 release
branch and later reverted. This backport follows the Emacs 29.1
release (bug#64019).
The shy groups were caught by modified versions of the GNU ELPA
packages xr and relint:
- https://github.com/mattiase/xr/pull/6
- https://github.com/mattiase/relint/pull/14
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special
character in regexp.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings):
* lisp/progmodes/js.el (js--plain-method-re):
(js--treesit-font-lock-settings):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Replace character
alternative [\\d], which matches '\' or 'd', with the most likely
intention [0-9]. Fix shy groups mistyped as optional colons.
Remove unneeded numbered :match group in rust-ts-mode.
Eli Zaretskii [Sun, 30 Jul 2023 15:05:00 +0000 (11:05 -0400)]
; Fix admin/upload-manuals script
* admin/upload-manuals (html_mono): Chdir to the right directory
before committing.
(html_node): Avoid computing $stale in newly-created or empty
directories.
* lisp/help-fns.el (help-fns--analyze-function):
For aliases, use the base function name if at the end of the chain.
This fixes a regression introduced in d30fde6b0cc.
Update CMake support due to upstream changes (bug#64922)
A recent change in tree-sitter-cmake grammar support for CMake (commit fe9b5e0), now put arguments are wrapped in a new argument_list node.
To support the old and new version of the grammar, a new function was
added on which string syntax highlighting now depends.
* lisp/progmodes/cmake-ts-mode.el
(cmake-ts-mode--font-lock-compatibility-fe9b5e0): Indent helper
function to handle different tree-sitter-cmake version.
* lisp/progmodes/cmake-ts-mode.el
(cmake-ts-mode--font-lock-settings): Use the new function to handle
the new argument_list node.
Remove nullptr named node from c++-ts-mode (bug#64818)
The nullptr node was changed from a named node to an unnamed node
upstream[0], which caused font locking to break. As this is a small
enough regression, no compat code is required.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Remove
node no longer in use.
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts-mode--font-lock-compatibility-bb1f97b):
Add argument so that we run the 'treesit-query-capture' when the
language is 'typescript', not only 'tsx'.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Use supplied argument.