]> git.eshelyaron.com Git - emacs.git/log
emacs.git
16 months agoFix image-dired-utils-tests after 83b6a8a5147 (bug#61394)
Manuel Giraud [Thu, 27 Jul 2023 21:26:30 +0000 (23:26 +0200)]
Fix image-dired-utils-tests after 83b6a8a5147 (bug#61394)

16 months agoFix userlock.el and filelock-tests in some rare cases
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.

16 months ago; Make doc-viev-imenu-enabled default value a boolean again
Tassilo Horn [Fri, 28 Jul 2023 05:07:45 +0000 (07:07 +0200)]
; Make doc-viev-imenu-enabled default value a boolean again

17 months ago; * lisp/tar-mode.el (tar-header-block-tokenize): Fix logic (bug#64686).
Eli Zaretskii [Thu, 27 Jul 2023 16:09:33 +0000 (19:09 +0300)]
; * lisp/tar-mode.el (tar-header-block-tokenize): Fix logic (bug#64686).

17 months agoFix function help for advised aliases (bug#64797)
Mattias Engdegård [Thu, 27 Jul 2023 14:13:54 +0000 (16:13 +0200)]
Fix function help for advised aliases (bug#64797)

* 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.

Reported by Michael Heerdegen.

17 months ago* lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Extend
Mattias Engdegård [Thu, 27 Jul 2023 07:55:43 +0000 (09:55 +0200)]
* lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Extend

Add skip-chars-forward, skip-chars-backward, skip-syntax-forward,
skip-syntax-backward, current-column, current-indentation,
char-syntax, syntax-class-to-char, parse-partial-sexp, goto-char,
forward-line, next-window, previous-window, minibuffer-window,
selected-frame, selected-window, standard-case-table,
standard-syntax-table, syntax-table, frame-first-window,
frame-root-window and frame-selected-window as always-true functions.

17 months agoBetter compilation of char-before, backward-char and backward-word
Mattias Engdegård [Thu, 27 Jul 2023 09:51:26 +0000 (11:51 +0200)]
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.

* lisp/emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word): Remove.
(bytecomp--char-before, bytecomp--backward-char)
(bytecomp--backward-word): New.

17 months agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Thu, 27 Jul 2023 14:52:38 +0000 (16:52 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

17 months agonotifications: Allow to use Icon Naming Specification for app-icon
Andrew Tropin [Thu, 27 Jul 2023 14:43:17 +0000 (16:43 +0200)]
notifications: Allow to use Icon Naming Specification for app-icon

* doc/lispref/os.texi (Desktop Notifications): Extend meaning of
:app-icon.

* etc/NEWS: Allow to use Icon Naming Specification for app-icon in
notifications-notify.

* lisp/notifications.el (notifications-notify): Allow to use Icon
Naming Specification for app-icon.

17 months agoNew option 'image-dired-thumb-naming' (bug#61394)
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.

17 months agoAvoid crashes due to invalid 'mode-line-format'
Eli Zaretskii [Thu, 27 Jul 2023 12:34:38 +0000 (15:34 +0300)]
Avoid crashes due to invalid 'mode-line-format'

* src/xdisp.c (display_mode_element, redisplay_window_error):
Don't take XCAR of what can be Qnil.  (Bug#64893)

17 months agoFix problem with null-device in Tramp
Michael Albinus [Thu, 27 Jul 2023 11:36:48 +0000 (13:36 +0200)]
Fix problem with null-device in Tramp

* lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name):
`null-device' could be nil.  Reported by Richard Copley
<rcopley@gmail.com>.

17 months agoSupport Posix-standard pax extended header in tar files
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)

17 months agoFix Tramp error on macOS
Michael Albinus [Thu, 27 Jul 2023 07:30:41 +0000 (09:30 +0200)]
Fix Tramp error on macOS

* lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options):
Don't use an absolute ControlPath on macOS.  (Bug#64880)

17 months agoFix image-dired-util-tests on MS-Windows
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'.

17 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Thu, 27 Jul 2023 07:01:25 +0000 (10:01 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

17 months ago; Better documentation of HOME on MS-Windows
Eli Zaretskii [Thu, 27 Jul 2023 06:51:39 +0000 (09:51 +0300)]
; Better documentation of HOME on MS-Windows

* doc/emacs/custom.texi (Find Init): Add footnote about HOME on
MS-Windows.  (Bug#64871)

17 months ago; Better documentation of HOME on MS-Windows
Eli Zaretskii [Thu, 27 Jul 2023 06:51:39 +0000 (09:51 +0300)]
; Better documentation of HOME on MS-Windows

* doc/emacs/custom.texi (Find Init): Add footnote about HOME on
MS-Windows.  (Bug#64871)

17 months ago; Clarify documentation of 'server-after-make-frame-hook'
Eli Zaretskii [Thu, 27 Jul 2023 06:37:03 +0000 (09:37 +0300)]
; Clarify documentation of 'server-after-make-frame-hook'

* doc/lispref/frames.texi (Creating Frames):
* lisp/server.el (server-after-make-frame-hook): Clarify
documentation of 'server-after-make-frame-hook'.  (Bug#64873)

17 months agoFix broken byte-compilation of unary comparisons
Mattias Engdegård [Wed, 26 Jul 2023 16:39:36 +0000 (18:39 +0200)]
Fix broken byte-compilation of unary comparisons

* 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.

Reported by Richard Copley.

17 months ago* lisp/emacs-lisp/byte-opt.el (pure-fns): Add `max-char`
Mattias Engdegård [Tue, 25 Jul 2023 10:52:29 +0000 (12:52 +0200)]
* lisp/emacs-lisp/byte-opt.el (pure-fns): Add `max-char`

17 months agoProvide backtrace for byte-ops aref and aset
Mattias Engdegård [Tue, 25 Jul 2023 10:16:30 +0000 (12:16 +0200)]
Provide backtrace for byte-ops aref and aset

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.

17 months ago; bytecode backtrace test clean-up
Mattias Engdegård [Tue, 25 Jul 2023 10:15:00 +0000 (12:15 +0200)]
; bytecode backtrace test clean-up

17 months ago; Documentation followup to last change
Eli Zaretskii [Wed, 26 Jul 2023 15:11:49 +0000 (18:11 +0300)]
; Documentation followup to last change

* lisp/progmodes/project.el (project-uniquify-dirname-transform):
* lisp/uniquify.el (uniquify-dirname-transform): Doc fixes.

* etc/NEWS: Announce the change.

17 months agoSupport transforming the dirname used by uniquify
Spencer Baugh [Mon, 10 Jul 2023 02:21:03 +0000 (22:21 -0400)]
Support transforming the dirname used by uniquify

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.

17 months agoFix "M-x man RET [ RET"
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)

17 months agoAdd 'define-error' to font lock keywords for emacs-lisp-mode
Neal Sidhwaney [Sun, 23 Jul 2023 23:25:51 +0000 (19:25 -0400)]
Add 'define-error' to font lock keywords for emacs-lisp-mode

* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Add 'define-error'.
(Bug#64824)

* test/lisp/emacs-lisp/lisp-mode-tests.el
(test-font-lock-keywords): New test.

Copyright-paperwork-exempt: yes

17 months agolisp-mode.el: Add defvar-keymap to lisp-imenu-generic-expression
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)

17 months agoFix unstable Proced refine tests
Laurence Warne [Sat, 22 Jul 2023 19:47:21 +0000 (20:47 +0100)]
Fix unstable Proced refine tests

* 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)

17 months agoFix build --with-sound on NetBSD and OpenBSD
Valtteri Vuorikoski [Sat, 22 Jul 2023 17:08:42 +0000 (20:08 +0300)]
Fix build --with-sound on NetBSD and OpenBSD

* configure.ac: Use ossaudio by default on *BSD systems.
(Bug#64698)

* etc/NEWS: Announce the change.

17 months agocperl-mode.el: Bring cperl-short-docs up to Perl 5.38.
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.

17 months agoAvoid crashes under 'which-key-mode'
Eli Zaretskii [Tue, 25 Jul 2023 17:38:01 +0000 (20:38 +0300)]
Avoid crashes under 'which-key-mode'

* src/keyboard.c (Fthis_single_command_keys): Don't allow calls to
Fvector with negative first argument.  (Bug#64857)

17 months agoDon't suggest to revert buffer from non-existing file
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)

17 months ago; Minor documentation fixes
Eli Zaretskii [Tue, 25 Jul 2023 13:49:18 +0000 (16:49 +0300)]
; Minor documentation fixes

* src/character.c (Fstring_width): Doc fix.

* doc/emacs/trouble.texi (Understanding Bug Reporting): Fix typo
(bug#64854).

17 months agoDon't signal error when locking a file from non file-visiting buffer
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)

17 months ago; * src/xdisp.c (mark_window_display_accurate_1): Avoid more aborts.
Eli Zaretskii [Sun, 23 Jul 2023 18:49:18 +0000 (14:49 -0400)]
; * src/xdisp.c (mark_window_display_accurate_1): Avoid more aborts.

17 months agoFix rare aborts in CHECK_WINDOW_END
Eli Zaretskii [Sun, 23 Jul 2023 17:44:40 +0000 (13:44 -0400)]
Fix rare aborts in CHECK_WINDOW_END

Those aborts happen because a window's window_end_vpos value
is inconsistent with the current matrix's number of rows, which
happens after resizing the mini-window.
* src/xdisp.c (mark_window_display_accurate_1): Don't validate the
window_end_valid flag if window_end_vpos is inconsistent with the
current_matrix's number of rows.  This happens, e.g., when
Edebug wants to show a value in the mini-window that causes it to
resize, as the window above the mini-window was usually already
redisplayed, and we think its display is accurate.

17 months ago; * src/pdumper.c (dump_overlay): Update hash.
Basil L. Contovounesios [Sun, 23 Jul 2023 07:39:17 +0000 (08:39 +0100)]
; * src/pdumper.c (dump_overlay): Update hash.

This follows commit 7ac947f34c745c61f8acc1fe2452a2c720d57a0d
of 2023-07-13 "; * src/lisp.h (struct Lisp_Overlay): Update
commentary (bug#64580)."

17 months agoFix Proced Start column alignment for different locales
Laurence Warne [Sat, 22 Jul 2023 13:35:15 +0000 (14:35 +0100)]
Fix Proced Start column alignment for different locales

* lisp/proced.el (proced-grammar-alist): Change the justify
value of the start attribute to 'left' instead of a fixed
value of 6.  (Bug#64752)
(proced-format-start): Adjust the doc string.

17 months ago* src/eval.c (get_backtrace): Don't skip the top frame
Stefan Monnier [Sat, 22 Jul 2023 21:20:51 +0000 (17:20 -0400)]
* src/eval.c (get_backtrace): Don't skip the top frame

`profiler.el` was reporting incomplete backtraces.
I had a suspicion there was something off, but it became obvious
when I saw that `set-buffer-multibyte` did not appear in the
`profiler-report` output when opening a large compressed tarball,
even though I knew it to be a large contributor (which `elp-results`
confirmed).

I have no idea why this `backtrace_next` was there, sadly, but now
`profiler-report` gives me results that make a lot more sense.

17 months agoFix regexp character class syntax property ghost matching bug
Mattias Engdegård [Sat, 22 Jul 2023 15:26:11 +0000 (17:26 +0200)]
Fix regexp character class syntax property ghost matching bug

The syntax-table-dependent regexp character classes [:space:],
[:word:] and [:punct:] always use the buffer-local syntax table for
performance reasons.  Fix a bug that could cause ghost (mis)matches
from use of lingering state by constructs that do use syntax
properties, such as `\sX`.

* src/regex-emacs.c (BUFFER_SYNTAX): New macro.
(ISPUNCT, ISSPACE, ISWORD): Use BUFFER_SYNTAX instead of SYNTAX.
(regex_compile): Delete syntax table setup code that is no longer
needed.
* test/src/regex-emacs-tests.el (regex-emacs-syntax-properties):
New regression test.

17 months ago; Fix documentation of last change.
Eli Zaretskii [Sat, 22 Jul 2023 15:50:26 +0000 (18:50 +0300)]
; Fix documentation of last change.

* src/xdisp.c (syms_of_xdisp):
* src/dispnew.c (syms_of_display):
* doc/lispref/commands.texi (Accessing Mouse): Fix documentation
of last change.

17 months ago* etc/NEWS: Announce the new option 'mouse-prefer-closest-glyph'.
Moritz Maxeiner [Sat, 22 Jul 2023 14:55:07 +0000 (16:55 +0200)]
* etc/NEWS: Announce the new option 'mouse-prefer-closest-glyph'.

17 months agoImplement new option 'mouse-prefer-closest-glyph'
Moritz Maxeiner [Sat, 22 Jul 2023 14:55:07 +0000 (16:55 +0200)]
Implement new option 'mouse-prefer-closest-glyph'

* src/dispnew.c (mouse_prefer_closest_glyph): New global
variable.
(buffer_posn_from_coords):
* src/xdisp.c (remember_mouse_glyph): Respect
'mouse_prefer_closest_glyph'.
(mouse_fine_grained_tracking): Update documentation to
include 'mouse_prefer_closest_glyph' effects.

* doc/lispref/commands.texi (Accessing Mouse): Update
documentation to say what the new option does when enabled.
* lisp/cus-start.el (standard): New user option
'mouse-prefer-closest-glyph'.

17 months agoImprove ERC's internal invisibility API
F. Jason Park [Sat, 15 Jul 2023 04:08:31 +0000 (21:08 -0700)]
Improve ERC's internal invisibility API

* etc/ERC-NEWS: Mention that line endings have moved from the end to
the beginning of hidden messages.
* lisp/erc/erc-fill.el (erc-fill--wrap-ensure-dependencies): Warn when
users have `erc-legacy-invisible-bounds-p' enabled, and force it to
its default value of nil in the current buffer.
(erc-fill-wrap-mode, erc-fill-wrap-enable): Move business involving
compat variable for enabling legacy hidden-message behavior to helper.
* lisp/erc/erc-match.el (erc-match--hide-fools-offset-bounds): Move
internal variable from to main library file and rename to
`erc-legacy-invisible-bounds-p'.  Also make obsolete and flip
semantics so a non-nil value enables the traditional behavior.
(erc-match--hide-message): Move to main library file and rename to
`erc--hide-message'.  Add a property-value parameter instead of
hard-coding to `erc-match'.  Also, condition behavior on renamed
compatibility flag `erc-legacy-invisible-bounds-p'.
(erc-hide-fools): Call `erc--hide-message' with own value for
`invisible' property specifically for fools.  That is, use
`match-fools' rather than `erc-match' or `erc-match-fools' to save
room when visually inspecting.  This retains the module name as a
prefix to hopefully minimize collisions with invisibility spec members
owned by non-ERC minor modes.  The `timestamp' spec member owned by
erc-stamp likewise lacks a namespace prefix, but its feature/group
affiliation is self-evident.
(erc-match--modify-invisibility-spec): Use toggle command
non-interactively for adding and removing invisibility spec member.
(erc-match-toggle-hidden-fools): Add explicit override argument and
defer to general helper for actually modifying spec.
(erc-match--toggle-hidden): New helper for toggling invisibility
spec.
* lisp/erc/erc.el (erc--merge-prop): If new value is a list, prepend
onto existing.  Add note about possible space optimization.
(erc-legacy-invisible-bounds-p): New obsolete compat variable to
enable traditional pre-5.6 invisibility interval on hidden messages.
Replaces `erc-match--hide-fools-offset-bounds-p' but has an inverted
meaning.  The new default value of nil means invisibility covers a
shifted interval consisting of the message body plus the line ending
immediately preceding it.
(erc--hide-message): New function, formerly `erc-match--hide-message'
from erc-match.el introduced in ERC 5.6.
* test/lisp/erc/erc-scenarios-match.el:
(erc-scenarios-match--invisible-stamp): Fix comment and use API
function in interactive convenience setup.
(erc-scenarios-match--find-bol): New test helper.
(erc-scenarios-match--find-eol): Fix bug affecting interactive use.
(erc-scenarios-match--stamp-left-fools-invisible,
erc-scenarios-match--stamp-right-fools-invisible,
erc-scenarios-match--stamp-right-invisible-fill-wrap,
erc-scenarios-match--stamp-both-invisible-fill-static): Update
`invisible' property from `erc-match' to `match-fools'.
(erc-scenarios-match--stamp-right-fools-invisible,
erc-scenarios-match--stamp-both-invisible-fill-static): Move test
body to function of same name for use in multiple cases.
(erc-scenarios-match--stamp-right-fools-invisible--nooffset,
erc-scenarios-match--stamp-both-invisible-fill-static--nooffset): New
test variants asserting proper hiding with old pre-5.6 invisibility
interval.
* test/lisp/erc/erc-tests.el (erc-tests--equal-including-properties):
Relocate macro higher in same file.
(erc--merge-prop): New test.  (Bug#64301)

17 months agoMake erc-fill-wrap work with left-sided stamps
F. Jason Park [Fri, 14 Jul 2023 13:12:30 +0000 (06:12 -0700)]
Make erc-fill-wrap work with left-sided stamps

* etc/ERC-NEWS: Remove all mention of option `erc-timestamp-align-to'
supporting a value of `margin', which has been abandoned.  Do mention
leading white space before stamps now having stamp-related properties.
* lisp/erc/erc-backend.el (erc--reveal-prompt, erc--conceal-prompt):
New generic functions with default implementations factored out from
`erc--unhide-prompt' and `erc--hide-prompt'.
(erc--prompt-hidden-p): New internal predicate function.
(erc--unhide-prompt): Defer to `erc--reveal-prompt', and set
`erc-prompt' text property to t.
(erc--hide-prompt): Defer to `erc--conceal-prompt', and set
`erc-prompt' text property to `hidden'.
* lisp/erc/erc-compat.el (erc-compat--29-browse-url-irc): Don't
use `function-equal'.
* lisp/erc/erc-fill.el (erc-fill-wrap-margin-width,
erc-fill-wrap-margin-side): New options to control side and initial
width of `fill-wrap' margin.
(erc-fill--wrap-beginning-of-line): Fix bug involving non-string
valued `display' props.
(erc-fill-wrap-toggle-truncate-lines): New command to re-enable
`visual-line-mode' when toggling off `truncate-lines'.
(erc-fill-wrap-mode-map): Remap `toggle-truncate-lines' to
`erc-fill-wrap-toggle-truncate-lines'.
(erc-fill-wrap-mode, erc-fill-wrap-enable, erc-fill-wrap-disable):
Update doc string, persist a few local vars, and conditionally set
`erc-stamp--margin-left-p'.  When deactivating, disable
`visual-line-mode' first.
(erc-fill--wrap-continued-message-p): Use `erc-speaker' instead of
heuristics when comparing nicks between consecutive messages.
(erc-fill-wrap-nudge): Update doc string and account for left-sided
stamps.
(erc-timestamp-offset): Add comment regarding conditional guard based
on function-valued option.
* lisp/erc/erc-stamp.el (erc-timestamp-use-align-to): Remove value
variant `margin', which was originally intended to be new in ERC 5.6.
This functionality was all but useless without the internal minor mode
`erc-stamp--display-margin-mode' active.
(erc-stamp-right-margin-width): Remove unused option new in 5.6.
(erc-stamp--display-margin-force): Remove unused function.
(erc-stamp--margin-width, erc-stamp--margin-left-p): New internal
variables.
(erc-stamp--init-margins-on-connect): New function for initializing
mode-managed margin after connecting.
(erc-stamp--adjust-right-margin, erc-stamp--adjust-margin): Rename
function to latter and accommodate left-hand stamps.
(erc-stamp--inherited-props): Move definition higher up in same file.
(erc-stamp--display-margin-mode): Update function name, and adjust
setup and teardown to accommodate left-handed stamps.  Don't add
advice around `erc-insert-timestamp-function'.
(erc-stamp--last-prompt, erc-stamp--display-prompt-in-left-margin):
New function and helper var to convert a normal inserted prompt so
that it appears in the left margin.
(erc-stamp--refresh-left-margin-prompt): Helper for other modules to
quickly refresh prompt outside of insert hooks.
(erc--reveal-prompt, erc--conceal-prompt): New implementations for
when `erc-stamp--display-margin-mode' is active.
(erc-insert-timestamp-left): Convert to generic function and provide
implementation for `erc-stamp--display-margin-mode'.
(erc-stamp--omit-properties-on-folded-lines): New variable, an escape
hatch for propertizing white space before right-side stamps folded
over onto another line.
(erc-insert-timestamp-right): Don't expect `erc-timestamp-align-to' to
ever be the symbol `margin'.  Move handling for that case to one
contingent on the internal minor mode `erc-stamp--display-margin-mode'
being active.  Add text properties preceding stamps that occupy a line
by their lonesome.  See related news entry for rationale.  This is
arguably a breaking change.
* lisp/erc/erc.el (erc--refresh-prompt-hook): New hook variable for
modules to adjust prompt properties whenever it's refreshed.
(erc--refresh-prompt): Fix bug in which user-defined prompt functions
failed to hide when quitting in server buffers.  Run new hook
`erc--refresh-prompt-hook'.
(erc-display-prompt): Add comment noting that the text property
`erc-prompt' now actually matters: it's t while a session is running
and `hidden' when disconnected.
* test/lisp/erc/erc-fill-tests.el (erc-fill--left-hand-stamps): New
test.
* test/lisp/erc/erc-stamp-tests.el
(erc-stamp-tests--use-align-to--nil,
erc-stamp-tests--use-align-to--t): New functions forged from old test
bodies to allow optionally asserting pre-5.6 behavior regarding
leading white space on right-hand stamps that exist on their own line.
(erc-timestamp-use-align-to--nil, erc-timestamp-use-align-to--t):
Parameterize with compatibility flag.
(erc-timestamp-use-align-to--margin,
erc-stamp--display-margin-mode--right): Rename test to latter.
* test/lisp/erc/erc-tests.el (erc-hide-prompt): Add some assertions
for new possible value of `erc-prompt' text property.
* test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld: New test
data file.  (Bug#60936)

17 months agoDon't always toggle a choice when prompting
Mauro Aranda [Sun, 16 Jul 2023 12:22:11 +0000 (09:22 -0300)]
Don't always toggle a choice when prompting

* lisp/wid-edit.el (widget-choice-prompt-value): Respect the value
of widget-choice-toggle.  (Bug#60712)

17 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 22 Jul 2023 12:56:50 +0000 (15:56 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

17 months agoAvoid prompting when creating a restricted-sexp widget
Mauro Aranda [Sun, 16 Jul 2023 22:46:54 +0000 (19:46 -0300)]
Avoid prompting when creating a restricted-sexp widget

* lisp/wid-edit.el (restricted-sexp): Turn value into a
string before reading.
(widget-field-value-create): Guard against value being nil,
so the field can be created even if the widget has a bad
default value.  (Bug#59937)

17 months ago; Eglot: adjust EGLOT-NEWS mention for last change
João Távora [Sat, 22 Jul 2023 09:36:39 +0000 (10:36 +0100)]
; Eglot: adjust EGLOT-NEWS mention for last change

* etc/EGLOT-NEWS: Adjust.

17 months agoEglot: simplify and hopefully fix last change (bug#64784)
João Távora [Sat, 22 Jul 2023 09:30:24 +0000 (10:30 +0100)]
Eglot: simplify and hopefully fix last change (bug#64784)

* lisp/progmodes/eglot.el (eglot--post-self-insert-hook): Use
last-command-event.

17 months agoAdd inhibit-remote-files and without-remote-files
Michael Albinus [Sat, 22 Jul 2023 08:16:04 +0000 (10:16 +0200)]
Add inhibit-remote-files and without-remote-files

* doc/emacs/files.texi (Remote Files): Do not document tramp-mode
any longer.  Describe inhibit-remote-files instead.

* doc/lispref/files.texi (Magic File Names): Add without-remote-files.

* doc/misc/tramp.texi (Frequently Asked Questions): Do not
document tramp-mode any longer.  Describe inhibit-remote-files and
without-remote-files instead.

* etc/NEWS: Add inhibit-remote-files and without-remote-files.
Fix typos.

* lisp/net/tramp.el (inhibit-remote-files): New defun.
(without-remote-files): New defmacro.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test49-without-remote-files):
* test/lisp/net/tramp-tests.el (tramp-test49-without-remote-files):
New tests.
(tramp-test50-unload): Rename.

17 months agoEnsure 'existing-filename' has 'bounds-of-thing-at-point'
Philip Kaludercic [Sun, 16 Jul 2023 11:56:23 +0000 (13:56 +0200)]
Ensure 'existing-filename' has 'bounds-of-thing-at-point'

* lisp/thingatpt.el (existing-filename): Define
'bounds-of-thing-at-point' for 'existing-filename'.  (Bug#64664)

17 months ago; Handle string-at-point at end of buffer gracefully
Philip Kaludercic [Wed, 19 Jul 2023 19:14:40 +0000 (21:14 +0200)]
; Handle string-at-point at end of buffer gracefully

* lisp/thingatpt.el (thing-at-point-bounds-of-string-at-point): Check
if 'char-after' returns non-nil before passing it to
'char-syntax'.  (Bug#64733)

17 months ago; * lisp/time.el (display-time-date-and-time): Fix last change.
Eli Zaretskii [Sat, 22 Jul 2023 06:13:35 +0000 (09:13 +0300)]
; * lisp/time.el (display-time-date-and-time): Fix last change.

17 months agomacroexp.el: Fix missing warning for intermediate expansions
Stefan Monnier [Wed, 19 Jul 2023 15:29:32 +0000 (11:29 -0400)]
macroexp.el: Fix missing warning for intermediate expansions

When a macro expanded to a call to an obsolete macro, we failed
to emit a warning for that use of the obsolete macro.

* lisp/emacs-lisp/macroexp.el (macroexp-macroexpand):
Use `macroexpand-1` to check obsolecence of intermediate expansions.

* test/lisp/emacs-lisp/macroexp-tests.el
(macroexp--test-obsolete-macro): New test.

17 months agoUse BASE_EQ instead of EQ in search.c
Mattias Engdegård [Fri, 21 Jul 2023 12:44:53 +0000 (14:44 +0200)]
Use BASE_EQ instead of EQ in search.c

* src/search.c (clear_regexp_cache, compile_pattern, Fmatch_data):
Use BASE_EQ where appropriate.

17 months ago; Fix bug in regexp debug code
Mattias Engdegård [Fri, 21 Jul 2023 09:56:42 +0000 (11:56 +0200)]
; Fix bug in regexp debug code

* src/regex-emacs.c (print_partial_compiled_pattern):
Only the 7 bottom bits of the first byte form the bitmap size.

17 months agoFix failing native-compile test
Robert Pluim [Fri, 21 Jul 2023 12:38:15 +0000 (14:38 +0200)]
Fix failing native-compile test

* test/src/comp-tests.el (comp-tests-result-lambda): Use
'comp-deftest', not 'ert-deftest'.  The latter doesn't check for
native-compile support.

17 months agoFix Proced display header alignment under 'text-scale-adjust'
Eli Zaretskii [Fri, 21 Jul 2023 12:19:02 +0000 (15:19 +0300)]
Fix Proced display header alignment under 'text-scale-adjust'

* lisp/proced.el (proced-mode): Force the header-line to scale
according to 'text-scale-adjust'.
(proced-header-line): Use width of the header-line's face's
characters as align-to units, not the width of the frame's
default face's font.  (Bug#64752)

* src/xdisp.c (calc_pixel_width_or_height): Use font's
average_width or space_width, not max_width, as the correct
measure of the font's width.  This is consistent with the rest of
the display engine.

17 months agoFix last change to wid-edit.el
Stephen Berman [Thu, 20 Jul 2023 19:51:24 +0000 (21:51 +0200)]
Fix last change to wid-edit.el

* lisp/wid-edit.el (widget-choose): Test for stringp instead of
char-or-string-p, since substitute-command-keys should only apply
to choice values that are strings. (Bug#64046, Message #37)

17 months agoCC Mode (some languages): handle string lines ending in \\
Alan Mackenzie [Thu, 20 Jul 2023 19:33:42 +0000 (19:33 +0000)]
CC Mode (some languages): handle string lines ending in \\

In C, C++, Objective C, and Pike modes, regard \\ in a string
at EOL as a backslash followed by an escaped newline.  In the
other languages, this remains regarded as an escaped backslash
followed by an invalid string terminator.

* lisp/progmodes/cc-defs.el (c-is-escaped, c-will-be-escaped):
Amend to observe the changed notion of escaped newlines.

* lisp/progmodes/cc-langs.el (c-string-escaped-newlines):
Unused, removed.
(c-escaped-newline-takes-precedence): New lang const and var.
(c-string-innards-re-alist): Amend, using the above new lang
var.

17 months ago; Fix previous change
Robert Pluim [Thu, 20 Jul 2023 17:12:32 +0000 (19:12 +0200)]
; Fix previous change

17 months agoFix defface's with no customization data
Eli Zaretskii [Thu, 20 Jul 2023 16:25:43 +0000 (19:25 +0300)]
Fix defface's with no customization data

* lisp/net/shr.el (shr-h4, shr-h5, shr-h6):
* lisp/cedet/semantic/decorate/include.el
(semantic-decoration-on-includes):
* lisp/progmodes/make-mode.el (makefile-shell):
* lisp/time.el (display-time-date-and-time):
* lisp/nxml/nxml-mode.el (nxml-text, nxml-delimiter)
(nxml-element-colon): Add face definitions (bug#64655).

17 months agodocview: imenu: check return value of 'mutool'
Morgan Smith [Tue, 11 Jul 2023 18:08:24 +0000 (14:08 -0400)]
docview: imenu: check return value of 'mutool'

While 'mutool' supports many filetypes, 'mutool show' only
supports PDF files.  This would lead to cryptic imenu errors
when opening other
file types (like EPUB) since we would parse the error output.
During my testing this caused 'imenu--index-alist' to have a
value of '(nil).

* lisp/doc-view.el (doc-view--pdf-outline): Error when 'mutool'
returns an error.  Use 'call-process' to get the return value and
remove the call to 'shell-quote-argument' as 'call-process'
doesn't want any escapes.
(doc-view-mode): Handle possible error from 'doc-view-imenu-setup'.
(doc-view-imenu-enabled): Remove superfluous (and ... t).
(doc-view-imenu-setup): Remove check for mutool already ensured by
'doc-view-imenu-enabled' being non-nil.
(Bug#64516)

17 months agoCustom var python-interpreter-args (bug#64397)
Matthias Meulien [Thu, 13 Jul 2023 21:38:41 +0000 (23:38 +0200)]
Custom var python-interpreter-args (bug#64397)

* lisp/progmodes/python.el (python-interpreter): Mention
new variable in documentation.
(python-interpreter-args): New custom variable.
(python-shell-interpreter, python-shell-interpreter-args)
(python-shell-interpreter-interactive-arg): Improve
documentation.
(python--list-imports, python--do-isort)
(python-fix-imports): Make process use customisable
arguments.

17 months agoPreserve comments when redrawing a widget (Bug#64649)
Mauro Aranda [Sat, 15 Jul 2023 21:54:14 +0000 (18:54 -0300)]
Preserve comments when redrawing a widget (Bug#64649)

* lisp/cus-edit.el (custom-comment-preserve): New function.
(custom-redraw): Use it.
(custom-comment-create): Make sure :comment-shown is set to
t if the comment widget gets created.
(custom-face-value-create, custom-variable-value-create):
Recreate the custom-comment widget with the preserved value,
if any.

17 months agoPass original spec just after creating the face-widget
Mauro Aranda [Mon, 10 Jul 2023 13:47:23 +0000 (10:47 -0300)]
Pass original spec just after creating the face-widget

* lisp/cus-edit.el (custom-face-get-current-spec-unfiltered):
New function, extracted from custom-face-get-current-spec.
(custom-face-get-current-spec): Use it.
(custom-face-state-set): Take an optional argument, to decide
if we should check against a filtered or unfiltered spec.
(custom-face-value-create): Use the new optional argument.
(Bug#64347)

17 months agoMerge from origin/emacs-29
Po Lu [Thu, 20 Jul 2023 11:50:45 +0000 (19:50 +0800)]
Merge from origin/emacs-29

4bd8e8c6d2b ; * src/xdisp.c: Fix wording in commentary.
3af27a4b815 Improve commentary in nsfns.m
5de5e4b4d0a Fix typos and ommissions in cus-edit.el
9d93c6ba14a ; * src/xdisp.c: Fix typos in the commentary.
86f2d6d62fc ; * src/xdisp.c: Improve commentary.  (Bug#64596)
ac075176bf0 ; * admin/notes/bugtracker: Fix punctuation.
81518534471 ; * admin/notes/bugtracker: Use 'e.g.' throughout the doc...
f063f79a493 Convert NUL-containing NSString objects to Lisp strings c...
d172cd59854 ; * doc/lispref/keymaps.texi (Modifying Menus): Add cross...
927e8b470fc ; * doc/lispref/keymaps.texi (Extended Menu Items): Add @...
77f489421ec ; * src/xdisp.c: Minor improvements of the commentary.
ce3f9fba1a3 ; Improve accuracy of out-out-order message insertion
17073af84d7 ; Improve robustness of package-report-bug

17 months ago; * src/xdisp.c: Fix wording in commentary.
Eli Zaretskii [Thu, 20 Jul 2023 10:23:01 +0000 (13:23 +0300)]
; * src/xdisp.c: Fix wording in commentary.

17 months agoEglot: fix textDocument/onTypeFormatting for 'newline' command
João Távora [Thu, 20 Jul 2023 10:02:12 +0000 (05:02 -0500)]
Eglot: fix textDocument/onTypeFormatting for 'newline' command

In the newline command, last-input-event is 13 (carriage return), but
most, if not all, language servers that support
documentOnTypeFormattingProvider expect 10 (linefeed) to be the
trigger, so convert 13 to 10 for the purposes of the
textDocument/onTypeFormatting request.

Also make this common edit silent in the mode-line/messages.

* lisp/progmodes/eglot.el (eglot--post-self-insert-hook): Convert
linefeed to carriage return.
(eglot-format): Pass SILENT to eglot--apply-text-edits.
(eglot--apply-text-edits): Take new optional SILENT arg.

* etc/EGLOT-NEWS: Mention change

17 months agoImprove commentary in nsfns.m
Po Lu [Thu, 20 Jul 2023 08:01:34 +0000 (16:01 +0800)]
Improve commentary in nsfns.m

* src/nsfns.m (lispString): Avoid C++ comment and make the
commentary actually relevant to the reason `make_string' is
used.

17 months agoFix typos and ommissions in cus-edit.el
Po Lu [Thu, 20 Jul 2023 07:55:07 +0000 (15:55 +0800)]
Fix typos and ommissions in cus-edit.el

* lisp/cus-edit.el (custom-display): Add missing display types.

17 months ago; * src/xdisp.c: Fix typos in the commentary.
Eli Zaretskii [Wed, 19 Jul 2023 16:28:48 +0000 (19:28 +0300)]
; * src/xdisp.c: Fix typos in the commentary.

17 months ago; * src/xdisp.c: Improve commentary. (Bug#64596)
Eli Zaretskii [Wed, 19 Jul 2023 14:54:53 +0000 (17:54 +0300)]
; * src/xdisp.c: Improve commentary.  (Bug#64596)

17 months agoWarn when toggling erc-nicks-mode in target buffers
F. Jason Park [Wed, 19 Jul 2023 05:18:00 +0000 (22:18 -0700)]
Warn when toggling erc-nicks-mode in target buffers

* lisp/erc/erc-nicks.el (erc-nicks-mode, erc-nicks-enable): This local
module isn't autoloaded like most global modules, in part to dissuade
users from attempting to enable it by running M-x erc-nicks-mode RET.
However, rather than signal an error upon detecting such an attempt,
ERC should explain that the only supported means of activation is via
`erc-modules'.  This change does that and then enables it anyway,
despite the degraded experience.

17 months ago; Address some ambiguities in ERC's documentation
F. Jason Park [Sun, 16 Jul 2023 02:11:37 +0000 (19:11 -0700)]
; Address some ambiguities in ERC's documentation

* doc/misc/erc.texi: Change name of example function from
`erc-my-enable-read-indicator-on-join' to
`erc-my-enable-keep-place-indicator-on-join'.  Fix example functions
`erc-cmd-TRACK' and `erc-cmd-UNTRACK' to work with server buffers as
well as target buffers.
* etc/ERC-NEWS: Revise `keep-place' entry and make headlines less
redundant.
* lisp/erc/erc.el (erc-accidental-paste-threshold-seconds): Fix
portion of existing wording that was more likely interpreted as a
single multiline submission, whereas the intended meaning is three
separate submissions.

17 months ago; * admin/notes/bugtracker: Fix punctuation.
Eli Zaretskii [Wed, 19 Jul 2023 12:05:52 +0000 (15:05 +0300)]
; * admin/notes/bugtracker: Fix punctuation.

17 months ago; * admin/notes/bugtracker: Use 'e.g.' throughout the document.
Arash Esbati [Tue, 18 Jul 2023 21:07:01 +0000 (23:07 +0200)]
; * admin/notes/bugtracker: Use 'e.g.' throughout the document.

17 months agoFix native compilation in dynamically bound files.
Alan Mackenzie [Wed, 19 Jul 2023 11:23:00 +0000 (11:23 +0000)]
Fix native compilation in dynamically bound files.

This fixes bug#64642.

* lisp/emacs-lisp/comp.el (comp-spill-lap-function/symbol): Add
code for dynamically bound functions.

* test/src/comp-tests.el (comp-tests-result-lambda): New test.

* test/src/comp-resources/comp-test-funcs-dyn2.el: New test
file.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# modified:   lisp/emacs-lisp/comp.el
# new file:   test/src/comp-resources/comp-test-funcs-dyn2.el
# modified:   test/src/comp-tests.el
#
# Changes not staged for commit:
# modified:   .gitignore
#
# Untracked files:
# .gitignore.acm
# .gitignore.backup
# .timestamps.txt
# 2021-01-03.err
# 2021-01-06.err
# 2021-12-16.make
# 2021-12-30.err
# 2021-12-31.err
# 2022-01-01.err
# 2022-01-02.check.err
# 2022-01-02.err
# 2022-01-04.err
# 2022-01-05.err
# 2022-01-06.err
# 2022-01-07.err
# 2022-01-07.outerr
# 2022-01-08.err
# 2022-01-09.err
# 2022-01-09b.err
# 2022-01-10.err
# 2022-01-11
# 2022-01-11.err
# 2022-02-22.err
# 2022-02-22.outerr
# checkout.20220228.out
# checkout.20220301.out
# checkout.20220302.out
# doc/lispref/syntax.20160318.techsi
# doc/lispref/syntax.20160318b.techsi
# lib/.deps/
# lisp/2022-01-09.err
# lisp/emacs-lisp/comp.el.rej
# src/2021-12-20.err
# src/globals.20211124.aitch
# src/lisp.20211127.aitch
# test/lisp/calendar/icalendar-tests.elcr5m9Wq
#

17 months agoPort file-name-case-insensitive-p to Haiku
Po Lu [Wed, 19 Jul 2023 07:03:12 +0000 (07:03 +0000)]
Port file-name-case-insensitive-p to Haiku

* src/fileio.c (file_name_case_insensitive_err): Don't return
errno upon failure, just 1, since errno is not used in the sole
caller.

17 months agoImprove commentary in xterm.c
Po Lu [Wed, 19 Jul 2023 05:51:41 +0000 (13:51 +0800)]
Improve commentary in xterm.c

* src/xterm.c (xi_populate_device_from_info, xi_handle_new_classes)
(syms_of_xterm): Improve commentary on touch events.

17 months agoImprove reliability of minor mode menu dispatch
Po Lu [Wed, 19 Jul 2023 00:21:43 +0000 (08:21 +0800)]
Improve reliability of minor mode menu dispatch

* lisp/mouse.el (minor-mode-menu-from-indicator): Instead of using the
word at point, search for a matching enabled minor mode from the
beginning of the string object when mode-line-compact is enabled.

17 months ago; * etc/NEWS (Eshell): Fix typo.
Jim Porter [Tue, 18 Jul 2023 21:07:03 +0000 (14:07 -0700)]
; * etc/NEWS (Eshell): Fix typo.

17 months agoFix line number display under 'mode-line-format-right-align'
Eli Zaretskii [Tue, 18 Jul 2023 18:06:30 +0000 (21:06 +0300)]
Fix line number display under 'mode-line-format-right-align'

* src/xdisp.c (Fbuffer_text_pixel_size): Restore window attributes
important for redisplay of the target WINDOW.  (Bug#64713)

17 months agoConvert NUL-containing NSString objects to Lisp strings correctly
Mattias Engdegård [Tue, 18 Jul 2023 13:42:55 +0000 (15:42 +0200)]
Convert NUL-containing NSString objects to Lisp strings correctly

This cures the inability to paste text containing NUL from other
applications on macOS, introduced by mistake in 7e3c2b553f
(bug#64697).

* src/nsfns.m ([NSString lispString]): Use make_string instead of
build_string which relies on NUL-termination.

17 months agoFix event data leak
Po Lu [Tue, 18 Jul 2023 13:26:05 +0000 (21:26 +0800)]
Fix event data leak

* src/xterm.c (handle_one_xevent): Jump to XI_OTHER after
handling touch ownership event.

17 months ago; * doc/lispref/keymaps.texi (Modifying Menus): Add cross-references.
Eli Zaretskii [Tue, 18 Jul 2023 13:17:15 +0000 (16:17 +0300)]
; * doc/lispref/keymaps.texi (Modifying Menus): Add cross-references.

17 months ago; * doc/lispref/keymaps.texi (Extended Menu Items): Add @pxref.
Eli Zaretskii [Tue, 18 Jul 2023 12:57:01 +0000 (15:57 +0300)]
; * doc/lispref/keymaps.texi (Extended Menu Items): Add @pxref.

17 months ago; * src/xdisp.c: Minor improvements of the commentary.
Eli Zaretskii [Tue, 18 Jul 2023 11:58:09 +0000 (14:58 +0300)]
; * src/xdisp.c: Minor improvements of the commentary.

17 months agoFix display of minor mode menus when mode-line-compact is enabled
Po Lu [Tue, 18 Jul 2023 08:15:05 +0000 (16:15 +0800)]
Fix display of minor mode menus when mode-line-compact is enabled

* lisp/mouse.el (minor-mode-menu-from-indicator): New arg
WINDOW.  If INDICATOR is a string object and mode-line-compat is
enabled within WINDOW, use the symbol within the object at its
position instead.
(mouse-minor-mode-menu): Pass posn-object and posn-window to
minor-mode-menu-from-indicator.

17 months agoExpose the ``cancellation'' of touch events to Lisp
Po Lu [Tue, 18 Jul 2023 01:27:27 +0000 (09:27 +0800)]
Expose the ``cancellation'' of touch events to Lisp

* doc/lispref/commands.texi (Touchscreen Events):
* etc/NEWS: Describe new event parameter `canceled'.
* src/keyboard.c (make_lispy_event) <TOUCHSCREEN_END_EVENT>:
If event->modifiers, set canceled to t.

* src/termhooks.h (enum event_kind): Describe meaning of
modifiers in TOUCHSCREEN_END_EVENTs.
* src/xfns.c (setup_xi_event_mask): Select for
XI_TouchOwnership.
* src/xterm.c (xi_link_touch_point): Round X and Y and clear
ownership.
(xi_unlink_touch_point): Return 1 if the touch point is not
owned by Emacs, 2 otherwise.
(handle_one_xevent): Handle XI_TouchOwnership events and report
ownership correctly.
* src/xterm.h (enum xi_touch_ownership): New enum.  Write
commentary on XI touch sequence ownership.
(struct xi_touch_point_t): Use integer X and Y.  New field
`ownership'.  Adjust for alignment.

17 months agoDelete vc-deduce-fileset-1, taking advantage of set-buffer
Dmitry Gutov [Tue, 18 Jul 2023 00:49:44 +0000 (03:49 +0300)]
Delete vc-deduce-fileset-1, taking advantage of set-buffer

* lisp/vc/vc.el (vc-deduce-fileset): Set buffer to the base
buffer, if any (bug#63949).  That's to replace the more complex
previous strategy.  vc-deduce-fileset is allowed to change the
current buffer, so why not do it for that case.
(vc-deduce-fileset-1): Delete, moving the meat of the logic back
to vc-deduce-fileset.

17 months ago; Improve accuracy of out-out-order message insertion
Philip Kaludercic [Mon, 17 Jul 2023 20:02:38 +0000 (22:02 +0200)]
; Improve accuracy of out-out-order message insertion

* lisp/net/rcirc.el (rcirc-print): Do not ignore the return value of
'next-single-property-change'.

17 months ago* lisp/bindings.el (mode--line-format-right-align): Add 'mode-line' face.
Juri Linkov [Mon, 17 Jul 2023 17:56:29 +0000 (20:56 +0300)]
* lisp/bindings.el (mode--line-format-right-align): Add 'mode-line' face.

Like in `tab-bar-format-align-right', use `add-face-text-property' to
add 'mode-line' face on the `rest-str' string for `string-pixel-width'
to calculate the correct pixel width (bug#62606).

17 months agoDon't distort character ranges in rx translation
Mattias Engdegård [Mon, 17 Jul 2023 11:05:21 +0000 (13:05 +0200)]
Don't distort character ranges in rx translation

The Emacs regexp engine interprets character ranges from ASCII to raw
bytes, such as [a-\xfe], as not including non-ASCII Unicode at all;
ranges from non-ACII Unicode to raw bytes, such as [ü-\x91], are
ignored entirely.

To make rx produce a translation that works as intended, split ranges
that that go from ordinary characters to raw bytes. Such ranges may
appear from set manipulation and regexp optimisation.

* lisp/emacs-lisp/rx.el (rx--generate-alt): Split intervals that
straddle the char-raw boundary when rendering a string regexp from an
interval set.
* test/lisp/emacs-lisp/rx-tests.el (rx-char-any-raw-byte):
Add test cases.

17 months agoEglot: check correct capability name in eglot-imenu (bug#64682)
Brian Leung [Mon, 17 Jul 2023 13:29:18 +0000 (14:29 +0100)]
Eglot: check correct capability name in eglot-imenu (bug#64682)

* lisp/progmodes/eglot.el (eglot-imenu): Declare the correct name of
the server capability providing textDocument/documentSymbol.

Without this change, eglot-imenu always aborts even when used with
servers supporting textDocument/documentSymbol.

17 months agoDon't deliver touch or pinch events from master or slave devices
Po Lu [Mon, 17 Jul 2023 12:42:56 +0000 (20:42 +0800)]
Don't deliver touch or pinch events from master or slave devices

* src/xfns.c (setup_xi_event_mask): Select for gesture events on
only master devices if safe.
* src/xterm.c (handle_one_xevent): Deliver touchscreen events
only from direct slave devices, and gesture events only from
master pointers.

17 months agoFix eshell.texi markup
Robert Pluim [Mon, 17 Jul 2023 08:10:48 +0000 (10:10 +0200)]
Fix eshell.texi markup

* doc/misc/eshell.texi (Aliases): Add missing @end table.  (Bug#64674)

17 months agoCheck correct bit for DNS truncation
Marc van der Wal [Mon, 17 Jul 2023 08:56:06 +0000 (10:56 +0200)]
Check correct bit for DNS truncation

* lisp/net/dns.el (dns-read): The TC bit is the second bit, not the
third bit.  (Bug#64678)

Copyright-paperwork-exempt: yes