]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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.

2 years agoGuard against custom entries that can contain NULs
Robert Pluim [Sat, 26 Feb 2022 10:46:32 +0000 (11:46 +0100)]
Guard against custom entries that can contain NULs

There are custom entries that contain lambda's as values by default,
which can result in them containing embedded NULs after
byte-compilation, which wreaks havoc when they are saved to .emacs and
later read in.  (Bug#52554)

* lisp/cus-edit.el (custom-save-all): Bind
print-escape-control-characters to t.
* lisp/startup.el (startup--load-user-init-file): Bind
inhibit-null-byte-detection to t.

2 years agoImprove error message for 'not running' processes
Robert Pluim [Wed, 9 Feb 2022 09:01:36 +0000 (10:01 +0100)]
Improve error message for 'not running' processes

The current error message is simply 'not running', but
'status_message' can give information about why the process is in that
state, such as network errors, so return that as well.  (Bug#53762)

* src/process.c (send_process, Fprocess_send_eof): Add the output of
'status_message' to the error string.

2 years ago* lisp/net/tramp-sh.el (tramp-find-file-exists-command): Fix comment.
Manuel Giraud [Wed, 16 Mar 2022 16:38:18 +0000 (17:38 +0100)]
* lisp/net/tramp-sh.el (tramp-find-file-exists-command): Fix comment.

2 years agoLink with libdl when using pgtk
Robert Pluim [Wed, 16 Mar 2022 14:24:35 +0000 (15:24 +0100)]
Link with libdl when using pgtk

* configure.ac: Define LIBMODULES on GNU/Linux when using pgtk, even
when not using modules, since pgtkterm.c uses dlsym.  (Bug#54378)

2 years ago* doc/lispref/frames.texi (x-begin-drag): Improve wording.
Po Lu [Wed, 16 Mar 2022 13:47:37 +0000 (21:47 +0800)]
* doc/lispref/frames.texi (x-begin-drag): Improve wording.

2 years agoFix 32-bit Haiku build
Po Lu [Wed, 16 Mar 2022 13:43:37 +0000 (13:43 +0000)]
Fix 32-bit Haiku build

* src/haikuselect.h (be_enum_message): Fix declaration for
32-bit types.

2 years agoAdd support for dropping plain text on Haiku
Po Lu [Wed, 16 Mar 2022 13:24:18 +0000 (13:24 +0000)]
Add support for dropping plain text on Haiku

* haiku-win.el (haiku-dnd-handle-drag-n-drop-event): Handle
`text/plain'.

2 years agoRedo Haiku DND support
Po Lu [Wed, 16 Mar 2022 13:18:12 +0000 (13:18 +0000)]
Redo Haiku DND support

* lisp/term/haiku-win.el (haiku-dnd-handle-drag-n-drop-event):
Update for new DND event format.
* src/haiku_io.c (haiku_len): Handle DRAG_AND_DROP_EVENTs.
* src/haiku_select.cc (be_enum_message, be_get_refs_data)
(be_get_message_data): New function.
* src/haiku_support.cc (class Emacs): Remove `RefsReceived'.
(MessageReceived): Generate new kind of drag-n-drop events.
* src/haiku_support.h (enum haiku_event_type): Rename
`REFS_EVENT' to `DRAG_AND_DROP_EVENT'.
(struct haiku_refs_event): Delete struct.
(struct haiku_drag_and_drop_event): New struct.
* src/haikuselect.c (haiku_message_to_lisp): New function.
(syms_of_haikuselect): New symbols.
* src/haikuselect.h: Update prototypes.
* src/haikuterm.c (haiku_read_socket): Handle new type of
drag-and-drop events by serializing drop message to Lisp and
letting Lisp code do the processing.
* src/haikuterm.h: Update prototypes.

2 years agoFix last change in frames.texi
Eli Zaretskii [Wed, 16 Mar 2022 12:46:36 +0000 (14:46 +0200)]
Fix last change in frames.texi

* doc/lispref/frames.texi (Drag and Drop): Improve and clarify the
wording.

2 years agoPacify compiler warning in handle_one_xevent
Po Lu [Wed, 16 Mar 2022 11:43:06 +0000 (19:43 +0800)]
Pacify compiler warning in handle_one_xevent

* src/xterm.c (x_dnd_get_target_window): Set proto_out even if
it won't be used because target is None.  Reported by Lars
Ingebrigtsen <larsi@gnus.org>.

2 years agoCorrect last change for return-frame drags
Po Lu [Wed, 16 Mar 2022 09:07:17 +0000 (17:07 +0800)]
Correct last change for return-frame drags

* src/xterm.c (handle_one_xevent): Use `x_any_window_to_frame'
to determine `x_dnd_return_frame_object'.

2 years agoFix minor bugs with XDND support
Po Lu [Wed, 16 Mar 2022 09:03:19 +0000 (17:03 +0800)]
Fix minor bugs with XDND support

* lisp/mouse.el (mouse-drag-and-drop-region): Report more
selection targets for the benefit of Qt and Mozilla.
* lisp/select.el (xselect--encode-string)
(selection-converter-alist): Add new selection targets.

* src/xterm.c (x_dnd_get_window_proxy): New function.
(x_dnd_get_target_window): New argument proto_out, and return
first window with XdndAware instead of bottommost window.
(handle_one_xevent): Use new argument `proto_out'.

2 years agoFix XI 2.0 build
Po Lu [Wed, 16 Mar 2022 07:51:02 +0000 (15:51 +0800)]
Fix XI 2.0 build

* src/xterm.c (handle_one_xevent): Move declaration of dummy out
of HAVE_XINPUT2_1.

2 years agoFix tooltip text properties showing up in dragged text
Po Lu [Wed, 16 Mar 2022 07:18:02 +0000 (15:18 +0800)]
Fix tooltip text properties showing up in dragged text

* lisp/mouse.el (mouse-drag-and-drop-region): Directly call
x-show-tip and x-hide-tip instead of going through tooltip-show.

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

62e830c3d9 * doc/misc/transient.texi: Fix @dircategory to "Emacs misc...

2 years agoBetter handle drag-and-drop from one Emacs frame to another
Po Lu [Wed, 16 Mar 2022 04:33:15 +0000 (12:33 +0800)]
Better handle drag-and-drop from one Emacs frame to another

* doc/lispref/frames.texi (Drag and Drop): Document new
parameter `return-frame' to `x-begin-drag'.
* lisp/mouse.el (mouse-drag-and-drop-region): Utilize new
feature.

* src/xfns.c (Fx_begin_drag): New parameter `return-frame'.
* src/xterm.c (x_dnd_begin_drag_and_drop): New parameter
return_frame_p.
(handle_one_xevent): Set new flags and return frame whenever
appropriate.
* src/xterm.h: Update prototypes.

2 years ago* src/xfns.c (Fx_begin_drag): Improve doc string.
Po Lu [Wed, 16 Mar 2022 03:45:46 +0000 (11:45 +0800)]
* src/xfns.c (Fx_begin_drag): Improve doc string.

2 years agoAdd support for dragging text from Emacs to other programs
Po Lu [Wed, 16 Mar 2022 03:29:36 +0000 (11:29 +0800)]
Add support for dragging text from Emacs to other programs

This still probably needs some more protection from
malfunctioning clients which delete windows at random, but I
don't know if that's a problem in practice.

* doc/emacs/frames.texi (Drag and Drop):
* doc/lispref/frames.texi (Drag and Drop): Document new
features.

* etc/NEWS: Announce new function `x-begin-drag' and new user
option `mouse-drag-and-drop-region-cross-program'.

* lisp/mouse.el (mouse-drag-and-drop-region-cross-program): New
user option.
(x-begin-drag): New variable declaration.
(mouse-drag-and-drop-region): If the mouse moves out of an Emacs
frame, begin a window system drag.
* lisp/x-dnd.el (x-dnd-handle-xdnd): Remove left-over debugging
code.

* src/xfns.c (Fx_set_mouse_absolute_pixel_position): Fix
indentation of opening paren.
(Fx_begin_drag): New function.
(syms_of_xfns): Define new subr.
* src/xselect.c (x_timestamp_for_selection): New function.

* src/xterm.c (X_DND_SUPPORTED_VERSION): New preprocessor
declaration.
(x_dnd_get_window_proto, x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_set_dnd_targets)
(x_dnd_begin_drag_and_drop): New functions.
(handle_one_xevent): Handle drag-and-drop motion and button
events when active.
(x_free_frame_resources): If f is the DND source, stop
drag-and-drop.
(x_term_init): Intern new atoms.
(syms_of_xterm): New symbol QXdndSelection.

* src/xterm.h (struct x_display_info): New atoms
Xatom_XdndAware, Xatom_XdndSelection, Xatom_XdndTypeList,
Xatom_XdndActionCopy, Xatom_XdndActionMove,
Xatom_XdndActionLink, Xatom_XdndActionAsk,
Xatom_XdndActionPrivate, Xatom_XdndActionList,
Xatom_XdndActionDescription, Xatom_XdndProxy, Xatom_XdndEnter,
Xatom_XdndPosition, Xatom_XdndStatus, Xatom_XdndLeave,
Xatom_XdndDrop, and Xatom_XdndFinished.