]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoCorrectly convert event state in more places
Po Lu [Mon, 27 Jun 2022 01:13:33 +0000 (09:13 +0800)]
Correctly convert event state in more places

* src/xterm.c (handle_one_xevent): Use `xi_convert_event_state'
to handle synthetic and xwidget button events.

2 years agoMinor clean up of previous Fsignal_names patch
Lars Ingebrigtsen [Sun, 26 Jun 2022 20:50:50 +0000 (22:50 +0200)]
Minor clean up of previous Fsignal_names patch

* src/process.c (Fsignal_names): Clean up code slightly.

2 years agoMake `signal-process' allow completing over signal names
Lars Ingebrigtsen [Sun, 26 Jun 2022 20:45:39 +0000 (22:45 +0200)]
Make `signal-process' allow completing over signal names

* lisp/simple.el (read-signal-name): New function.
* src/process.c (Fsignal_process): Use it to allow completing over
the signal names (bug#56239).
(Fsignal_names): New function.

2 years agoFont-lock variable values in *Help*
Lars Ingebrigtsen [Sun, 26 Jun 2022 19:41:42 +0000 (21:41 +0200)]
Font-lock variable values in *Help*

* lisp/help-fns.el (describe-variable): Font-lock the variable
value (bug#47363).

2 years agoOptimise away functions in for-effect context
Mattias Engdegård [Sun, 26 Jun 2022 16:46:13 +0000 (18:46 +0200)]
Optimise away functions in for-effect context

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Turn functions into nil when compiled for-effect since they have no
side-effects on their own.  This may enable further improvements such
as the elimination of variable bindings.
`unwind-protect` forms can be treated as plain function call at this
point.  In particular, their unwind function argument should be
not optimised for effect since it's a function.

2 years ago(oclosure-test-limits): Fix test failure when interpreted
Stefan Monnier [Sun, 26 Jun 2022 17:15:15 +0000 (13:15 -0400)]
(oclosure-test-limits): Fix test failure when interpreted

* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test-limits):
Make sure we bind `byte-compile-debug` dynamically.

2 years agoFix re-composition under 'composition-break-at-point'
Eli Zaretskii [Sun, 26 Jun 2022 16:55:13 +0000 (19:55 +0300)]
Fix re-composition under 'composition-break-at-point'

* src/xdisp.c (try_window_id): Disable this optimization if
'composition-break-at-point' is non-nil.

2 years ago* lisp/simple.el (delete-forward-char): Fix bug #56237.
Eli Zaretskii [Sun, 26 Jun 2022 16:35:57 +0000 (19:35 +0300)]
* lisp/simple.el (delete-forward-char): Fix bug #56237.

2 years agoWhen closing an Eshell process target, send EOF three times
Jim Porter [Sun, 26 Jun 2022 16:27:20 +0000 (18:27 +0200)]
When closing an Eshell process target, send EOF three times

* lisp/eshell/esh-io.el (eshell-close-target): Send EOF 3 times.

* test/lisp/eshell/em-extpipe-tests.el (em-extpipe-tests--deftest):
Re-enable these tests on EMBA.

This patch is adapted by one from Ken Brown, who uncovered the reason
for this bug (bug#56025).

2 years agoReconvert EPUB buffers when user CSS is changed
Kjartan Óli Ágústsson [Sun, 26 Jun 2022 15:52:29 +0000 (17:52 +0200)]
Reconvert EPUB buffers when user CSS is changed

* lisp/doc-view.el (doc-view-epub-user-stylesheet): Add
`doc-view-custom-set-mutool-user-stylesheet' as setter, change name.
(doc-view-custom-set-epub-font-size): Factor reconvert logic out
(doc-view--epub-reconvert): Add defun
(doc-view--epub-stylesheet-watcher): Add defvar
(doc-view-custom-set-epub-user-stylesheet): Add defun (bug#55825).

2 years agoMake <mouse-2> in mode line more careful as well
Visuwesh [Sun, 26 Jun 2022 15:45:45 +0000 (17:45 +0200)]
Make <mouse-2> in mode line more careful as well

* lisp/mouse.el (mouse-delete-other-windows): Only delete other
windows if the user didn't move the cursor off the
mode-line (bug#56198).

2 years agoMake <mouse-3> in the mode line more careful
Visuwesh [Sun, 26 Jun 2022 15:30:04 +0000 (17:30 +0200)]
Make <mouse-3> in the mode line more careful

* lisp/mouse.el (mouse-delete-window): Only delete the window if
the user hasn't moved point out of the mode line before releasing
the button (bug#56198).

2 years agoMake Eshell globs ending in "/" match directories only
Jim Porter [Sun, 26 Jun 2022 01:19:01 +0000 (18:19 -0700)]
Make Eshell globs ending in "/" match directories only

* lisp/eshell/em-glob.el (eshell-glob-convert): Return whether to
match directories only.
(eshell-glob-entries): Add ONLY-DIRS argument.

* test/lisp/eshell/em-glob-tests.el
(em-glob-test/match-any-directory): New test.
(em-glob-test/match-recursive)
(em-glob-test/match-recursive-follow-symlinks): Add test cases for
when "**/" or "***/" are the last components in a glob.

* etc/NEWS: Announce this change (bug#56227).

2 years agoConvert Eshell globs ahead of time instead of doing it repeatedly
Jim Porter [Fri, 24 Jun 2022 15:39:42 +0000 (08:39 -0700)]
Convert Eshell globs ahead of time instead of doing it repeatedly

* lisp/eshell/em-glob.el (eshell-glob-recursive): New variable.
(eshell-glob-convert-1, eshell-glob-convert): New functions.
(eshell-extended-glob): Use 'eshell-glob-convert'.
(eshell-glob-entries): Adapt function to use pre-converted globs.

* test/lisp/eshell-em-glob-tests.el (em-glob-test/match-dot-files):
New test.

2 years agoOptionally signal an error if an Eshell predicate fails to match anything
Jim Porter [Sun, 26 Jun 2022 03:05:57 +0000 (20:05 -0700)]
Optionally signal an error if an Eshell predicate fails to match anything

* lisp/eshell/em-pred.el (eshell-error-if-no-glob): Declare it.
(eshell-apply-modifiers): Add STRING-DESC argument and signal an error
if there are no matches and 'eshell-error-if-no-glob' is set.
(eshell-parse-arg-modifier): Pass modifier string to
'eshell-apply-modifiers'.

* test/lisp/eshell/em-pred-tests.el (eshell-eval-predicate): Simplify.
(em-pred-test/no-matches): New test.

* doc/misc/eshell.texi (Bugs and ideas): Remove todo entry about this
change.

2 years agoFix typo in signal-process-functions
Daniel Martín [Sun, 26 Jun 2022 10:27:55 +0000 (12:27 +0200)]
Fix typo in signal-process-functions

* doc/lispref/processes.texi (Signals to Processes): Update reference
to correct default variable in the ELisp manual.
* etc/NEWS: The same for the NEWS entry (bug#56234).

2 years agoUpdate term-char-mode doc string
Lars Ingebrigtsen [Sun, 26 Jun 2022 14:45:09 +0000 (16:45 +0200)]
Update term-char-mode doc string

* lisp/term.el (term-char-mode): Update doc string.

2 years agoFix Bug#56110 (switching from line-mode to char-mode)
Michael Heerdegen [Tue, 21 Jun 2022 11:41:51 +0000 (13:41 +0200)]
Fix Bug#56110 (switching from line-mode to char-mode)

* lisp/term.el (term-char-mode): Make `add-function' override the
correct place (the buffer local variable `term-input-sender').

2 years agoFix a recent Lisp mode filling test failure
Lars Ingebrigtsen [Sun, 26 Jun 2022 14:31:33 +0000 (16:31 +0200)]
Fix a recent Lisp mode filling test failure

* lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Restore the
"fill first line separately" logic.

2 years ago* lisp/emacs-lisp/syntax.el: Rework the handling of nested calls.
Stefan Monnier [Sun, 26 Jun 2022 12:59:38 +0000 (08:59 -0400)]
* lisp/emacs-lisp/syntax.el: Rework the handling of nested calls.

Nested calls to `syntax-ppss` and `syntax-propertize` can easily
happen unexpectedly via ondemand propertizing or `forward-sexp`.
Refine the handling of nested calls so we detect them more reliably
(e.g. also within `syntax-propertize-extend-region-functions`)
and so that the `syntax-ppss` cache is automatically flushed in case
it might have been filled with data that's become obsolete since.

(syntax-propertize--inhibit-flush): Delete var.
(syntax-propertize--in-process-p): New function to replace it.
(syntax-ppss-flush-cache): Use it.
(syntax-ppss--updated-cache): New var.
(syntax-propertize): Make `syntax-propertize--done` binding apply to
`syntax-propertize-extend-region-functions` as well, as intended (fixes
bug#46713).  Use `syntax-ppss--updated-cache` to flush
syntax-ppss cache at the end when needed.
Don't bind `syntax-propertize--inhibit-flush` any more.
(syntax-ppss): Set `syntax-ppss--updated-cache` when applicable.

2 years agoDon't create HOME if it doesn't exist
Lars Ingebrigtsen [Sat, 25 Jun 2022 15:28:12 +0000 (17:28 +0200)]
Don't create HOME if it doesn't exist

* lisp/files.el (locate-user-emacs-file): Don't create HOME if it
doesn't exist (bug#47298).  This returns us to Emacs 26.3
behaviour here.

2 years ago; Pacify unknown fun warning in mh-utils-tests.el.
Basil L. Contovounesios [Sun, 26 Jun 2022 12:08:57 +0000 (15:08 +0300)]
; Pacify unknown fun warning in mh-utils-tests.el.

2 years ago; Minor cosmetics adjustment to xterm.c
Po Lu [Sun, 26 Jun 2022 10:14:17 +0000 (18:14 +0800)]
; Minor cosmetics adjustment to xterm.c

* src/xterm.c: Rename xIOErrorHandler & friends to
"Emacs_XIOErrorHandler" so they don't look like X protocol
header types.

2 years agoFix narrowing problem in tramp-debug-buffer-command-completion-p
Michael Albinus [Sun, 26 Jun 2022 08:57:00 +0000 (10:57 +0200)]
Fix narrowing problem in tramp-debug-buffer-command-completion-p

* lisp/net/tramp.el (tramp-debug-buffer-command-completion-p):
Respect narrowing.  (Bug#56225)

2 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sun, 26 Jun 2022 08:11:28 +0000 (11:11 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

2 years agoAdd some more common predefined atoms
Po Lu [Sun, 26 Jun 2022 07:36:43 +0000 (15:36 +0800)]
Add some more common predefined atoms

* src/xterm.c (x_intern_cached_atom, x_get_atom_name): Add
DRAWABLE, BITMAP, COLORMAP, CURSOR and FONT.

2 years agoFix ispell-word on colorless TTY frames
Eli Zaretskii [Sun, 26 Jun 2022 07:22:20 +0000 (10:22 +0300)]
Fix ispell-word on colorless TTY frames

* lisp/textmodes/ispell.el
(ispell-highlight-spelling-error-generic): Keep marker position of
END intact, deletion of text notwithstanding.  (Bug#56219)

2 years agoStop catching errors for some requests
Po Lu [Sun, 26 Jun 2022 05:34:43 +0000 (13:34 +0800)]
Stop catching errors for some requests

* src/xterm.c (x_dnd_compute_toplevels)
(frame_set_mouse_pixel_position, x_focus_frame): Use
`x_ignore_errors_for_next_request'.  This results in a healthy
~30% speedup for the involved requests.

2 years agoHandle errors while sending client events asynchronously
Po Lu [Sun, 26 Jun 2022 02:20:35 +0000 (10:20 +0800)]
Handle errors while sending client events asynchronously

* src/xterm.c (xm_send_drop_message)
(xm_send_top_level_enter_message, xm_send_drag_motion_message)
(xm_send_top_level_leave_message, x_dnd_send_enter)
(x_dnd_send_position, x_dnd_send_leave, x_dnd_send_drop): Avoid
sync to check for errors while sending client events.
(x_dnd_begin_drag_and_drop, handle_one_xevent, XTread_socket):
Clean up failable requests.
(x_request_can_fail): New functions.
(x_clean_failable_requests, x_ignore_errors_for_next_request)
(x_uncatch_errors): Clean up failable requests.
(x_error_handler): If a request is allowed to fail, just return.
(x_term_init): Set up new pointer.
* src/xterm.h (N_FAILABLE_REQUESTS): New macro.
(struct x_display_info): New field `failable_requests' and
associated next pointer.

2 years agoPort ‘make clean’ to Solaris 10
Paul Eggert [Sat, 25 Jun 2022 21:45:28 +0000 (16:45 -0500)]
Port ‘make clean’ to Solaris 10

* test/Makefile.in (CLEAN_XML_FILES): New macro.
(clean): Use it.

2 years agoPort distribution tarball to Solaris 10
Paul Eggert [Sat, 25 Jun 2022 19:51:28 +0000 (14:51 -0500)]
Port distribution tarball to Solaris 10

* make-dist (taropt): Use 'tar -H ustar' to generate a portable
tar file format instead of a GNU-specific format.  Needed now that
Emacs tarballs contain file names longer than 100 bytes, e.g.:
emacs-28.1/test/lisp/gnus/mml-sec-resources/private-keys-v1.d/C072AF82DCCCB9A7F1B85FFA10B802DC4ED16703.key
emacs-28.1/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el
Without this patch, extracting a tarball on Solaris 10 fails with
many diagnostics like “tar: ././@LongLink: typeflag 'L' not
recognized, converting to regular file”.

2 years agoPort test SUBDIRS to Solaris 10
Paul Eggert [Sat, 25 Jun 2022 18:09:22 +0000 (13:09 -0500)]
Port test SUBDIRS to Solaris 10

* test/Makefile.in (SUBDIRS): Port to traditional ‘find’, which
lacks -path.

2 years agoPacify Oracle Studio re xterm.c
Paul Eggert [Sat, 25 Jun 2022 18:00:28 +0000 (13:00 -0500)]
Pacify Oracle Studio re xterm.c

* src/xterm.c (xErrorHandler,  xIOErrorHandler):
New typedefs.
(xm_get_drag_window_1, x_connection_closed): Use them instead of
void *, since the C standard frowns on converting function
pointers to and from void *.  This pacifies Oracle Studio
diagnostics like “warning: assignment type mismatch: pointer to
void "=" pointer to function(pointer to struct _XDisplay {})\
returning int”.
(x_detect_pending_selection_requests, x_had_errors_p): Do not rely
on implicit conversion of a pointer to a bool return value; use !!
instead.  This pacifies Oracle Studio’s “warning: improper
pointer/integer combination: op "="”.
(xim_open_dpy) [HAVE_X11R6 && !HAVE_X11R6_XIM]: Do not use
xim_destroy_callback; configure.ac says “inoue@ainet.or.jp says
Solaris has a bug related to X11R6-style ## XIM support” and
Oracle Studio complains “warning: assignment type mismatch:
pointer to function(pointer to struct _XIC {}, pointer to char,
pointer\ to char) returning void "=" pointer to function(pointer
to struct _XIM {}, pointer to char, pointer to char) returning
void”.

2 years agoPacify Oracle Studio re print_vectorlike
Paul Eggert [Sat, 25 Jun 2022 16:44:33 +0000 (11:44 -0500)]
Pacify Oracle Studio re print_vectorlike

* src/print.c (print_vectorlike): Use explicit cast of function
pointer to void *, to pacify Oracle Studio 12.6’s “warning:
assignment type mismatch: pointer to void "=" pointer to
function(pointer to void) returning void”.  Admittedly this is
not strictly conforming C code even with the cast.

2 years agoPacify Oracle Studio re Time_to_position
Paul Eggert [Sat, 25 Jun 2022 16:41:07 +0000 (11:41 -0500)]
Pacify Oracle Studio re Time_to_position

* src/keyboard.c (Time_to_position): Use no-op position_to_Time to
pacify Oracle Studio 12.6’s “warning: initializer will be
sign-extended”.

2 years agoMake `M-q' work on the first line of a multi-line string again
Lars Ingebrigtsen [Sat, 25 Jun 2022 12:58:01 +0000 (14:58 +0200)]
Make `M-q' work on the first line of a multi-line string again

* lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Exclude the
quote marks from the region so that filling works (bug#56197).

2 years agoUpdate input_pending after deferring selection requests
Po Lu [Sat, 25 Jun 2022 12:07:35 +0000 (20:07 +0800)]
Update input_pending after deferring selection requests

* src/xterm.c (x_defer_selection_requests): If kbd_fetch_ptr
moved, update input_pending.  Bug found calling
`input-pending-p' inside the DND movement function.

2 years agoNew command recentf-open
Stefan Kangas [Sat, 25 Jun 2022 10:55:15 +0000 (12:55 +0200)]
New command recentf-open

* lisp/recentf.el (recentf-open): New command.  (Bug#56148)
(recentf): New alias.
(recentf, recentf-mode): Update documentation to focus more on the
list of recently opened files and ways of accessing it, instead of
focusing on the menu bar only.
(recentf-list, recentf-enabled-p): Minor doc fixes.

* doc/emacs/files.texi (File Conveniences): Update documentation.

2 years agoFix subr-x fix that was missed when re-reverting
Lars Ingebrigtsen [Sat, 25 Jun 2022 10:45:32 +0000 (12:45 +0200)]
Fix subr-x fix that was missed when re-reverting

* lisp/replace.el (require): Fix subr-x build warning.

2 years agoDon't error out on invalid literal key substitutions
Stefan Kangas [Sat, 25 Jun 2022 10:25:58 +0000 (12:25 +0200)]
Don't error out on invalid literal key substitutions

It would be backwards-incompatible to error out on invalid literal key
substitutions.  Consider this docstring fragment, where "\\`" should
have been escaped but wasn't:

    "Example value: \"\\(?:\\`[#.]\\)\\|\\(?:[#~]\\'\\)\"."

If we error out, we can't display this docstring at all.  However, it
is clearly better to display something in such cases, even if
suboptimal, than refusing to display anything at all.

* lisp/help.el (substitute-command-keys): Don't error out on invalid
literal key substitutions: just ignore them instead.
* test/lisp/help-tests.el
(help-tests-substitute-command-keys/literal-key-sequence-errors):
Delete test.
(help-tests-substitute-command-keys/literal-key-sequence-ignore-invalid):
New test.

2 years agoRe-fix build warnings about subr-x defsubsts
Lars Ingebrigtsen [Sat, 25 Jun 2022 10:20:05 +0000 (12:20 +0200)]
Re-fix build warnings about subr-x defsubsts

* lisp/term/haiku-win.el (require):
* lisp/progmodes/elisp-mode.el (require):
* lisp/isearch.el (require): Require subr-x at compile time, since
these use defsubsts/macros from there.

* lisp/emacs-lisp/subr-x.el (string-empty-p): Move from here...
* lisp/simple.el (string-empty-p): ... to here.  This is to help
with a build problem where files.el is using the defsubst, but
requiring subr-x.el at compile time leads to load errors.

2 years ago; Fix last change regarding 'record-all-keys'
Eli Zaretskii [Sat, 25 Jun 2022 09:33:45 +0000 (12:33 +0300)]
; Fix last change regarding 'record-all-keys'

* src/keyboard.c (syms_of_keyboard):
* etc/NEWS: Minor fixes of documentation of 'record-all-keys'.

2 years agoAvoid recording passwords' chars
Manuel Giraud [Tue, 14 Jun 2022 09:14:02 +0000 (11:14 +0200)]
Avoid recording passwords' chars

* lisp/cus-start.el (standard): New user custom `record-all-keys'.
* src/keyboard.c (syms_of_keyboard): Un-obsolete
`inhibit--record-char'.
* lisp/subr.el (read-passwd): Use `inhibit--record-char' to
inhibit passwords recording.

2 years ago; * CONTRIBUTE: Mention checks performed by commit hooks. (Bug#56108)
Eli Zaretskii [Sat, 25 Jun 2022 09:17:46 +0000 (12:17 +0300)]
; * CONTRIBUTE: Mention checks performed by commit hooks.  (Bug#56108)

2 years agoMinor optimization of the "abort redisplay" feature
Eli Zaretskii [Sat, 25 Jun 2022 07:46:10 +0000 (10:46 +0300)]
Minor optimization of the "abort redisplay" feature

* src/xdisp.c (init_iterator, set_iterator_to_next)
(redisplay_internal):
* src/syntax.c (scan_sexps_forward):
* src/regex-emacs.c (re_match_2_internal):
* src/bidi.c (bidi_fetch_char, bidi_paragraph_init)
(bidi_find_bracket_pairs, bidi_find_other_level_edge): Don't call
'update_redisplay_ticks' if aborting too-long redisplay is
disabled.  (Bug#45898)

2 years agoImplement image transform smoothing on Haiku
Po Lu [Sat, 25 Jun 2022 07:34:43 +0000 (07:34 +0000)]
Implement image transform smoothing on Haiku

* src/dispextern.h (struct image): New field
`use_bilinear_filtering'.
* src/haiku_draw_support.cc (BView_DrawBitmap): Accept it.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_draw_image_glyph_string):
* src/image.c (image_set_transform): Set it.

2 years agoFix false positive due to 'max-redisplay-ticks' feature
Eli Zaretskii [Sat, 25 Jun 2022 07:14:11 +0000 (10:14 +0300)]
Fix false positive due to 'max-redisplay-ticks' feature

* src/xdisp.c (redisplay_internal): Reset the tick count at end of
redisplay cycle.  (Bug#45898)

2 years agoFix non-XI2 build
Po Lu [Sat, 25 Jun 2022 06:38:54 +0000 (14:38 +0800)]
Fix non-XI2 build

* src/xterm.c (handle_one_xevent): Don't make `event' const when
passing it to RandR functions.  Also, update out of date
comment.

2 years ago; Fix typo in last change
Po Lu [Sat, 25 Jun 2022 06:24:18 +0000 (14:24 +0800)]
; Fix typo in last change

; * src/dispextern.h (struct image): Fix typo.

2 years agoImplement "flip" image transforms on Haiku
Po Lu [Sat, 25 Jun 2022 06:20:57 +0000 (06:20 +0000)]
Implement "flip" image transforms on Haiku

* src/dispextern.h (struct image): New field `transform',
`original_width' and `original_height'.
* src/haiku_draw_support.cc (BView_DrawMask): Rename to
`be_draw_image_mask' and fix coding style.
(rotate_bitmap_270, BBitmap_transform_bitmap, rotate_bitmap_90):
Delete functions.
(be_apply_affine_transform): New function.
(be_apply_inverse_transform): New function.

* src/haiku_support.h: Update prototypes.

* src/haikuterm.c (haiku_translate_transform): New function.
(haiku_draw_image_glyph_string): Use affine transforms to
implement images.

* src/image.c (image_set_transform): Implement using affine
transforms on Haiku too.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Sat, 25 Jun 2022 04:30:26 +0000 (06:30 +0200)]
Merge from origin/emacs-28

1f6750b53a Avoid treating number as an enum in the org manual

2 years agoRevert "Fix some byte-compilation warnings about subr-x"
Lars Ingebrigtsen [Fri, 24 Jun 2022 22:19:23 +0000 (00:19 +0200)]
Revert "Fix some byte-compilation warnings about subr-x"

This reverts commit cd479aa8bd498da4d7980a7fe7a37e238761482f.

This led to build failures when doing bootstraps.

2 years agoAllow toggling completion modes for `M-x' with `M-X'
Lars Ingebrigtsen [Fri, 24 Jun 2022 18:16:51 +0000 (20:16 +0200)]
Allow toggling completion modes for `M-x' with `M-X'

* doc/lispref/commands.texi (Interactive Call): Document it.
* lisp/minibuffer.el (minibuffer-local-must-match-map): Bind 'M-X'.

* lisp/simple.el (execute-extended-command-cycle): New command.
(read-extended-command): Use it to allow toggling (bug#47215).
(read-extended-command-1): Renamed from `read-extended-command'.
(execute-extended-command-for-buffer): Factored out most of the
code...
(command-completion--command-for-this-buffer-function): ... to
here.
(extended-command-versions): New variable.

This code is based on a patch by Felician Nemeth
<felician.nemeth@gmail.com>.

2 years agoMake ido sorting respect ido-case-fold
Lars Ingebrigtsen [Fri, 24 Jun 2022 12:54:43 +0000 (14:54 +0200)]
Make ido sorting respect ido-case-fold

* lisp/ido.el (ido-file-lessp):
(ido-file-extension-lessp): Respect ido-case-fold (bug#47127).

2 years agoAvoid treating number as an enum in the org manual
Stefan Kangas [Fri, 24 Jun 2022 17:18:22 +0000 (19:18 +0200)]
Avoid treating number as an enum in the org manual

* doc/misc/org.org (The Agenda Dispatcher): Avoid treating number as
enum.

2 years agoMake url-tramp-convert-tramp-to-url more robust
Michael Albinus [Fri, 24 Jun 2022 16:05:54 +0000 (18:05 +0200)]
Make url-tramp-convert-tramp-to-url more robust

* lisp/url/url-tramp.el (url-tramp-convert-tramp-to-url):
Prevent errors from not existing Tramp methods.

2 years agoFix logic error in Tramp, setting file ownership
Platon Pronko [Fri, 24 Jun 2022 15:18:19 +0000 (17:18 +0200)]
Fix logic error in Tramp, setting file ownership

* lisp/net/tramp.el (tramp-skeleton-write-region): Fix logic in
changing file ownership.  (Bug#56180)

Copyright-paperwork-exempt: yes

2 years agoAdd support for image flipping
Timo Taipalus [Fri, 24 Jun 2022 12:44:02 +0000 (14:44 +0200)]
Add support for image flipping

* lisp/image.el (image-map): Keybindings for flipping functions.
(image-flip-horizontally): New function that toggles image flipping
property.
(image-flip-vertically): New function that toggles image flipping
property and rotates image 180 degrees.
* src/image.c (syms_of_image): Add property.
(image_set_transform): Modify image rotation code to also horizontally
flip the image when the property is set.
* etc/NEWS: Add description.
* doc/lispref/display.texi (Image Descriptors): Document :flip
(bug#47095).

2 years agoFix some byte-compilation warnings about subr-x
Lars Ingebrigtsen [Fri, 24 Jun 2022 12:35:23 +0000 (14:35 +0200)]
Fix some byte-compilation warnings about subr-x

* lisp/term/haiku-win.el (require):
* lisp/replace.el (require):
* lisp/progmodes/elisp-mode.el (require):
* lisp/isearch.el (require):
* lisp/files.el (require): Require subr-x when compiling.

2 years agoFix imenu popup syntax
Lars Ingebrigtsen [Fri, 24 Jun 2022 12:11:45 +0000 (14:11 +0200)]
Fix imenu popup syntax

* lisp/imenu.el (imenu--create-keymap): Fix menu syntax
(bug#56185).

2 years agoMerge from origin/emacs-28
Stefan Kangas [Fri, 24 Jun 2022 11:52:51 +0000 (13:52 +0200)]
Merge from origin/emacs-28

a772c0b852 ; Fix typos: prefer US spelling.

# Conflicts:
# doc/misc/modus-themes.org

2 years agoFix assertion violation when 'max-redisplay-ticks' is set too low
Eli Zaretskii [Fri, 24 Jun 2022 11:14:41 +0000 (14:14 +0300)]
Fix assertion violation when 'max-redisplay-ticks' is set too low

* src/xdisp.c (update_redisplay_ticks): Disable 'scrolling_window'
optimization in 'update_window' when redisplay of a window is
aborted.  (Bug#56184)

2 years agoAdd NEWS entry about kill-buffer change
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:57:02 +0000 (11:57 +0200)]
Add NEWS entry about kill-buffer change

2 years agoBytecode opcode comments update
Mattias Engdegård [Fri, 24 Jun 2022 09:48:42 +0000 (11:48 +0200)]
Bytecode opcode comments update

This is a cosmetic change only; there is no change in behaviour.

* lisp/emacs-lisp/bytecomp.el:
* src/bytecode.c (BYTE_CODES, exec_byte_code):
Update and/or remove incorrect, outdated or useless comments.
Clarify.  Reorder where appropriate.  Rename Bsave_current_buffer to
Bsave_current_buffer_OBSOLETE and Bsave_current_buffer_1 to
Bsave_current_buffer, reflecting the state since 1996.

2 years agoUpdate seq.el comment
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:15:19 +0000 (11:15 +0200)]
Update seq.el comment

* lisp/emacs-lisp/seq.el: Update comment.

2 years agoAllow `kill-buffer' query to save the buffer first
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:04:03 +0000 (11:04 +0200)]
Allow `kill-buffer' query to save the buffer first

* lisp/loadup.el ("emacs-lisp/rmc"): Preload.

* lisp/simple.el (kill-buffer--possibly-save): New function to
offer to save the buffer before killing (bug#47075).

* src/buffer.c (Fkill_buffer): Call the new function to query the
user.
(syms_of_buffer): Define symbol.

2 years agoPreload seq
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:02:14 +0000 (11:02 +0200)]
Preload seq

* lisp/loadup.el ("emacs-lisp/seq"): Preload seq since it's now
almost impossible to do anything in Emacs that doesn't result in
seq being loaded -- for instance, visiting a .txt file or an .el
file, so this will speed up Emacs usage for basically everybody.

2 years agoAllow read-multiple-choice to do long-form answers
Lars Ingebrigtsen [Fri, 24 Jun 2022 09:00:06 +0000 (11:00 +0200)]
Allow read-multiple-choice to do long-form answers

* doc/lispref/commands.texi (Reading One Event): Document it.

* lisp/emacs-lisp/rmc.el (read-multiple-choice): Allow using
long-form answers instead of single character ones.
(read-multiple-choice--long-answers): New function.
(read-multiple-choice--short-answers): Refactored out from the
main function.

2 years agoFix cl-generic bootstrap problems
Lars Ingebrigtsen [Fri, 24 Jun 2022 08:54:01 +0000 (10:54 +0200)]
Fix cl-generic bootstrap problems

* lisp/sqlite-mode.el (require):
* lisp/net/eudc.el (require):
* lisp/arc-mode.el (require): Require subr-x, since these files
are using macros from there.
* lisp/emacs-lisp/subr-x.el (with-memoization): Move from here...
* lisp/subr.el (with-memoization): ... to here, as it's used from
the preloaded cl-generic.el file.

* lisp/emacs-lisp/cl-generic.el (cl--generic-compiler): Don't use
the autoloaded `byte-compile' function during bootstrap.
(cl--generic-get-dispatcher): Don't require subr-x, either.

cl-generic has been preloaded since 2015, and most usages of it (in
preloaded files) work fine.  In particular, using `cl-defgeneric' is
unproblematic.  However, `cl-defmethod' would end up pulling in the
byte compiler (at load time), which would make it impossible to use
`cl-defmethod' in pre-loaded files, and this change fixes that (but
possibly not in the most self-evidently correct way).

2 years agoMake warning about require/autoload while bootstrapping not error out
Lars Ingebrigtsen [Fri, 24 Jun 2022 08:45:34 +0000 (10:45 +0200)]
Make warning about require/autoload while bootstrapping not error out

* src/fns.c (Frequire):
* src/eval.c (Fautoload_do_load): Avoid further errors while
outputting the error about not being able to autoload/require
while bootstrapping.

2 years agoMake debug-early-backtrace more resilient
Lars Ingebrigtsen [Fri, 24 Jun 2022 08:43:41 +0000 (10:43 +0200)]
Make debug-early-backtrace more resilient

* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Allow
outputting backtraces during bootstrap.

2 years agoFix handling of mouse motion across screens during drag-and-drop
Po Lu [Fri, 24 Jun 2022 08:41:12 +0000 (16:41 +0800)]
Fix handling of mouse motion across screens during drag-and-drop

* src/xterm.c (x_dnd_fill_empty_target): New function.
(handle_one_xevent): Fill empty target if the event didn't come
from the same screen.

2 years ago; * etc/PROBLEMS: Fix errors in last change.
Po Lu [Fri, 24 Jun 2022 08:31:45 +0000 (16:31 +0800)]
; * etc/PROBLEMS: Fix errors in last change.

2 years agoFix previous nnimap header fetching change
Lars Ingebrigtsen [Fri, 24 Jun 2022 06:57:30 +0000 (08:57 +0200)]
Fix previous nnimap header fetching change

* lisp/gnus/nnimap.el (nnimap-retrieve-headers): Ensure that the
splitting works.

2 years agoMerge branch 'abort-redisplay'
Eli Zaretskii [Fri, 24 Jun 2022 07:44:44 +0000 (10:44 +0300)]
Merge branch 'abort-redisplay'

This allows abandoning the redisplay of a window
that takes too long to complete.  Bug#45898
* src/xdisp.c (update_redisplay_ticks): New function.
(init_iterator, set_iterator_to_next): Call
'update_redisplay_ticks'.
(syms_of_xdisp) <max_redisplay_ticks>: New variable.
<list_of_error>: Remove 'void-variable': it is no longer needed,
since 'calc_pixel_width_or_height' can no longer signal a
void-variable error, and it gets in the way of aborting
redisplay via 'redisplay_window_error'.
* src/keyboard.c (command_loop_1): Reinitialize the tick count
before executing each command in the loop.
* src/syntax.c (scan_sexps_forward): Call 'update_redisplay_ticks'
after finishing the loop.
* src/dispnew.c (make_current): Make sure enabled rows of the
current matrix have a valid hash, even if redisplay of a window
was aborted due to slowness.  This avoids assertion violations in
'scrolling_window' due to the wrong hash value.
* src/xdisp.c (display_working_on_window_p): New global variable.
(unwind_display_working_on_window): New function.
* src/keyboard.c (command_loop_1): Reset
'display_working_on_window_p' before and after executing commands.
* src/window.c (Frecenter, window_scroll, displayed_window_lines):
* src/indent.c (Fvertical_motion): Set
'display_working_on_window_p' before calling 'start_display'.
* src/syntax.c (scan_sexps_forward): Call 'update_redisplay_ticks'
after finishing the loop.
* src/regex-emacs.c (re_match_2_internal):
* src/bidi.c (bidi_find_bracket_pairs, bidi_fetch_char)
(bidi_paragraph_init, bidi_find_other_level_edge): Update the
redisplay tick count as appropriate, when moving the iterator by
one character position actually requires to examine many more
positions.
* src/xdisp.c (redisplay_window_error): Show messages about
aborted redisplay of a window as delayed-warnings.

* doc/emacs/trouble.texi (DEL Does Not Delete): Move to the end of
the chapter.  This issue is no longer frequent or important as it
was back in Emacs 20 days.
(Long Lines): Document 'max-redisplay-ticks'.
* doc/emacs/emacs.texi (Top): Update the detailed menu.

* etc/NEWS: Announce 'max-redisplay-ticks'.

2 years ago; * etc/NEWS: Minor update of description of 'max-redisplay-ticks'.
Eli Zaretskii [Fri, 24 Jun 2022 07:23:16 +0000 (10:23 +0300)]
; * etc/NEWS: Minor update of description of 'max-redisplay-ticks'.

2 years ago; * etc/PROBLEMS: Update the touch-gestures section.
Eli Zaretskii [Fri, 24 Jun 2022 07:09:39 +0000 (10:09 +0300)]
; * etc/PROBLEMS: Update the touch-gestures section.

2 years agoImprove grabbing detection with multiple master devices (MPX)
Po Lu [Fri, 24 Jun 2022 02:57:35 +0000 (10:57 +0800)]
Improve grabbing detection with multiple master devices (MPX)

* src/frame.c (gui_mouse_grabbed): Respect any_grab_hook.
* src/termhooks.h (GCALIGNED_STRUCT): New hook `any_grab_hook'.
* src/xterm.c (x_have_any_grab): New function.
(x_create_terminal): Define hook on XI2 builds.

2 years agoSimplify XI event state conversion
Po Lu [Fri, 24 Jun 2022 01:49:14 +0000 (09:49 +0800)]
Simplify XI event state conversion

* src/xterm.c (xi_convert_button_state, xi_convert_event_state):
New functions.
(handle_one_xevent): Reduce duplicate code for converting XI
state and button state into X state.

2 years ago; Fix typos: prefer US spelling.
Stefan Kangas [Thu, 23 Jun 2022 20:03:50 +0000 (22:03 +0200)]
; Fix typos: prefer US spelling.

2 years ago* lisp/net/browse-url.el: Doc fix; recommend keymap-* functions.
Stefan Kangas [Thu, 23 Jun 2022 19:51:19 +0000 (21:51 +0200)]
* lisp/net/browse-url.el: Doc fix; recommend keymap-* functions.

2 years ago* lisp/recentf.el (recentf-auto-cleanup): Clarify docstring.
Stefan Kangas [Thu, 23 Jun 2022 19:04:59 +0000 (21:04 +0200)]
* lisp/recentf.el (recentf-auto-cleanup): Clarify docstring.

2 years agoRemove unused function in bytecomp.el
Mattias Engdegård [Thu, 23 Jun 2022 12:33:46 +0000 (14:33 +0200)]
Remove unused function in bytecomp.el

* lisp/emacs-lisp/bytecomp.el (byte-compile-delete-first): Remove.

2 years ago; * lisp/uniquify.el: Remove incorrect comment.
Stefan Kangas [Thu, 23 Jun 2022 13:12:47 +0000 (15:12 +0200)]
; * lisp/uniquify.el: Remove incorrect comment.

2 years agoSave desktop-save-mode when changed from menu
Gerd Moellmann [Thu, 23 Jun 2022 12:38:13 +0000 (14:38 +0200)]
Save desktop-save-mode when changed from menu

* lisp/menu-bar.el (menu-bar-options-save): Save desktop-save-mode
(bug#56156).

2 years agoTag shortcut commands for recentf-dialog-mode
Stefan Kangas [Thu, 23 Jun 2022 11:41:07 +0000 (13:41 +0200)]
Tag shortcut commands for recentf-dialog-mode

* lisp/recentf.el (recentf--shortcuts-keymap): Add interactive mode
tags for 'recentf-dialog-mode' specific commands.

2 years agoPrefer defvar-keymap and keymap-set in recentf.el
Stefan Kangas [Thu, 23 Jun 2022 10:20:38 +0000 (12:20 +0200)]
Prefer defvar-keymap and keymap-set in recentf.el

* lisp/recentf.el (recentf-mode-map): Prefer defvar-keymap.
(recentf--shortcuts-keymap): Prefer keymap-set.

2 years agoUse shortened filenames in recentf-mode
Stefan Kangas [Thu, 23 Jun 2022 09:00:19 +0000 (11:00 +0200)]
Use shortened filenames in recentf-mode

* lisp/recentf.el (recentf-filename-handlers): Set to
'abbreviate-file-name' to get shortened names by default.  (Bug#56123)

2 years agoRevert "Allow shortening filenames in recentf-mode menu"
Stefan Kangas [Thu, 23 Jun 2022 08:55:45 +0000 (10:55 +0200)]
Revert "Allow shortening filenames in recentf-mode menu"

This reverts commit 32906819addde1aa952d4718699d332d3a58b004.

2 years agoRevert "Use short file names by default in recentf menu"
Stefan Kangas [Thu, 23 Jun 2022 08:55:04 +0000 (10:55 +0200)]
Revert "Use short file names by default in recentf menu"

This reverts commit ec9228eb81c0a89b18480dfff18cc9afdc3d0884.

2 years agoEnsure that nnimap doesn't send too long lines to the server
Lars Ingebrigtsen [Thu, 23 Jun 2022 09:22:29 +0000 (11:22 +0200)]
Ensure that nnimap doesn't send too long lines to the server

* lisp/gnus/nnimap.el (nnimap-retrieve-headers): Don't send
too-long lines to the server (bug#56138).

2 years ago; * src/xterm.c (x_dnd_send_leave): Remove debugging code.
Po Lu [Thu, 23 Jun 2022 07:35:37 +0000 (15:35 +0800)]
; * src/xterm.c (x_dnd_send_leave): Remove debugging code.

2 years agoMinor fixes to last change
Po Lu [Thu, 23 Jun 2022 05:58:16 +0000 (13:58 +0800)]
Minor fixes to last change

* src/pgtkselect.c (pgtk_get_window_property): Add 1 to xdata
when it is GdkAtom.
* src/pgtkterm.c (drag_leave): Initialize inev.ie.

2 years agoMake DND from other GTK programs work on Wayland
Po Lu [Thu, 23 Jun 2022 05:57:23 +0000 (13:57 +0800)]
Make DND from other GTK programs work on Wayland

* lisp/pgtk-dnd.el (pgtk-dnd-handle-gdk): Try to keep the
selection contents in extra-data during a motion event.

2 years agoAllow dropping more data types on PGTK
Po Lu [Thu, 23 Jun 2022 05:38:30 +0000 (13:38 +0800)]
Allow dropping more data types on PGTK

* lisp/loadup.el (featurep): Load `pgtk-dnd'.
* lisp/pgtk-dnd.el: New file.
(pgtk-dnd-test-function, pgtk-dnd-types-alist)
(pgtk-dnd-known-types, pgtk-dnd-use-offix-drop)
(pgtk-dnd-current-state, pgtk-get-selection-internal)
(pgtk-register-dnd-targets, pgtk-dnd-empty-state)
(pgtk-dnd-init-frame, pgtk-dnd-get-state-cons-for-frame)
(pgtk-dnd-get-state-for-frame, pgtk-dnd-default-test-function)
(pgtk-dnd-current-type, pgtk-dnd-forget-drop)
(pgtk-dnd-maybe-call-test-function, pgtk-dnd-save-state)
(pgtk-dnd-handle-moz-url, pgtk-dnd-insert-utf8-text)
(pgtk-dnd-insert-utf16-text, pgtk-dnd-insert-ctext)
(pgtk-dnd-handle-uri-list, pgtk-dnd-handle-file-name)
(pgtk-dnd-choose-type, pgtk-dnd-drop-data)
(pgtk-dnd-handle-drag-n-drop-event, pgtk-update-drop-status)
(pgtk-drop-finish, pgtk-dnd-handle-gdk, pgtk-dnd): New variables
and functions and library.

* lisp/term/pgtk-win.el (special-event-map): Load
`drag-n-drop-event'.
(after-make-frame-functions): Register DND after make frame
functions.

* src/emacs.c (main): Stop calling empty init_pgtkterm function.

* src/pgtkselect.c (Fpgtk_register_dnd_targets, Fpgtk_drop_finish)
(Fpgtk_update_drop_status): New functions.
(syms_of_pgtkselect): Register new functions.
* src/pgtkterm.c (struct event_queue_t): Fix coding style of
definition.
(symbol_to_drag_action, drag_action_to_symbol)
(pgtk_update_drop_status, pgtk_finish_drop): New functions.
(drag_data_received): Delete function.
(pgtk_set_event_handler): Register for DND correctly.
(syms_of_pgtkterm): New defsyms for DND types.
(init_pgtkterm): Delete function.

* src/pgtkterm.h: Update prototypes, fix prototype coding style.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Thu, 23 Jun 2022 04:30:22 +0000 (06:30 +0200)]
Merge from origin/emacs-28

a3f294b37f Improve last change in autotype.texi

2 years agoDon't send XdndPosition before XdndStatus arrives
Po Lu [Thu, 23 Jun 2022 03:31:10 +0000 (11:31 +0800)]
Don't send XdndPosition before XdndStatus arrives

* src/xterm.c (x_dnd_send_position): Set pending DND message if
target is right.
(x_dnd_send_leave): Clear pending status target.
(x_dnd_begin_drag_and_drop): Clear new flags.
(handle_one_xevent): Respect those flags.

2 years agoUpdate device-specific grab during drag-and-drop
Po Lu [Thu, 23 Jun 2022 00:53:55 +0000 (08:53 +0800)]
Update device-specific grab during drag-and-drop

* src/xterm.c (x_detect_focus_change): Fix typo.
(handle_one_xevent): Set device if DND is in progress and update
device->grab.

2 years agoMake recentf-elements obsolete
Stefan Kangas [Wed, 22 Jun 2022 23:12:05 +0000 (01:12 +0200)]
Make recentf-elements obsolete

* lisp/recentf.el (recentf-elements): Make obsolete.  Update
callers.

2 years agoConvert several defsubst to defun in recentf.el
Stefan Kangas [Wed, 22 Jun 2022 23:00:54 +0000 (01:00 +0200)]
Convert several defsubst to defun in recentf.el

* lisp/recentf.el (recentf-enabled-p, recentf-string-equal)
(recentf-string-lessp, recentf-push, recentf-expand-file-name)
(recentf-add-file, recentf-remove-if-non-kept)
(recentf-digit-shortcut-command-name, recentf-elements)
(recentf-menu-bar, recentf-sort-ascending)
(recentf-sort-descending, recentf-sort-basenames-ascending)
(recentf-sort-basenames-descending)
(recentf-sort-directories-ascending)
(recentf-sort-directories-descending)
(recentf-show-basenames-ascending)
(recentf-show-basenames-descending): Change from defsubst to
defun.