]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoRewrite hl-line-mode
dickmao [Sun, 20 Mar 2022 15:34:56 +0000 (11:34 -0400)]
Rewrite hl-line-mode

The fashion of dual global and minor modes, each managing a replica of
state, has long been outmoded by globalized minor modes (nee
easy-mmode-define-global-mode) around the turn of the century.

* lisp/calendar/todo-mode.el (todo-toggle-item-highlighting,
todo-hl-line-range, todo-modes-set-2): Adapt to new
hl-line-highlight-hook.
* lisp/hl-line.el (hl-line-overlay): Rename hl-line--overlay.
(global-hl-line-overlay, global-hl-line-overlays,
global-hl-line-sticky-flag, hl-line-overlay-buffer,
hl-line-range-function): Obsolesce.
(hl-line--overlay): Erstwhile hl-line-overlay.
(hl-line, hl-line-face): Consolidate.
(hl-line-sticky-flag): Say less (Gen Z Hospital).
(hl-line-overlay-priority): Make this a custom.
(hl-line-highlight-hook): Prefer hook over specialized
hl-line-range-function.
(hl-line-mode): Say less (Gen Z Hospital).
(hl-line-make-overlay): Remove
(hl-line-highlight, hl-line-unhighlight): Rewrite.
(hl-line-maybe-unhighlight): Remove.
(hl-line-turn-on): Necessary for globalized minor mode.
(global-hl-line-mode, global-hl-line-highlight,
global-hl-line-highlight-all, global-hl-line-unhighlight,
global-hl-line-maybe-unhighlight, global-hl-line-unhighlight-all):
Prefer globalized minor mode.
(hl-line-move, hl-line-unload-function): Remove.
* test/lisp/calendar/todo-mode-tests.el (todo-test-item-highlighting,
todo-test-done-items-separator06-bol,
todo-test-done-items-separator06-eol,
todo-test-done-items-separator07): Adapt to consolidated face.

2 years agoAdd a new face shr-code
Lars Ingebrigtsen [Mon, 21 Mar 2022 15:01:33 +0000 (16:01 +0100)]
Add a new face shr-code

* lisp/net/shr.el (shr-code): New face (bug#54480).
(shr-tag-code): Use it.

2 years ago; * src/comp.c: Update a comment.
Andrea Corallo [Mon, 21 Mar 2022 14:04:49 +0000 (15:04 +0100)]
; * src/comp.c: Update a comment.

2 years agoMinor fixes to Haiku DND support
Po Lu [Mon, 21 Mar 2022 09:00:38 +0000 (09:00 +0000)]
Minor fixes to Haiku DND support

* src/haiku_support.cc (MessageReceived): If source is remote,
don't test window ID.
(MouseMoved): Don't send mouse motion if dragging.
(be_drag_message): Return true if quit-flag.
* src/haiku_support.h: Update prototypes.
* src/haikuselect.c (haiku_should_quit_drag): New function.
(Fhaiku_drag_message): If rc is true, quit.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Mon, 21 Mar 2022 05:30:40 +0000 (06:30 +0100)]
Merge from origin/emacs-28

f15922a57c Update to Org 9.5.2-25-gaf6f12
9fcdd5b63f Improve doc strings of read-char-from-minibuffer-insert-* ...

2 years agoImprove handling of input methods during drag-and-drop
Po Lu [Mon, 21 Mar 2022 03:48:36 +0000 (11:48 +0800)]
Improve handling of input methods during drag-and-drop

* src/xterm.c (x_dnd_cleanup_drag_and_drop)
(x_dnd_begin_drag_and_drop): Stop removing IC and filter events
before dispatching them.
(x_filter_event): Actually filter events during DND.
(XTread_socket): Verify GenericEvents are actually input
extension events before ignoring them.

2 years agoMake quitting work while DND is waitng for finish
Po Lu [Mon, 21 Mar 2022 01:32:54 +0000 (09:32 +0800)]
Make quitting work while DND is waitng for finish

* src/xterm.c (x_dnd_cleanup_drag_and_drop):
(x_dnd_begin_drag_and_drop, handle_one_xevent)
(x_free_frame_resources): Clear waiting for finish flag.
(x_filter_event): Don't filter if waiting for DND finish as
well.

2 years agoUpdate to Org 9.5.2-25-gaf6f12
Kyle Meyer [Mon, 21 Mar 2022 01:31:32 +0000 (21:31 -0400)]
Update to Org 9.5.2-25-gaf6f12

2 years agoSupport indentation of Ruby pattern matching expressions
Dmitry Gutov [Mon, 21 Mar 2022 01:18:36 +0000 (03:18 +0200)]
Support indentation of Ruby pattern matching expressions

* lisp/progmodes/ruby-mode.el (ruby-smie-grammar, ruby-smie-rules)
(ruby-block-mid-keywords): Treat 'in' token similarly to 'when'.

* test/lisp/progmodes/ruby-mode-resources/ruby.rb:
Add indentation example.

