Stefan Kangas [Tue, 1 Aug 2023 10:18:12 +0000 (12:18 +0200)]
Fix font locking of booleans in conf-toml-mode
* lisp/textmodes/conf-mode.el (conf-toml-mode): Do not use case
folding when font locking.
* test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode):
Expand test.
* test/lisp/textmodes/conf-mode-tests.el (conf-test-javaprop-mode):
Attempt to give the test some meaning by repairing regexps,
and fixing it so that it passes.
Stefan Kangas [Tue, 1 Aug 2023 07:55:01 +0000 (09:55 +0200)]
Remove IE9 support tag from HTML5 skeleton
This is no longer recommended in 2023, and in any case seems like
overkill in an otherwise bare-bones HTML5 template.
Ref: https://stackoverflow.com/a/6771584
Michael Albinus [Mon, 31 Jul 2023 17:40:11 +0000 (19:40 +0200)]
Optimizations on Tramp symlink handling
* lisp/net/tramp-sh.el (cl-seq): Require.
(tramp-perl-file-truename): Print also whether the file is a symlink.
(tramp-bundle-read-file-names): Rename from
`tramp-vc-registered-read-file-names'. Print also the
`file-directory-p: value.
(tramp-sh-handle-make-symbolic-link): Combine two commands. Use
`tramp-skeleton-make-symbolic-link'.
(tramp-sh-handle-file-truename): Read also "file-symlink-marker"
property.
(tramp-sh-handle-file-directory-p): Simplify if-let clause.
(tramp-sh-handle-file-name-all-completions): Simplify command.
(tramp-bundle-read-file-names): New defun.
(tramp-sh-handle-vc-registered, tramp-get-remote-path): Use it.
(tramp-open-shell): Flush "scripts" connection property.
(tramp-open-connection-setup-interactive-shell): Combine two commands.
* lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-make-symbolic-link):
Use `tramp-skeleton-make-symbolic-link'.
* lisp/language/vietnamese.el (vietnamese-vscii): Update docstring.
(vietnamese-tcvn, tcvn, tcvn-5712): Make them aliases of
vietnamese-vscii.
("Vietnamese"): Drop vietnamese-tcvn from coding-system values.
Update docstring.
Eli Zaretskii [Mon, 31 Jul 2023 15:11:23 +0000 (11:11 -0400)]
; Merge from origin/emacs-29
The following commits were skipped:
0002d4f3166 Avoid spurious whitespace in the modeline of emacsclient ... 96d52f89444 Fix function help for advised aliases (bug#64797) 71419a60c37 Avoid crashes due to invalid 'mode-line-format' b2cb6e82160 ; Better documentation of HOME on MS-Windows 54e98b5f9bd ; Clarify documentation of 'server-after-make-frame-hook' d13029cdcde Avoid crashes under 'which-key-mode' cb1f7db2490 ; Minor documentation fixes 4a687bcc20d Bump Emacs version
Eli Zaretskii [Mon, 31 Jul 2023 15:11:23 +0000 (11:11 -0400)]
Merge from origin/emacs-29
a9b28224af0 ; Last-minute changes befor releasing 29.1 7da1cee56b3 Update CMake support due to upstream changes (bug#64922) c2d95dd00e6 Remove nullptr named node from c++-ts-mode (bug#64818) 4e977136d31 Make compat check also check typescript 906ecf442c4 ; * etc/HISTORY: Fix the 28.3 entry.
Eli Zaretskii [Mon, 31 Jul 2023 15:11:21 +0000 (11:11 -0400)]
Merge from origin/emacs-29
ee20b50dfed ; * lisp/progmodes/typescript-ts-mode.el (treesit-query-c... 2215298d90b Update JSX support due to upstream changes (bug#64647) 235561a2ccc Update TSX support due to upstream changes (bug#64647) 12ab82d3b35 ; Fix customization form of 'bookmark-watch-bookmark-file' d149a4dc428 ; Improve documentation of automatic addition to minibuff... 42a99627948 ; Improve documentation of 'last-command-event' 101455cb853 ; * lisp/subr.el (ignore, always): Doc fixes. (Bug#64776)
; 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.
* etc/themes/deeper-blue-theme.el (class):
* etc/themes/leuven-dark-theme.el (class):
* etc/themes/leuven-theme.el (class):
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/whiteboard-theme.el (class):
Use `unspecified` instead of `nil` as attribute for :background and
:foreground to silence HANDLE_INVALID_NIL_VALUE warning.
(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.
(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.
Allow default values in 'map-let' and the pcase 'map' form
* lisp/emacs-lisp/map.el (map-let, map)
(map--make-pcase-bindings): Add a third argument for specifying a
default value, like in 'map-elt'. (Bug#49407)
* lisp/emacs-lisp/map.el (map--make-pcase-bindings): Clarify that keys
that aren't found aren't ignored, they actually get the value
nil (unless the new default value is given). The overall pattern can
still fail to match if the sub-pattern for the unfound key doesn't
match nil.
* test/lisp/emacs-lisp/map-tests.el (test-map-let-default)
(test-map-plist-pcase-default, test-map-pcase-matches): Add tests,
including for the above item.
* lisp/net/tramp-message.el (tramp-byte-run--set-suppress-trace):
New function. Add it to `defun-declarations-alist'.
(tramp-setup-debug-buffer, tramp-debug-buffer-name)
(tramp-get-debug-buffer, tramp-get-debug-file-name)
(tramp-trace-buffer-name, tramp-debug-message, tramp-message):
Add declare form.
(tramp-debug-buffer-name): Use `tramp-string-empty-or-nil-p'.
(tramp-test-message): New defun.
* 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.
F. Jason Park [Mon, 24 Jul 2023 06:09:42 +0000 (23:09 -0700)]
Simplify multi-frame behavior in erc-bufbar-mode
* lisp/erc/erc-status-sidebar.el (erc-status-sidebar-singular,
erc-status-sidebar--singular-p): Replace option new in ERC 5.6 with
the latter, an internal flag.
(erc-status-sidebar-get-window): Use new name for option turned
ordinary variable `erc-status-sidebar--singular-p'.
(erc-status-sidebar-close): Add comment.
(erc-status-sidebar--open): New function containing the old body of
`erc-status-sidebar-open'.
(erc-bufbar-mode, erc-bufbar-enable, erc-bufbar-disable): Update
variable names. Close sidebar window on all frames when disabling,
and don't set mode variable to nil when enabling. These may have made
some practical sense but were illogical. For example, it's confusing
to leave `erc-status-sidebar--open' in `erc--setup-buffer-hook' while
reporting the mode as being disabled.
(erc-status-sidebar-open): Move to slightly later in same file, after
defining `erc-bufbar-mode'. When `erc-bufbar-mode' is active, always
create a sidebar if needed, even when another frame is already
displaying one.
(erc-status-toggle-sidebar): When `erc-bufbar-mode' is disabled,
revert to pre-5.6 behavior. When the module is enabled, adopt new
behavior of ensuring the current frame shows a sidebar, even if
another frame already has one.
(erc-status-sidebar-refresh): Save and restore `window-start' in all
windows showing a sidebar buffer after refreshing. Update option and
variable names.
(erc-status-sidebar-refresh-triggers): Add doc string, noting that the
variable is set locally when the option
`erc-status-sidebar-highlight-active-buffer' is non-nil.
(erc-status-sidebar--highlight-refresh-triggers): New variable
containing additional triggers enabled when the option
`erc-status-highlight-active-buffer' is non-nil.
(erc-status-sidebar--refresh-unless-input): New function to run
`erc-status-sidebar-refresh' unless input is pending or the selected
window's buffer is a minibuffer.
(erc-status-sidebar--post-refresh): Call `erc-status-sidebar-refresh'
wrapper `erc-status-sidebar--refresh-unless-input' instead.
(erc-status-sidebar-set-window-preserve-size): Update var name to
`erc-status-sidebar--singular-p'.
(erc-status-sidebar-mode): Run `erc-status-sidebar--post-refresh' on
`window-selection-change-functions' globally when highlighting active
buffers. (bug#63595)
F. Jason Park [Sun, 23 Jul 2023 12:05:13 +0000 (05:05 -0700)]
; Add example buffer-display option to ERC's manual
* doc/misc/erc.texi: Add customization for `erc-interactive-display'
to Sample Configuration section.
* etc/ERC-NEWS: Improve various entries, like those for
`keep-place-indicator', `fill-wrap', `bufbar', etc.
F. Jason Park [Sat, 22 Jul 2023 21:07:38 +0000 (14:07 -0700)]
Fix CTCP ACTION regression in erc-fill-wrap
* lisp/erc/erc-fill.el (erc-fill--wrap-continued-message-p): Return
nil when current message is a CTCP ACTION. This fixes a regression
introduced by 63d8b2a59a4 "Make erc-fill-wrap work with left-sided
stamps".
* test/lisp/erc/erc-fill-tests.el: (erc-fill-wrap--merge-action):
New test.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: New
test data file. (Bug#60936)
* lisp/doc-view.el (doc-view-ghostscript-program)
(doc-view--revert-buffer, doc-view--pdf-outline): Compare
'shell-command' / 'call-process' return values with 'eql' instead of
'=' to cater for the situation where the process received a signal.
Make uniquify-tests work with out-of-tree builds and clean up
* test/lisp/uniquify-tests.el (uniquify-project-transform):
Set an explicit default-directory.
* test/lisp/uniquify-tests.el (uniquify-dirs): Remove temporary
directory after test.
Eli Zaretskii [Fri, 28 Jul 2023 06:31:25 +0000 (09:31 +0300)]
Fix userlock.el and filelock-tests in some rare cases
* lisp/userlock.el (userlock--check-content-unchanged): Don't
assume 'file-truename' of FILENAME is always non-nil. It could be
nil if we are called from a temporary buffer where some Lisp
program has forcibly set 'buffer-file-name'. (Bug#64821)
* test/src/filelock-tests.el (filelock-tests--fixture): Set
'buffer-file-name' to the true name of the temporary file.
Patch by Mattias Engdegård <mattias.engdegard@gmail.com>.
(filelock-tests-detect-external-change): Quote the file names
passed to shell commands.
* 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.
Better compilation of char-before, backward-char and backward-word
Implement char-before, backward-char and backward-word as compiler
macros instead of byte-compile handlers so that the source-level
optimiser gets to simplify the result. In particular, this removes
some branches.
Manuel Giraud [Sat, 25 Feb 2023 18:27:07 +0000 (19:27 +0100)]
New option 'image-dired-thumb-naming' (bug#61394)
* lisp/image/image-dired.el (image-dired-thumb-naming): New user
option to control thumbnail name.
* lisp/image/image-dired-util.el (image-dired-thumb-name): Update
to use new user option and compute contents SHA-1 if needed.
(image-dired-contents-sha1): New function to compute the SHA-1 of the
first 4KiB of a file.
Eli Zaretskii [Thu, 27 Jul 2023 08:36:00 +0000 (11:36 +0300)]
Support Posix-standard pax extended header in tar files
* lisp/tar-mode.el (pax-extended-attribute-record-regexp)
(tar-attr-vector): New variables.
(pax-gid-index, pax-gname-index, pax-linkpath-index)
(pax-mtime-index, pax-path-index, pax-size-index, pax-uid-index)
(pax-uname-index): New constants.
(pax-header-gid, pax-header-gname, pax-header-linkpath)
(pax-header-mtime, pax-header-path, pax-header-size)
(pax-header-uid, pax-header-uname): New accessors to pax header.
(pax-decode-string, tar-parse-pax-extended-header): New functions.
(tar-header-block-tokenize): Recognize and handle Posix-standard
pax extended header, and use its attributes instead of those in
the standard tar header. (Bug#64686)
Eli Zaretskii [Thu, 27 Jul 2023 07:28:43 +0000 (10:28 +0300)]
Fix image-dired-util-tests on MS-Windows
* test/lisp/image/image-dired-util-tests.el
(image-dired-thumb-name/image-dired)
(image-dired-thumb-name/per-directory): Make these tests work on
MS-Windows, where a file name such as "/foo/bar" gets added the
drive letter when passed through 'expand-file-name'.
* lisp/emacs-lisp/byte-opt.el (byte-opt--nary-comparison):
Fix a typo causing miscompilation of code such as (OP X),
where OP is <, >, <=, >= or =.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--test-cases): Add test case.
Produce synthetic backtrace entries for `aref` and `aset` byte-ops
when the index is non-fixnum, or is out of range for vector or record
arguments (bug#64613).
* src/bytecode.c (exec_byte_code): Detect type and range errors
in-line for aref and aset.
* src/data.c (syms_of_data): Declare symbols Qaref and Qaset.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--byte-op-error-cases): Add test cases.
By transforming the buffer's directory name, we can add
additional information to use during uniquifying. A basic
one: uniquifying buffer names based on the project name.
* lisp/progmodes/project.el (project-uniquify-dirname-transform): Add.
* lisp/uniquify.el (uniquify-dirname-transform-default)
(uniquify-dirname-transform): Add. (Bug#62621)
(uniquify-rationalize-file-buffer-names, uniquify-buffer-file-name):
Use 'uniquify-dirname-transform'.
* test/lisp/uniquify-tests.el (uniquify-home)
(uniquify-project-transform): Add tests.
Eli Zaretskii [Wed, 26 Jul 2023 14:30:21 +0000 (17:30 +0300)]
Fix "M-x man RET [ RET"
* lisp/man.el (Man-completion-table): Quote special characters
before passing them to the shell.
(Man-name-regexp): Allow '@' and '[' in man-page names. (Bug#64795)
Brian Leung [Mon, 24 Jul 2023 11:32:19 +0000 (04:32 -0700)]
lisp-mode.el: Add defvar-keymap to lisp-imenu-generic-expression
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
Add defvar-keymap. We do not ignore (defvar-keymap FOO)
constructs in imenu as we do with (defvar FOO) since the former
constructs are generally not vacuous whereas the latter ones
often are. (Bug#64831)
* test/lisp/proced-tests.el (proced-refine-test)
(proced-refine-with-update-test): Also check if the parent
process id of each process matches the process id refined
on before failing, since the refiner for process id returns
the children of a process in addition to the process itself.
(Bug#64800)
Harald Jörg [Wed, 26 Jul 2023 07:55:34 +0000 (09:55 +0200)]
cperl-mode.el: Bring cperl-short-docs up to Perl 5.38.
* lisp/progmodes/cperl-mode.el (imenu-max-items): declare the
variable to silence an elint warning.
(cperl-short-docs): Reorder function description to match Perl's
perlfunc documentation. Add missing shortdocs from perlfunc.
Delete entries for operators which don't exist any more (EQ, NE
and friends). Shorten docstring lines to 80 chars or less.
Eli Zaretskii [Tue, 25 Jul 2023 14:51:58 +0000 (17:51 +0300)]
Don't suggest to revert buffer from non-existing file
* lisp/files-x.el (modify-file-local-variable-message): Suggest to
revert from the buffer's file only if that file exists; otherwise
suggest 'normal-mode'. (Bug#64844)
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.
Eli Zaretskii [Mon, 24 Jul 2023 15:08:40 +0000 (18:08 +0300)]
Don't signal error when locking a file from non file-visiting buffer
* lisp/userlock.el (userlock--check-content-unchanged): Support
the case where a file is locked before being written to from a
non file-visiting buffer. (Bug#64821)
* 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.