2 years agoFix imap fetching multiple mailboxes (bug#54158)
Andrew G Cohen [Sun, 20 Mar 2022 05:49:37 +0000 (13:49 +0800)]
Fix imap fetching multiple mailboxes (bug#54158)

* lisp/gnus/mail-source.el (mail-source-fetch-imap): Variables
mailbox-source-string and remove should be reset for each mailbox.

2 years ago* etc/NEWS: Mention new hook 'minibuffer-lazy-highlight-setup'.
Juri Linkov [Sun, 20 Mar 2022 20:27:17 +0000 (22:27 +0200)]
* etc/NEWS: Mention new hook 'minibuffer-lazy-highlight-setup'.

2 years agoAdd lazy highlight to 'isearch-edit-string'
Augusto Stoffel [Sun, 20 Mar 2022 19:49:32 +0000 (20:49 +0100)]
Add lazy highlight to 'isearch-edit-string'

* lisp/isearch.el (isearch-edit-string): Activate lazy highlight and
lazy count, provided 'isearch-lazy-highlight' respectively
'isearch-lazy-count' are non-nil.

2 years agoAllow lazy highlight and match count while reading from minibuffer
Augusto Stoffel [Sun, 20 Mar 2022 19:46:31 +0000 (20:46 +0100)]
Allow lazy highlight and match count while reading from minibuffer

* lisp/isearch.el (minibuffer-lazy-highlight-setup): New function, can
be added to 'minibuffer-setup-hook' to enable lazy highlight and count
while reading from minibuffer.
(minibuffer-lazy-count-format, minibuffer-lazy-highlight-transform,
minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count,
minibuffer-lazy-highlight--after-change,
minibuffer-lazy-highlight--exit): Auxiliary variables and functions
implementing the lazy highlight functionality while reading from
minibuffer.

2 years agoNew hook, lazy-count-update-hook
Augusto Stoffel [Sun, 20 Mar 2022 19:43:10 +0000 (20:43 +0100)]
New hook, lazy-count-update-hook

* lisp/isearch.el (lazy-count-update-hook): New hook allowing to
display the lazy count in special ways.
(isearch-lazy-highlight-new-loop,
isearch-lazy-highlight-buffer-update): Run `lazy-count-update-hook' at
appropriate times.
* lisp/comint.el (comint-history-isearch-setup,
comint-history-isearch-end): Make sure no lazy count is displayed.
* lisp/simple.el (minibuffer-history-isearch-setup): Make sure no lazy
count is displayed.

2 years ago* lisp/tab-bar.el (tab-bar-new-tab-to): Don't funcall const values.
Juri Linkov [Sun, 20 Mar 2022 18:59:04 +0000 (20:59 +0200)]
* lisp/tab-bar.el (tab-bar-new-tab-to): Don't funcall const values.

Filter out the values 'clone' and 'window' of 'tab-bar-new-tab-choice'
from function call.

2 years agoExtend connection-local variables example in Elisp manual
Michael Albinus [Sun, 20 Mar 2022 18:15:53 +0000 (19:15 +0100)]
Extend connection-local variables example in Elisp manual

* doc/lispref/variables.texi (Connection Local Variables):
Explain, how to append variable settings to an existing profile.

2 years agoRemove duplicate INLINE_HEADER_BEGIN
Paul Eggert [Sun, 20 Mar 2022 17:46:06 +0000 (10:46 -0700)]
Remove duplicate INLINE_HEADER_BEGIN

* src/thread.h: Remove duplicate INLINE_HEADER_BEGIN.
Problem reportd by Mattias Engdegård.

2 years agoImprove doc strings of read-char-from-minibuffer-insert-* commands
Eli Zaretskii [Sun, 20 Mar 2022 16:21:44 +0000 (18:21 +0200)]
Improve doc strings of read-char-from-minibuffer-insert-* commands

* lisp/subr.el (read-char-from-minibuffer-insert-char)
(read-char-from-minibuffer-insert-other): Clarify the doc strings.
(Bug#54479)

2 years agoFix confusion of wanted action with actual action on X
Po Lu [Sun, 20 Mar 2022 13:19:31 +0000 (21:19 +0800)]
Fix confusion of wanted action with actual action on X

* src/xterm.c (x_dnd_begin_drag_and_drop)
(x_dnd_update_state, handle_one_xevent): Differentiate between
wanted action and chosen action correctly.

2 years agoFix wrong password stored in Tramp
Manuel Giraud [Sun, 20 Mar 2022 10:08:31 +0000 (11:08 +0100)]
Fix wrong password stored in Tramp

* lisp/net/tramp.el (tramp-process-actions):
Unset `tramp-password-save-function'.

2 years agoMake DND between frames work properly
Po Lu [Sun, 20 Mar 2022 08:21:45 +0000 (16:21 +0800)]
Make DND between frames work properly

* src/xterm.c (handle_one_xevent): Don't wait for a finish event
when dropping on top of another Emacs frame.

2 years agoImprove compliance with version 5 of the XDND specification
Po Lu [Sun, 20 Mar 2022 07:00:36 +0000 (15:00 +0800)]
Improve compliance with version 5 of the XDND specification

* src/xterm.c (x_dnd_cleanup_drag_and_drop): New function.
(x_dnd_begin_drag_and_drop): Handle selection request events
immediately.
(handle_one_xevent): Wait for XdndFinished events and return the
action chosen there.

2 years agoFix some crashes in shut_down_emacs on Haiku
Po Lu [Sun, 20 Mar 2022 05:53:30 +0000 (05:53 +0000)]
Fix some crashes in shut_down_emacs on Haiku

* src/emacs.c (shut_down_emacs): Stop quitting be app, since
it's not always there.

2 years agoImplement `haiku_delete_terminal'
Po Lu [Sun, 20 Mar 2022 05:51:19 +0000 (05:51 +0000)]
Implement `haiku_delete_terminal'

* src/haikuterm.c (haiku_delete_terminal): Actually delete the
terminal instead of aborting.

2 years agoCheck list tail properly in x-begin-drag
Po Lu [Sun, 20 Mar 2022 04:51:46 +0000 (12:51 +0800)]
Check list tail properly in x-begin-drag

* src/xfns.c (Fx_begin_drag): Check that TARGETS is actually a
proper list.
* src/xterm.c (x_dnd_update_state): Remove debugging code.

2 years agoFix crash on some compositing managers
Po Lu [Sun, 20 Mar 2022 03:23:11 +0000 (11:23 +0800)]
Fix crash on some compositing managers

* src/xterm.c (x_dnd_get_target_window): Catch errors around
CompositeReleaseOverlayWindow.

2 years agoImprove behaviour of drag-n-drop during window manager operations
Po Lu [Sun, 20 Mar 2022 01:53:52 +0000 (09:53 +0800)]
Improve behaviour of drag-n-drop during window manager operations

* src/xterm.c (x_dnd_begin_drag_and_drop): Select for some
events on the root window.
(x_dnd_update_state): New function.
(handle_one_xevent): Call that function when we get some events
from the root window substructure or the window manager.
(x_term_init): New atom `_NET_CLIENT_LIST_STACKING'.
* src/xterm.h (struct x_display_info): New atom
`_NET_CLIENT_LIST_STACKING'.

2 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 19 Mar 2022 20:18:47 +0000 (22:18 +0200)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

2 years agoPort to gcc -D EMACS_EXTERN_INLINE
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
Port to gcc -D EMACS_EXTERN_INLINE

* src/comp.h, src/thread.h: Add INLINE_HEADER_BEGIN and
INLINE_HEADER_END, since it uses INLINE.
* src/emacs.c: Include these two files.

2 years agovalid_sp inline fix
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
valid_sp inline fix

* src/bytecode.c (valid_sp): static, not INLINE, as INLINE
should be used only in headers and between INLINE_HEADER_BEGIN
and INLINE_HEADER_END.  No need for ‘inline’ here.

2 years agoSimplify alloc.c static function decls
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
Simplify alloc.c static function decls

* src/alloc.c: Omit unnecessary static function declarations.
Don’t use ‘inline static’ as the C standard says that keyword
order is obsolescent.  Anyway, no need for ‘inline’ as compilers
inline without it well enough.

2 years agoMake native helper functions static
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
Make native helper functions static

These don’t need to be extern, even with -flto, since
their addresses are taken.
* src/comp.c (helper_unwind_protect, helper_unbind_n)
(helper_save_restriction, helper_GET_SYMBOL_WITH_POSITION)
(helper_PSEUDOVECTOR_TYPEP_XUNTAG): Now static.

2 years agoRemove unused fns/data and make fns static
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
Remove unused fns/data and make fns static

* src/comp.c (saved_sigset, helper_temp_output_buffer_setup):
Remove; unused.
* src/comp.c (logfile, helper_link_table):
* src/fns.c (hashfn_equal, hashfn_eql):
* src/frame.c (frame_windows_min_size):
* src/gnutls.c (emacs_gnutls_global_init):
* src/minibuf.c (Vcommand_loop_level_list):
* src/syntax.c (syntax_code_spec):
* src/timefns.c (time_overflow):
* src/xterm.c (x_xrender_color_from_gc_foreground)
(x_display_set_last_user_time):
Now static, since it’s not used elsewhere.
* src/xterm.c (x_xrender_color_from_gc_foreground)
(x_xrender_color_from_gc_background): Move earlier to avoid
forward use.
(x_xrender_color_from_gc_foreground): Do not define unless
!defined USE_CAIRO && (RENDER_MAJOR > 0 || RENDER_MINOR >= 2),
since it’s not used otherwise.

2 years agoUse filenvercmp instead of doing it by hand
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
Use filenvercmp instead of doing it by hand

* src/fns.c (Fstring_version_lessp): Use filenvercmp,
not string_version_cmp.
(string_version_cmp): Remove; no longer used.

2 years agoOmit unnecessary code when !HAVE_NATIVE_COMP
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
Omit unnecessary code when !HAVE_NATIVE_COMP

* src/decompress.c (MD5_BLOCKSIZE, acc_buf, acc_size)
(accumulate_and_process_md5, final_process_md5, md5_gz_stream):
* src/dynlib.c (dynlib_open_for_eln, dynlib_close) [!WINDOWSNT]:
* src/fileio.c (internal_delete_file_1, internal_delete_file):
Define only if HAVE_NATIVE_COMP && WINDOWSNT,
as they’re not used otherwise.

2 years agoRemove internal_condition_case_[345]
Paul Eggert [Sat, 19 Mar 2022 19:35:04 +0000 (12:35 -0700)]
Remove internal_condition_case_[345]

* src/comp.c (directory_files_matching) [WINDOWSNT]: New function.
(eln_load_path_final_clean_up) [WINDOWSNT]: Use it.
This removes the need for internal_condition_case_5.
* src/eval.c (internal_condition_case_3)
(internal_condition_case_4, internal_condition_case_5): Remove.
The first two were never used; the last only in now-removed code.

2 years agoRemove sanitize_window_sizes
Paul Eggert [Sat, 19 Mar 2022 19:35:03 +0000 (12:35 -0700)]
Remove sanitize_window_sizes

* src/window.c (sanitize_window_sizes): Remove; no-longer-used.
A previous refactoring moved this to Lisp without removing the C code.

2 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 19 Mar 2022 15:19:19 +0000 (17:19 +0200)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

2 years agoMake `command-modes' work for (native-compiled) subrs, too
Lars Ingebrigtsen [Sat, 19 Mar 2022 14:11:15 +0000 (15:11 +0100)]
Make `command-modes' work for (native-compiled) subrs, too

* lisp/emacs-lisp/comp.el (comp-func): Add a command-modes slot.
(comp-spill-lap-function, comp-intern-func-in-ctxt): Fill it.
(comp-emit-for-top-level, comp-emit-lambda-for-top-level): Use it.

* src/alloc.c (mark_object): Mark the command_modes slot.

* src/comp.c (make_subr): Add a command_modes parameter.
(Fcomp__register_lambda): Use it.
(Fcomp__register_subr): Ditto.

* src/data.c (Fcommand_modes): Output the command_modes data for subrs
(bug#54437).

* src/lisp.h (GCALIGNED_STRUCT): Add a command_modes slot.

* src/pdumper.c (dump_subr): Update hash.
(dump_subr): Dump the command_modes slot.

2 years agoImprove protection against faulty clients during DND
Po Lu [Sat, 19 Mar 2022 10:46:50 +0000 (18:46 +0800)]
Improve protection against faulty clients during DND

* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(xdnd_send_leave, x_dnd_send_drop): Catch errors around call to
XSendEvent.  The target window could be gone.

2 years ago; * test/lisp/erc/erc-tests.el (erc--switch-to-buffer): Fix test failure.
F. Jason Park [Sat, 19 Mar 2022 09:33:24 +0000 (02:33 -0700)]
; * test/lisp/erc/erc-tests.el (erc--switch-to-buffer): Fix test failure.

2 years agoRemove redundant checks in erc--switch-to-buffer
Guy Gastineau [Sat, 29 Jan 2022 04:12:42 +0000 (23:12 -0500)]
Remove redundant checks in erc--switch-to-buffer

* lisp/erc/erc.el (erc--switch-to-buffer): Commit
f925fc93bac41d7622d1af927e33b0e738ff55b0 "Add `predicate' arg to
`read-buffer' and use it for erc-iswitchb" meant to remove this, but
it was left behind. (Bug#53617)

Copyright-paperwork-exempt: yes

2 years agoAdd unit test for erc--switch-to-buffer
F. Jason Park [Mon, 14 Mar 2022 05:39:36 +0000 (22:39 -0700)]
Add unit test for erc--switch-to-buffer

* test/lisp/erc/erc-tests.el (erc--switch-to-buffer): Add new test.
(Bug#53617)

2 years agoMerge from origin/emacs-28
Eli Zaretskii [Sat, 19 Mar 2022 07:25:18 +0000 (09:25 +0200)]
Merge from origin/emacs-28

e059d7c Fix region highlight in non-selected windows

2 years agoFix region highlight in non-selected windows
Eli Zaretskii [Sat, 19 Mar 2022 07:19:53 +0000 (09:19 +0200)]
Fix region highlight in non-selected windows

* src/xdisp.c (prepare_menu_bars): Include in the windows passed
to pre-redisplay-functions windows whose point was moved from the
last recorded position.  (Bug#54450)

2 years agoIgnore drag source frame on Haiku in line with documentation
Po Lu [Sat, 19 Mar 2022 07:00:11 +0000 (07:00 +0000)]
Ignore drag source frame on Haiku in line with documentation

* src/haiku_support.cc (class EmacsWindow): New field
`window_id'.
(MessageReceived): Ignore dropped messages with same window id.
(be_drag_message): Add source frame's window ID to message.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Sat, 19 Mar 2022 05:30:38 +0000 (06:30 +0100)]
Merge from origin/emacs-28

c4596c8522 Fix a regression in 'decipher-digram-list'

2 years agoDocument dired-mouse-drag-files
Po Lu [Sat, 19 Mar 2022 03:35:55 +0000 (11:35 +0800)]
Document dired-mouse-drag-files

* doc/emacs/dired.texi (Misc Dired Features): Explain that
dragging files is now supported.
* etc/NEWS: Update documentation status.
* lisp/dired.el (dired-mouse-drag-files): Fix typo in doc
string.

2 years ago* src/xterm.c (XTread_socket): Don't filter GenericEvents.
Po Lu [Sat, 19 Mar 2022 02:52:27 +0000 (10:52 +0800)]
* src/xterm.c (XTread_socket): Don't filter GenericEvents.

2 years agoFix some glitches when dragging files from dired
Po Lu [Sat, 19 Mar 2022 02:27:19 +0000 (10:27 +0800)]
Fix some glitches when dragging files from dired

* lisp/dired.el (dired-mouse-drag-files): Fix initial values.

(dired-mouse-drag): Clear mark if active and only make button
release events unread.

2 years agoHandle composite overlay window during drag and drop sessions
Po Lu [Sat, 19 Mar 2022 01:11:09 +0000 (09:11 +0800)]
Handle composite overlay window during drag and drop sessions

* configure.ac: Test for the composite extension and use it if
available.
* msdos/sed1v2.inp: Update.
* src/Makefile.in (XCOMPOSITE_LIBS, XCOMPOSITE_CFLAGS): New
variables.
(EMACS_CFLAGS, LIBES): Add new libs and cflags.
* src/xterm.c (x_dnd_get_target_window): Look for proxy on
composite overlay window if mapped.
(x_term_init): Test if the composite extension is available.
* src/xterm.h (struct x_display_info): New fields for composite
extension presence.

2 years agoFix some XIM servers getting confused during drag-and-drop
Po Lu [Fri, 18 Mar 2022 23:45:14 +0000 (07:45 +0800)]
Fix some XIM servers getting confused during drag-and-drop

* src/xterm.c (x_dnd_begin_drag_and_drop): Clear XIC while event
loop is in progress.
(x_filter_event): Return 0 if DND is in progress.
(xim_instantiate_callback): Likewise.

2 years ago* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Minor optimization
Stefan Monnier [Fri, 18 Mar 2022 20:07:42 +0000 (16:07 -0400)]
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Minor optimization

2 years agoPcomplete: Better obey `completion-at-point-functions`
Stefan Monnier [Fri, 18 Mar 2022 15:59:32 +0000 (11:59 -0400)]
Pcomplete: Better obey `completion-at-point-functions`

Functions on `completion-at-point-functions` should not modify
the buffer.  Pcomplete itself mostly abides by this but Eshell's
use of it doesn't.  Try and catch those cases.  Also fix one of
those cases.

* lisp/pcomplete.el (pcomplete-allow-modifications): New var.
(pcomplete-completions-at-point): Enforce it.
(pcomplete, pcomplete-expand-and-complete, pcomplete-expand):
Rebind it since these commands expect the extra side effects.

* lisp/eshell/em-cmpl.el (eshell--pcomplete-insert-tab): New function,
extracted from `eshell-complete-parse-arguments`.
(eshell-complete-parse-arguments): Use it and obey
`pcomplete-allow-modifications`.

2 years ago* lisp/gnus/mail-source.el (mail-source-set-1): Fix indent and simplify
Stefan Monnier [Fri, 18 Mar 2022 15:51:46 +0000 (11:51 -0400)]
* lisp/gnus/mail-source.el (mail-source-set-1): Fix indent and simplify

2 years agoSpeed up fixnum printing
Mattias Engdegård [Fri, 18 Mar 2022 12:58:36 +0000 (13:58 +0100)]
Speed up fixnum printing

Use the new number-to-string code to speed up fixnum printing, with
similar results (often more than twice as fast as before).

* src/data.c (Fnumber_to_string): Move fixnum conversion to...
(fixnum_to_string): ... this new function.
* src/lisp.h: (fixnum_to_string): External declaration.
* src/print.c (print_object): Use fixnum_to_string instead of sprintf.

2 years agoFix a regression in 'decipher-digram-list'
Eli Zaretskii [Fri, 18 Mar 2022 11:54:46 +0000 (13:54 +0200)]
Fix a regression in 'decipher-digram-list'

* lisp/play/decipher.el (decipher-stats-buffer): Don't assume the
statistics buffer always exists.  (Bug#54443)

2 years agoMake application configurable in 'with-connection-local-variables'
Michael Albinus [Fri, 18 Mar 2022 11:25:32 +0000 (12:25 +0100)]
Make application configurable in 'with-connection-local-variables'

* doc/lispref/variables.texi (Connection Local Variables):
Explain 'connection-local-default-application'.

* etc/NEWS: Mention 'connection-local-default-application'.

* lisp/files-x.el (connection-local-default-application): New variable.
(connection-local-criteria-for-default-directory): Use it.  (Bug#54405)

* test/lisp/files-x-tests.el
(files-x-test-with-connection-local-variables): Extend test.

2 years agoSpeed up number-to-string for fixnums
Mattias Engdegård [Fri, 18 Mar 2022 10:43:10 +0000 (11:43 +0100)]
Speed up number-to-string for fixnums

Do the binary-to-decimal conversion by hand for fixnums instead of
calling sprintf.  This results in a noticeable speed increase (on my
machine, 2.2× faster excluding GC).

* src/data.c (Fnumber_to_string): Don't use sprintf for fixnums.

2 years agoImplement drag-and-drop of files on Haiku
Po Lu [Fri, 18 Mar 2022 09:21:39 +0000 (09:21 +0000)]
Implement drag-and-drop of files on Haiku

* lisp/term/haiku-win.el (haiku-dnd-selection-converters): Add
new selection converter.
(haiku-dnd-convert-uri-list): New function.
(x-begin-drag): Allow selection converters to change message
field type.

* src/haikuselect.c (haiku_lisp_to_message): Perform more error
checking.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Fri, 18 Mar 2022 06:01:18 +0000 (07:01 +0100)]
Merge from origin/emacs-28

530c3491e8 Improve documentation of bookmark default sorting
11492259b1 ; * doc/lispref/display.texi (Overlay Arrow): More accurat...

2 years agoAllow dragging messages with file names on Haiku
Po Lu [Fri, 18 Mar 2022 05:48:10 +0000 (05:48 +0000)]
Allow dragging messages with file names on Haiku

* src/haiku_select.cc (be_add_refs_data): New function.
* src/haikuselect.c (haiku_lisp_to_message): Handle `ref' type
correctly.
* src/haikuselect.h: Update prototypes.

2 years agoAllow dragging files from Dired to other programs
Po Lu [Fri, 18 Mar 2022 05:17:19 +0000 (13:17 +0800)]
Allow dragging files from Dired to other programs

* etc/NEWS: Announce new user option `dired-mouse-drag-files'.
* lisp/dired.el (dired-mouse-drag-files): New user option.
(dired-mouse-drag): New command.
(dired-mouse-drag-files-map): New variable.
(dired-insert-set-properties): Add additional keymap if mouse
dragging is enabled.

* lisp/select.el (xselect-convert-to-targets): Handle new
form of selection converters.
(xselect-convert-to-username):
(xselect-convert-to-text-uri-list):
(xselect-uri-list-available-p): New functions.
(selection-converter-alist): Add them as selection converters.

* src/xselect.c (x_get_local_selection): Handle new form of
selection converters.
(syms_of_xselect): Update doc strings.

2 years agoImprove documentation of bookmark default sorting
Karl Fogel [Fri, 18 Mar 2022 02:18:26 +0000 (21:18 -0500)]
Improve documentation of bookmark default sorting

* lisp/bookmark.el (bookmark-alist, bookmark-store,
  bookmark-maybe-sort-alist): Update doc strings and comments.

2 years agoMinor fixes to DND support
Po Lu [Fri, 18 Mar 2022 00:22:50 +0000 (08:22 +0800)]
Minor fixes to DND support

* src/xterm.c (x_dnd_begin_drag_and_drop): Free targets
afterwards.
(handle_one_xevent): Only calculate dnd_grab if DND is in
progress.

2 years agoRemove some early-bootstrap dependencies for `advice`
Stefan Monnier [Thu, 17 Mar 2022 23:07:59 +0000 (19:07 -0400)]
Remove some early-bootstrap dependencies for `advice`

The dependencies between `advice`, cl-generic`, `bytecomp`, `cl-lib`,
`simple`, `help`, ... were becoming unmanageable.
Break the reliance on `advice` (which includes making sure the
compiler is not needed during the early bootstrap).

* lisp/simple.el (pre-redisplay-function): Set without using `add-function`.

* lisp/loadup.el (advice, simple): Move to after `cl-generic`.

* lisp/help.el (command-error-function): Set without using `add-function`.
(help-command-error-confusable-suggestions): Explicitly call
`command-error-default-function` instead.

* lisp/emacs-lisp/cl-macs.el (pcase--mutually-exclusive-p): Don't
optimize during early-bootstrap.

* lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Tiny simplification.
(cl-defmethod): Label the obsolescence warning as it should.
(cl--generic-compiler): New variable.
(cl--generic-get-dispatcher): Use it.
(cl--generic-prefill-dispatchers): Make freshly made dispatchers.

2 years agoPut bytecode stack frame metadata in a struct
Mattias Engdegård [Mon, 14 Mar 2022 11:57:29 +0000 (12:57 +0100)]
Put bytecode stack frame metadata in a struct

Using a plain C struct instead of type-punning Lisp_Object stack slots
makes the bytecode interpreter code more type-safe and potentially
faster (from better alias analysis), and the special-purpose accessors
are no longer needed.  It also reduces the stack requirements when
using 64-bit Lisp_Object on 32-bit platforms.

* src/bytecode.c (enum stack_frame_index)
(sf_get_ptr, sf_set_ptr, sf_get_lisp_ptr, sf_set_lisp_ptr,
sf_get_saved_pc, sf_set_saved_pc): Remove.
(BC_STACK_SIZE): Now in bytes, not Lisp words.
(struct bc_frame): New.
(init_bc_thread, mark_bytecode, Finternal_stack_stats, valid_sp)
(exec_byte_code):
* src/lisp.h (struct handler, get_act_rec, set_act_rec):
Adapt to new struct bc_frame.

2 years agoRestore HOME after mailcap-parsing-and-mailcap-mime-info
Lars Ingebrigtsen [Thu, 17 Mar 2022 15:11:39 +0000 (16:11 +0100)]
Restore HOME after mailcap-parsing-and-mailcap-mime-info

* test/lisp/net/mailcap-tests.el
(mailcap-parsing-and-mailcap-mime-info): Restore HOME after the
test (bug#54435).

2 years agoEnable Tramp reloading
Michael Albinus [Thu, 17 Mar 2022 14:32:01 +0000 (15:32 +0100)]
Enable Tramp reloading

* lisp/net/tramp.el (tramp-file-name): Add ;;;###tramp-autoload
cookie.  (Bug#50869)

* test/lisp/net/tramp-tests.el (tramp-test47-unload): Do not skip.
Test reload.

2 years ago* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Warn suspicious args
Stefan Monnier [Thu, 17 Mar 2022 14:07:35 +0000 (10:07 -0400)]
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Warn suspicious args

2 years agoAvoid repeated prompts in `M-x shell' if using ~/.emacs_bash
Lars Ingebrigtsen [Thu, 17 Mar 2022 14:04:07 +0000 (15:04 +0100)]
Avoid repeated prompts in `M-x shell' if using ~/.emacs_bash

* lisp/shell.el (shell): Use `shell-eval-command' to avoid
repeated prompts (bug#9961).

2 years agoMake shell-resync-dirs work with zsh
Lars Ingebrigtsen [Thu, 17 Mar 2022 13:50:05 +0000 (14:50 +0100)]
Make shell-resync-dirs work with zsh

* lisp/shell.el (shell-resync-dirs): Use shell-eval-command to
avoid getting confused by zsh (bug#54384).
(shell-eval-command): New function.

2 years ago(seq-contains-p): Refine the non-nil returned value
Stefan Monnier [Thu, 17 Mar 2022 13:54:41 +0000 (09:54 -0400)]
(seq-contains-p): Refine the non-nil returned value

* lisp/emacs-lisp/seq.el (seq-contains-p): Like `cl-some` return the
value returned by the test function rather than t.

2 years ago; * doc/lispref/display.texi (Overlay Arrow): More accurate text.
Eli Zaretskii [Thu, 17 Mar 2022 12:55:59 +0000 (14:55 +0200)]
; * doc/lispref/display.texi (Overlay Arrow): More accurate text.

2 years agoFix a use of 'cl-defgeneric'.
Philipp Stephani [Tue, 15 Mar 2022 23:10:08 +0000 (00:10 +0100)]
Fix a use of 'cl-defgeneric'.

* lisp/progmodes/xref.el (xref-match-length): Use 'cl-defmethod'
instead of 'cl-defgeneric'.

2 years agoMake `?' work again in read-multiple-choice
Lars Ingebrigtsen [Thu, 17 Mar 2022 11:55:24 +0000 (12:55 +0100)]
Make `?' work again in read-multiple-choice

* lisp/emacs-lisp/rmc.el (read-multiple-choice): Make the `?' key
work again to show the help text.

2 years agoFormat long help texts better in read-multiple-choice
Felician Nemeth [Thu, 17 Mar 2022 11:44:43 +0000 (12:44 +0100)]
Format long help texts better in read-multiple-choice

* lisp/emacs-lisp/rmc.el (rmc--show-help): Format long help texts
better (bug#54430).

2 years agoImprove propagation of gnus/nnselect group info
Andrew G Cohen [Fri, 4 Mar 2022 08:44:40 +0000 (16:44 +0800)]
Improve propagation of gnus/nnselect group info

* lisp/gnus/nnselect.el (nnselect-push-info): Speed up pushing the
nnselect info back to the originating groups.

2 years agoFix bug in nnselect fetching new articles in a thread
Andrew G Cohen [Fri, 4 Mar 2022 08:29:50 +0000 (16:29 +0800)]
Fix bug in nnselect fetching new articles in a thread

* lisp/gnus/nnselect.el (nnselect-request-thread): Ignore the
Retrieval Status Value in comparing whether articles are the same.

2 years agoDon't use the original sender's address as the envelope-from
Sean Whitton [Thu, 17 Mar 2022 10:57:14 +0000 (11:57 +0100)]
Don't use the original sender's address as the envelope-from

* lisp/gnus/message.el (message-resend): Avoid setting the
envelope-from to the original sender's address rather than the
resender's (bug#54429).

2 years agoImprove LaTeX symbol prettification
Arash Esbati [Thu, 17 Mar 2022 10:44:15 +0000 (11:44 +0100)]
Improve LaTeX symbol prettification

* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist):
Support macros which used to be part of textcomp package.

2 years agoPrevent invisible frames from acting as drag sources
Po Lu [Thu, 17 Mar 2022 09:41:41 +0000 (17:41 +0800)]
Prevent invisible frames from acting as drag sources

* src/xterm.c (x_dnd_begin_drag_and_drop): Error out if f is
invisible.  It makes no sense for an invisible frame to be a
drag source, so the function just hangs.

2 years ago* src/haikuselect.c (Fhaiku_drag_message): Clear display grab after drag ends.
Po Lu [Thu, 17 Mar 2022 09:14:53 +0000 (09:14 +0000)]
* src/haikuselect.c (Fhaiku_drag_message): Clear display grab after drag ends.

2 years agoFix creating frames with an initial value of `fullscreen' on Haiku
Po Lu [Thu, 17 Mar 2022 08:51:32 +0000 (08:51 +0000)]
Fix creating frames with an initial value of `fullscreen' on Haiku

* src/haikufns.c (haiku_create_frame): Set configury_done and do
pending fullscreen change if any.
* src/haikuterm.c (haiku_fullscreen): Defer actually setting
fullscreen until configury_done is set.
* src/haikuterm.h (struct haiku_output): New field
`configury_done'.

2 years agoDo not cache directories with Tramp sshfs
Michael Albinus [Thu, 17 Mar 2022 08:09:54 +0000 (09:09 +0100)]
Do not cache directories with Tramp sshfs

* lisp/net/tramp-sshfs.el (tramp-methods) <sshfs>:
Add "-o dir_cache=no" to `tramp-mount-args'.  (Bug#54126)

2 years agoFix mouse movement on Haiku
Po Lu [Thu, 17 Mar 2022 07:17:13 +0000 (07:17 +0000)]
Fix mouse movement on Haiku

* src/haiku_support.cc (MouseMoved): Make sure grab view exists
before comparing against it.

2 years agoDisplay drag-and-drop messages in echo area on non-graphics displays
Po Lu [Thu, 17 Mar 2022 07:12:23 +0000 (15:12 +0800)]
Display drag-and-drop messages in echo area on non-graphics displays

* lisp/mouse.el (mouse-drag-and-drop-region-display-tooltip)
(mouse-drag-and-drop-region-hide-tooltip): New functions.
(mouse-drag-and-drop-region): Use them instead of calling
`x-hide-tip' and `x-show-tip' directly.

2 years agoFix compilation error of xterm.c
Eli Zaretskii [Thu, 17 Mar 2022 06:56:42 +0000 (08:56 +0200)]
Fix compilation error of xterm.c

* src/xterm.c (x_dnd_begin_drag_and_drop): Use current_count only
if defined.  Reported by Tassilo Horn <tsdh@gnu.org>.

2 years agoPrevent delivery of duplicate events when window is grabbed on Haiku
Po Lu [Thu, 17 Mar 2022 05:31:03 +0000 (05:31 +0000)]
Prevent delivery of duplicate events when window is grabbed on Haiku

* src/haiku_support.cc (grab_view, grab_view_locker): New
variables.
(MouseMoved, MouseDown, MouseUp): Keep track of the grab and
don't deliver motion events to any other view.

2 years ago* src/xterm.c (x_dnd_begin_drag_and_drop): Always initialize hold_quit.
Po Lu [Thu, 17 Mar 2022 04:53:36 +0000 (12:53 +0800)]
* src/xterm.c (x_dnd_begin_drag_and_drop): Always initialize hold_quit.

2 years agoRestore old PGTK scrolling code
Po Lu [Thu, 17 Mar 2022 03:59:56 +0000 (11:59 +0800)]
Restore old PGTK scrolling code

* src/pgtkterm.c (pgtk_copy_bits): Restore old code using
cairo_surface_create_similar.  (bug#54040)

2 years agoMake GTK inspector available on PGTK
Po Lu [Thu, 17 Mar 2022 03:51:32 +0000 (11:51 +0800)]
Make GTK inspector available on PGTK

* src/pgtkfns.c (Fx_gtk_debug): New function.
(syms_of_pgtkfns): Define new subr.

2 years ago; * lisp/term/haiku-win.el (x-begin-drag): Fix compiler warning.
Po Lu [Thu, 17 Mar 2022 03:49:23 +0000 (11:49 +0800)]
; * lisp/term/haiku-win.el (x-begin-drag): Fix compiler warning.

2 years ago* lisp/term/haiku-win.el (x-begin-drag): Fix type code of B_MIME_TYPE.
Po Lu [Thu, 17 Mar 2022 03:46:18 +0000 (03:46 +0000)]
* lisp/term/haiku-win.el (x-begin-drag): Fix type code of B_MIME_TYPE.

2 years agoImplement cross-program drag-and-drop on Haiku
Po Lu [Thu, 17 Mar 2022 03:42:19 +0000 (03:42 +0000)]
Implement cross-program drag-and-drop on Haiku

* doc/lispref/frames.texi (Drag and Drop): Fix documentation of
`x-begin-drag' to match actual function arity.
* lisp/term/haiku-win.el (haiku-dnd-selection-value): New
variable.
(haiku-dnd-selection-converters): New variable.
(haiku-dnd-convert-string): New function.
(gui-backend-get-selection, gui-backend-set-selection): Handle
XdndSelection specially.
(x-begin-drag): New function.

* src/haiku_select.cc (be_create_simple_message)
(be_add_message_data): New functions.
* src/haiku_support.cc (WAIT_FOR_RELEASE): New message type.
(class EmacsView, MouseUp): If waiting for release, reply and
drop event.
(be_drag_message, be_drag_message_thread_entry): New functions.
* src/haiku_support.h: Update prototypes.

* src/haikuselect.c (lisp_to_type_code, haiku_lisp_to_message)
(Fhaiku_drag_message): New functions.
(syms_of_haikuselect): Define new subr.

* src/haikuselect.h: Update prototypes.

2 years agoImprove GTK support for X11 drag-n-drop
Po Lu [Thu, 17 Mar 2022 00:54:30 +0000 (08:54 +0800)]
Improve GTK support for X11 drag-n-drop

* src/xterm.c (x_dnd_begin_drag_and_drop): Run nested GTK event
loop instead, so GTK gets the correct events.

2 years agoSimplify generate-new-buffer-name randomness
Paul Eggert [Thu, 17 Mar 2022 00:21:55 +0000 (17:21 -0700)]
Simplify generate-new-buffer-name randomness

* src/buffer.c (Fgenerate_new_buffer_name):
Simplify by calling get_random instead of Frandom;
that’s random enough here.

2 years agoImprove random bignum generation
Paul Eggert [Thu, 17 Mar 2022 00:21:55 +0000 (17:21 -0700)]
Improve random bignum generation

* src/bignum.c (get_random_limb, get_random_limb_lim)
(get_random_bignum): New functions, for more-efficient
generation of random bignums without using Frem etc.
* src/fns.c (get_random_fixnum): New function.
(Frandom): Use it, and get_random_bignum.
Be consistent about signalling nonpositive integer arguments;
since zero is invalid, Qnatnump is not quite right here.
* src/sysdep.c (get_random_ulong): New function.

2 years agoStrip positions from symbols before the eval in eval-{when,and}-compile.
Alan Mackenzie [Wed, 16 Mar 2022 19:23:24 +0000 (19:23 +0000)]
Strip positions from symbols before the eval in eval-{when,and}-compile.

This fixes bug #54079.

* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Change
the position of 'byte-run-strip-symbol-positions' in the eval-when-compile
entry.  Add a call to `byte-run-strip-symbol-positions' in the
eval-and-compile entry.

2 years agoReport buffer-name when local mode-line is invalid
Robert Pluim [Mon, 7 Mar 2022 10:26:25 +0000 (11:26 +0100)]
Report buffer-name when local mode-line is invalid

* lisp/files.el (hack-local-variables-prop-line): Add '(buffer-name)'
to the message reporting the malformed mode-line.