]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoFix mode-line doc string
Lars Ingebrigtsen [Sun, 10 Apr 2022 01:15:03 +0000 (03:15 +0200)]
Fix mode-line doc string

* lisp/faces.el (mode-line): Fix doc string.

2 years agoses-test Prefix used symbols by ses--
Vincent Belaïche [Sat, 9 Apr 2022 22:26:33 +0000 (00:26 +0200)]
ses-test Prefix used symbols by ses--

* test/lisp/ses-tests.el: Rename cell symbols of renamed cells so
that they are in the SES namespace, as recommended by Stefan.

2 years agoFix sql-mode comment-end parsing
Lars Ingebrigtsen [Fri, 8 Apr 2022 13:45:07 +0000 (15:45 +0200)]
Fix sql-mode comment-end parsing

* lisp/progmodes/sql.el (sql-mode): Fix /* ... -*/ parsing
(bug#54769).

2 years agoAvoid sync when allowing touch events in handle_one_xevent
Po Lu [Sat, 9 Apr 2022 10:25:22 +0000 (18:25 +0800)]
Avoid sync when allowing touch events in handle_one_xevent

* src/xterm.c (handle_one_xevent): Don't catch errors around
XIAllowTouchEvents.
(x_error_handler): Ignore Device errors here instead.

2 years ago; * doc/emacs/trouble.texi (Memory Full): Minor copyedits.
Eli Zaretskii [Sat, 9 Apr 2022 09:57:08 +0000 (12:57 +0300)]
; * doc/emacs/trouble.texi (Memory Full): Minor copyedits.

2 years agoHandle hierarchy events for updating scroll valuators correctly
Po Lu [Sat, 9 Apr 2022 05:30:32 +0000 (13:30 +0800)]
Handle hierarchy events for updating scroll valuators correctly

* src/keyboard.c (gen_help_event, kbd_buffer_store_help_event):
Make sure to initialize the event buffer correctly.

* src/xterm.c (xi_populate_device_from_info): New function.
(x_init_master_valuators): Factor out most of the valuator
tracking code to that function.
(handle_one_xevent): Handle device enable and disable events in
a more detailed fashion.

2 years agoFix DND leave events not being sent to toplevel after returning frame
Po Lu [Sat, 9 Apr 2022 03:43:23 +0000 (11:43 +0800)]
Fix DND leave events not being sent to toplevel after returning frame

* src/xterm.c (x_dnd_update_state, handle_one_xevent): Make sure
to send leave events to the previous toplevel when cancelling to
return a frame.

2 years agoUse right frame when computing mouse movement device
Po Lu [Sat, 9 Apr 2022 03:37:56 +0000 (11:37 +0800)]
Use right frame when computing mouse movement device

* src/keyboard.c (kbd_buffer_get_event): Use the frame on which
the mouse actually moved to compute the last mouse device.

2 years agoMinor cleanups in X Windows drag-and-drop code
Po Lu [Sat, 9 Apr 2022 03:35:08 +0000 (11:35 +0800)]
Minor cleanups in X Windows drag-and-drop code

* src/keyboard.c (kbd_buffer_get_event): Don't dereference f if
nil when generating mouse motion event.
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_send_scroll_bar_event):
Use NoEventMask instead of 0.

2 years agoFix source reporting for focus in and focus out events
Po Lu [Sat, 9 Apr 2022 01:12:24 +0000 (09:12 +0800)]
Fix source reporting for focus in and focus out events

* src/xterm.c (handle_one_xevent): Report source name for
FocusIn and FocusOut events.

2 years agoClean up XI2 scroll valuator tracking code
Po Lu [Sat, 9 Apr 2022 01:02:24 +0000 (09:02 +0800)]
Clean up XI2 scroll valuator tracking code

* src/xterm.c (x_get_scroll_valuator_delta): Accept a pointer to
a device instead of the device id.
(handle_one_xevent): Pass the previously found device.

2 years ago* src/pgtkterm.c (pgtk_set_cr_source_with_color): Fix default operator.
Po Lu [Sat, 9 Apr 2022 00:48:45 +0000 (08:48 +0800)]
* src/pgtkterm.c (pgtk_set_cr_source_with_color): Fix default operator.

2 years agoFix subpixel AA with alpha-background on Cairo on X
Po Lu [Sat, 9 Apr 2022 00:41:00 +0000 (08:41 +0800)]
Fix subpixel AA with alpha-background on Cairo on X

* xterm.c (x_set_cr_source_with_gc_foreground)
(x_set_cr_source_with_gc_background): Set operator back to OVER
if alpha-background isn't to be respected.

2 years agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 9 Apr 2022 00:02:21 +0000 (17:02 -0700)]
Update from Gnulib by running admin/merge-gnulib

2 years agoPacify clang -Wunused-variable
Paul Eggert [Sat, 9 Apr 2022 00:00:20 +0000 (17:00 -0700)]
Pacify clang -Wunused-variable

* src/coding.c (detect_coding_utf_8):
* src/process.c (Finternal_default_process_filter):
Remove unused local vars.

2 years agoebrowse dumping need not return int
Paul Eggert [Fri, 8 Apr 2022 23:41:26 +0000 (16:41 -0700)]
ebrowse dumping need not return int

* lib-src/ebrowse.c (dump_members, dump_tree): Return void, not
int, since callers never actually use returned value.  All uses
changed.

2 years agoFix scrollbars on macOS 10.13 and below (bug#54623)
Alan Third [Wed, 30 Mar 2022 21:40:03 +0000 (22:40 +0100)]
Fix scrollbars on macOS 10.13 and below (bug#54623)

Make any build on macOS 10.13 and below follow the same drawing path
as the GNUstep port.  macOS 10.14 and above will use EmacsLayer.

* src/nsterm.h (EmacsLayer):
* src/nsterm.m ([EmacsView makeBackingLayer]):
([EmacsView unlockFocus]):
([EmacsView windowDidChangeBackingProperties:]):
([EmacsView copyRect:to:]): Remove any code required for macOS 10.13
and below, and fix the #if's to enforce strict separation of the
drawing paths.
(ns_update_end):
(ns_unfocus): Fix #ifs so that flushWindow is called on old macOS
versions as well as GNUstep.

2 years agoFix pacifying gcc -Wanalyzer-null-dereference
Paul Eggert [Fri, 8 Apr 2022 17:18:53 +0000 (10:18 -0700)]
Fix pacifying gcc -Wanalyzer-null-dereference

* src/xterm.c (handle_one_xevent): Use eassume not eassert.
eassert (X)’s suppress_checking does not let GCC assume X.

2 years agoRename mark_stack to mark_c_stack
Mattias Engdegård [Fri, 8 Apr 2022 13:34:57 +0000 (15:34 +0200)]
Rename mark_stack to mark_c_stack

This is the function that marks the C stack.  Avoid confusion with the
new mark stack, a stack used in the GC mark phase.

* src/alloc.c (SETJMP_WILL_LIKELY_WORK, SETJMP_WILL_NOT_WORK)
(mark_stack, mark_c_stack):
* src/lisp.h:
* src/thread.c (mark_one_thread): Rename mark_stack to mark_c_stack.

2 years agoEnable warnings when building as a developer with Clang
Mattias Engdegård [Fri, 8 Apr 2022 12:57:17 +0000 (14:57 +0200)]
Enable warnings when building as a developer with Clang

The configure-script logic that automatically enables warnings when
building in a development tree didn't work for Clang because it was
identified as an old GCC version.

* configure.ac: Don't test Clang version as if it were GCC.

2 years agoImprove package.el error messages on too-old Emacsen
Lars Ingebrigtsen [Fri, 8 Apr 2022 12:46:14 +0000 (14:46 +0200)]
Improve package.el error messages on too-old Emacsen

* lisp/emacs-lisp/package.el (package-compute-transaction): Give a
better error message on too-old Emacs versions (bug#54747).

2 years agoRecommend that the user turn off memory overcommit
Po Lu [Fri, 8 Apr 2022 11:36:03 +0000 (19:36 +0800)]
Recommend that the user turn off memory overcommit

* doc/emacs/trouble.texi (Memory Full): Tell the user that Emacs
behaves best with overcommit off, and how to turn it off.

2 years ago; * src/nsterm.m: Remove stray semicolon
Mattias Engdegård [Fri, 8 Apr 2022 11:12:40 +0000 (13:12 +0200)]
; * src/nsterm.m: Remove stray semicolon

2 years agoInterpolate scrolls coming from mice by default
Po Lu [Fri, 8 Apr 2022 10:50:48 +0000 (18:50 +0800)]
Interpolate scrolls coming from mice by default

* lisp/pixel-scroll.el
(pixel-scroll-precision-interpolate-mice): New
user option.
(pixel-scroll-precision): If the class of the last event device
is `mouse', interpolate the next scroll.

2 years agoEnsure local `default-directory' when calling `process-attributes'.
Michael Albinus [Fri, 8 Apr 2022 10:47:53 +0000 (12:47 +0200)]
Ensure local `default-directory' when calling `process-attributes'.

* lisp/server.el (server-running-p):
* lisp/subr.el (memory-limit): Ensure local `default-directory'
when calling `process-attributes'.

2 years agoFix GC marking of input events with devices
Po Lu [Fri, 8 Apr 2022 09:00:37 +0000 (17:00 +0800)]
Fix GC marking of input events with devices

* src/keyboard.c (mark_kboards):
* src/pgtkterm.c (mark_pgtkterm): Mark `device' as well.

2 years agoImplement support for reporting device names on PGTK
Po Lu [Fri, 8 Apr 2022 05:37:16 +0000 (13:37 +0800)]
Implement support for reporting device names on PGTK

* lisp/frame.el (device-class): Add new function.
* lisp/term/pgtk-win.el (pgtk-device-class): New function.
* src/pgtkterm.c (pgtk_device_added_or_removal_cb)
(pgtk_seat_added_cb, pgtk_seat_removed_cb)
(pgtk_enumerate_devices)
(pgtk_free_devices, pgtk_regenerate_devices)
(pgtk_get_device_for_event): New functions.
(mark_pgtkterm): Mark device data.
(pgtk_delete_terminal): Delete device data.
(pgtk_handle_event, key_press_event, note_mouse_movement)
(construct_mouse_click, button_event, scroll_event)
(drag_data_received): Set device correctly.
(pgtk_term_init): Initialize device data and seat tracking.
(pgtk_delete_display): Delete device data.
* src/pgtkterm.h (struct pgtk_device_t): New struct.
(struct pgtk_display_info): New field `devices'.  Delete lots of
unused macros and reformat comments.

2 years ago* lisp/term/x-win.el (x-device-class): Detect more keyboards.
Po Lu [Fri, 8 Apr 2022 04:11:24 +0000 (12:11 +0800)]
* lisp/term/x-win.el (x-device-class): Detect more keyboards.

2 years ago; * src/emacs.c (main): Reword & reflow description of PGTK problem.
Sean Whitton [Thu, 7 Apr 2022 00:45:55 +0000 (17:45 -0700)]
; * src/emacs.c (main): Reword & reflow description of PGTK problem.

2 years agoIgnore input extension errors caused by grabbing
Po Lu [Fri, 8 Apr 2022 03:22:06 +0000 (11:22 +0800)]
Ignore input extension errors caused by grabbing

* src/xterm.c (x_error_handler): Ignore GrabDevice and
UngrabDevice errors.

2 years ago* lisp/term/x-win.el (x-device-class): Detect "USB USB Keykoard"s.
Po Lu [Fri, 8 Apr 2022 03:03:27 +0000 (11:03 +0800)]
* lisp/term/x-win.el (x-device-class): Detect "USB USB Keykoard"s.

2 years agoAdd code for determining the type of an input device
Po Lu [Fri, 8 Apr 2022 01:47:25 +0000 (09:47 +0800)]
Add code for determining the type of an input device

* doc/lispref/commands.texi (Command Loop Info):
* etc/NEWS: Update documentation and announce `device-class'.

* lisp/frame.el (x-device-class):
(device-class):
* lisp/term/x-win.el (x-device-class): New functions.

2 years agoFix reporting of last-event-device for synthetic events
Po Lu [Fri, 8 Apr 2022 00:22:40 +0000 (08:22 +0800)]
Fix reporting of last-event-device for synthetic events

* src/keyboard.c (read_char): Clear `last-event-device' earlier.

2 years agoMake device reporting work for tool bar clicks
Po Lu [Fri, 8 Apr 2022 00:13:49 +0000 (08:13 +0800)]
Make device reporting work for tool bar clicks

* src/dispextern.h: Update prototyupes.
* src/xdisp.c (handle_tool_bar_click): Pass Qt to that function
instead.
(handle_tool_bar_click_with_device): New function.
* src/xterm.c (handle_one_xevent): Pass device to tool bar click
logic.

2 years ago* src/xterm.c (handle_one_xevent): Fix build warning on non-GTK builds.
Po Lu [Thu, 7 Apr 2022 23:47:10 +0000 (07:47 +0800)]
* src/xterm.c (handle_one_xevent): Fix build warning on non-GTK builds.

2 years agolisp/simple.el: Use #' in new code
Stefan Monnier [Thu, 7 Apr 2022 23:20:54 +0000 (19:20 -0400)]
lisp/simple.el: Use #' in new code

* lisp/simple.el (minibuffer-local-shell-command-map): Use #' to quote
function names.

2 years agoDisplay file mode information when diff font lock prettify enabled
Matthias Meulien [Wed, 6 Apr 2022 22:11:55 +0000 (00:11 +0200)]
Display file mode information when diff font lock prettify enabled

* lisp/vc/diff-mode.el (diff--font-lock-prettify): Make regexp capture
file mode information.

2 years agoOClosure: New function `function-documentation`
Stefan Monnier [Thu, 7 Apr 2022 19:59:09 +0000 (15:59 -0400)]
OClosure: New function `function-documentation`

As mentioned in the original OClosure commit, OClosures (ab)use the
bytecode's docstring slot to hold the OClosure's type.  This currently
prevents OClosures from having their own docstring.

Introduce a new generic function `function-documentation` to fetch the
docstring of a function, which can then be implemented in various
different ways depending on the OClosure's type.

* lisp/simple.el (function-documentation): New generic function.
(bad-package-check): Strength-reduce `eval` to `symbol-value`.
* src/doc.c (Fdocumentation): Use it.

* lisp/emacs-lisp/oclosure.el (oclosure--accessor-docstring): New function.
* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test):
Add test for accessor's docstrings.

2 years agoExpose the name of an event's input device to Lisp
Po Lu [Thu, 7 Apr 2022 13:16:11 +0000 (21:16 +0800)]
Expose the name of an event's input device to Lisp

This name can be used to identify the device for special
treatment, i.e. only interpolating scrolls coming from mice and
not touchpads inside pixel-scroll-precision-mode.

* doc/lispref/commands.texi (Command Loop Info): Document new
variable `last-event-device'.
* etc/NEWS: Announce new variable `last-event-device'.
* src/frame.h (struct frame): New field `last_mouse_device'.
* src/keyboard.c (read_char): Clear last-event-device.
(kbd_buffer_get_event): Set last-event-device to the event's
recorded device.
(init_keyboard): Clear last-event-device.
(syms_of_keyboard): New defvar `last-event-device'.
* src/termhooks.h (struct input_event): New field `device'.
(EVENT_INIT): Set it to the special value `Qt' by default.
* src/xterm.c (x_init_master_valuators): Record the device's
name.
(x_dnd_begin_drag_and_drop): Only preserve last event device if
the mouse ended up in the source frame.
(x_note_mouse_movement): New argument `source'.
(handle_one_xevent): Set input event sources whenever
appropriate.
(mark_xterm): Mark device names.

* src/xterm.h (struct xi_device_t): New field `name'.

2 years agoFix xwidget smooth scrolling when the default pointer is not a touchpad
Po Lu [Thu, 7 Apr 2022 11:43:15 +0000 (19:43 +0800)]
Fix xwidget smooth scrolling when the default pointer is not a touchpad

* xwidget.c (find_suitable_pointer): New argument
`need_smooth'.  Try to find a touchpad if that is set.
(xwidget_button_1, xwidget_button, xwidget_motion_notify)
(xwidget_scroll, xwidget_pinch, xw_notify_virtual_upwards_until)
(xw_notify_virtual_downwards_until):
(xw_maybe_synthesize_crossing):
(xwidget_motion_or_crossing, synthesize_focus_in_event): Set
parameter accordingly.

2 years agoClarify read-answer-short/use-short-answers action
Lars Ingebrigtsen [Thu, 7 Apr 2022 11:37:16 +0000 (13:37 +0200)]
Clarify read-answer-short/use-short-answers action

* lisp/emacs-lisp/map-ynp.el (read-answer-short): Clarify what
this variable affects (bug#54754).

* src/fns.c (Fyes_or_no_p): Mention `use-short-answers'.

2 years agoEncrypt some parameters in auth-source plstore backend
Andrew G Cohen [Tue, 22 Mar 2022 05:04:58 +0000 (13:04 +0800)]
Encrypt some parameters in auth-source plstore backend

The auth-source plstore backend allows a list of extra parameters but
currently stores them all unencrypted.  This allows a plist with
:unencrypted and :encrypted keys to specify which extra parameters to
encrypt in the plstore file.

* lisp/auth-source.el (auth-source-plstore-create): Allow specifying
both unencrypted and encrypted extra parameters.

2 years agoAdd a mu backend for gnus-search
Jai Flack [Thu, 7 Apr 2022 11:14:01 +0000 (13:14 +0200)]
Add a mu backend for gnus-search

* lisp/gnus-search.el (gnus-search-mu-program): New defcustom
(gnus-search-mu-switches): New defcustom
(gnus-search-mu-remove-prefix): New defcustom
(gnus-search-mu-config-directory): New defcustom
(gnus-search-mu-raw-queries-p): New defcustom
(gnus-search-mu): New subclass of gnus-search-indexed
(gnus-search-transform-expression): New method
(gnus-search-mu-handle-date): New function
(gnus-search-mu-handle-flag): New function
(gnus-search-indexed-extract): New method
(gnus-search-indexed-search-command): New method (bug#54662).

2 years ago* lisp/net/tramp-integration.el: Don't require files-x.
Michael Albinus [Thu, 7 Apr 2022 10:11:11 +0000 (12:11 +0200)]
* lisp/net/tramp-integration.el: Don't require files-x.

2 years agoFix error when calling DND movement tracking function
Po Lu [Thu, 7 Apr 2022 06:32:10 +0000 (14:32 +0800)]
Fix error when calling DND movement tracking function

* src/xterm.c (x_dnd_begin_drag_and_drop): Verify
x_dnd_movement_x and x_dnd_movement_y are wholenums before
caling posn-at-x-y.

2 years ago* src/xterm.c (xm_write_targets_table): Remove extra XGrabServer pair.
Po Lu [Thu, 7 Apr 2022 06:25:52 +0000 (14:25 +0800)]
* src/xterm.c (xm_write_targets_table): Remove extra XGrabServer pair.

2 years agoFix DND bugs on GTK
Po Lu [Thu, 7 Apr 2022 06:02:34 +0000 (14:02 +0800)]
Fix DND bugs on GTK

* src/xterm.c (handle_one_xevent): Don't let some client
messages reach the toolkit.

2 years agoRemove more code mindlessly copied from NS
Po Lu [Thu, 7 Apr 2022 03:44:59 +0000 (11:44 +0800)]
Remove more code mindlessly copied from NS

* src/pgtkfns.c (Fx_open_connection):
* src/pgtkselect.c (nxatoms_of_pgtkselect):
* src/pgtkselect.h:
* src/pgtkterm.h: Delete `nxatoms_of_pgtkselect'.

2 years ago; * etc/PROBLEMS: Explain how to get dropping text on xterm to work.
Po Lu [Thu, 7 Apr 2022 02:20:47 +0000 (10:20 +0800)]
; * etc/PROBLEMS: Explain how to get dropping text on xterm to work.

2 years agoFix sending unsupported drops when there is no target but a toplevel
Po Lu [Thu, 7 Apr 2022 02:15:12 +0000 (10:15 +0800)]
Fix sending unsupported drops when there is no target but a toplevel

* src/xterm.c (handle_one_xevent): Send unsupported drops to
last seen toplevel if no target was found.

2 years agoImprove doc of x-begin-drag
Po Lu [Thu, 7 Apr 2022 00:57:25 +0000 (08:57 +0800)]
Improve doc of x-begin-drag

* doc/lispref/frames.texi (Drag and Drop): Fix typos and clarify
meaning of XdndActionPrivate.

2 years agoReturn an appropriate action when performing unsupported drop
Po Lu [Thu, 7 Apr 2022 00:55:00 +0000 (08:55 +0800)]
Return an appropriate action when performing unsupported drop

* src/xterm.c (x_dnd_send_unsupported_drop): Set action to
XdndActionPrivate.

2 years ago* src/xselect.c (x_atom_to_symbol): Add XdndSelection.
Po Lu [Thu, 7 Apr 2022 00:37:53 +0000 (08:37 +0800)]
* src/xselect.c (x_atom_to_symbol): Add XdndSelection.

2 years agoFix ses-tests.el
Vincent Belaïche [Wed, 6 Apr 2022 20:59:43 +0000 (22:59 +0200)]
Fix ses-tests.el

* lisp/ses.el (ses-jump-cell-name-function): Docstring typo.

* test/lisp/ses-tests.el (ses--cells, foo, bar, B2, toto): Do not
do any outer defvar, but set the defvar only under the
with-suppressed-warnings directive to silence the byte-compiler.

2 years ago* lisp/ses.el: Fix 80-column-docstring warnings
Stefan Monnier [Wed, 6 Apr 2022 18:42:33 +0000 (14:42 -0400)]
* lisp/ses.el: Fix 80-column-docstring warnings

Also remove redundant `:group` args and prefer #' to quote function names.

2 years agoGet rid of extra sync looking up window through XTranslateCoordinates
Po Lu [Wed, 6 Apr 2022 12:48:06 +0000 (20:48 +0800)]
Get rid of extra sync looking up window through XTranslateCoordinates

* src/xterm.c (x_dnd_get_wm_state_and_proto): Return proxy as
well.
(x_dnd_get_target_window): Use that proxy.

2 years agoMove some X11 drag and drop processing to Lisp
Po Lu [Wed, 6 Apr 2022 12:29:30 +0000 (20:29 +0800)]
Move some X11 drag and drop processing to Lisp

* lisp/term/x-win.el: Set unsupported drop function.
* lisp/x-dnd.el (x-dnd-handle-unsupported-drop): New function.
* src/keyboard.c (kbd_buffer_get_event): Handle
UNSUPPORTED_DROP_EVENT.
* src/termhooks.h (enum event_kind): New event
`UNSUPPORTED_DROP_EVENT'.
* src/xterm.c (x_dnd_send_unsupported_drop): Send those events
instead.
(x_dnd_do_unsupported_drop): Move actual unsupported drop
handling here.
(syms_of_xterm): New variable `x-dnd-unsupported-drop-function'.
* src/xterm.h: Update prototypes.

2 years agoFix minor-mode doc string quoting
Lars Ingebrigtsen [Wed, 6 Apr 2022 11:47:46 +0000 (13:47 +0200)]
Fix minor-mode doc string quoting

* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Fix
double quoting of things like (default-value 'electric-pair-mode)
(bug#54746).

2 years agoMake the Foot terminal an alias of xterm-256color
Davide Masserut [Wed, 6 Apr 2022 10:24:09 +0000 (12:24 +0200)]
Make the Foot terminal an alias of xterm-256color

* lisp/faces.el (term-file-aliases): Make the foot terminal an alias
of xterm-256color (bug#54739).

2 years agoMake file-name-split returns driver name as well in Windows
Kien Nguyen [Wed, 6 Apr 2022 09:58:02 +0000 (11:58 +0200)]
Make file-name-split returns driver name as well in Windows

* lisp/files.el (file-name-split): Returns driver name as well in
Windows.
* lisp/net/browse-url.el (browse-url-file-url): Don't hexify colon
character in file path for Windows (bug#54721).

2 years agoAdd .bashrc detection to sh-mode
Davide Masserut [Wed, 6 Apr 2022 09:37:38 +0000 (11:37 +0200)]
Add .bashrc detection to sh-mode

* lisp/progmodes/sh-script.el (sh-mode): Add .bashrc string-match
(bug#54727).

2 years agoUse CUA functions to scroll pages with pixel-scroll-scroll-mode
Markus Kopp [Wed, 6 Apr 2022 09:27:19 +0000 (17:27 +0800)]
Use CUA functions to scroll pages with pixel-scroll-scroll-mode

* lisp/pixel-scroll.el (pixel-scroll-interpolate-down)
(pixel-scroll-interpolate-up): Use `cua-scroll-up' and
`cua-scroll-down' to scroll if
`pixel-scroll-precision-interpolate-page' is off.  (bug#54696)

2 years agoPrevent races when trying to set Motif drag window
Po Lu [Wed, 6 Apr 2022 09:17:41 +0000 (17:17 +0800)]
Prevent races when trying to set Motif drag window

* src/xterm.c (xm_get_drag_window): Grab temp connection when
setting the drag window.

2 years agoRevert unneeded change in tramp-integration.el
Michael Albinus [Wed, 6 Apr 2022 07:51:09 +0000 (09:51 +0200)]
Revert unneeded change in tramp-integration.el

* lisp/net/tramp-integration.el:
Apply `connection-local-set-profiles' w/o retrieving old values.

2 years agoFix URL-related typos in comments and messages
Lars Ingebrigtsen [Wed, 6 Apr 2022 07:27:32 +0000 (09:27 +0200)]
Fix URL-related typos in comments and messages

* lisp/ffap.el (ffap-next): Fix typo in message.
* lisp/finder.el (finder-commentary): Fix typo in comment.

2 years agoImprove safety of haiku-drag-message
Po Lu [Wed, 6 Apr 2022 05:54:31 +0000 (05:54 +0000)]
Improve safety of haiku-drag-message

* lisp/term/haiku-win.el (haiku-drag-and-drop): Ignore
placeholder message.
* src/frame.c (delete_frame): Prevent deleting drop source frame
on Haiku.
* src/haiku_support.cc (RELEASE_NOW, CANCEL_DROP): New message
types.
(class EmacsView, MessageReceived): Handle new message types.
(be_drag_message): Drag CANCEL_DROP message on quit; also send
RELEASE_NOW to view if quitting.

* src/haikuselect.c (syms_of_haikuselect)
(haiku_unwind_drag_message): Clear new frame variable.
(Fhaiku_drag_message): Set new frame variable.
* src/haikuterm.h: Update prototypes.

2 years ago; * src/xterm.c: Improve commentary.
Po Lu [Wed, 6 Apr 2022 04:42:45 +0000 (12:42 +0800)]
; * src/xterm.c: Improve commentary.

2 years agoClean up more PGTK code
Po Lu [Wed, 6 Apr 2022 04:27:57 +0000 (12:27 +0800)]
Clean up more PGTK code

* lisp/term/pgtk-win.el (featurep):
(pgtk):
(pgtk-use-im-context):
(pgtk-handle-nxopen):
(pgtk-handle-nxopentemp):
(pgtk-ignore-1-arg):
([C-drag-n-drop]):
([M-drag-n-drop]):
([C-M-drag-n-drop]):
(pgtk-alternate-modifier):
(pgtk-right-alternate-modifier):
(pgtk-right-command-modifier):
(pgtk-right-control-modifier):
(pgtk-do-hide-emacs):
(pgtk-hide-others):
(pgtk-do-hide-others):
(pgtk-emacs-info-panel):
(pgtk-do-emacs-info-panel):
(pgtk-next-frame):
(pgtk-prev-frame):
(after-make-frame-functions):
(tool-bar-mode):
(pgtk-toggle-toolbar):
(pgtk-print-buffer):
(scalable-fonts-allowed):
(pgtk-standard-fontset-spec):
(pgtk-store-cut-buffer-internal):
(pgtk-copy-including-secondary):
(pgtk-paste-secondary):
(pgtk-suspend-error):
(window-system-initialization):
(after-init-hook): Remove code mindlessly copied from ns-win.el,
delete unused custom group, write doc strings and rename
variables duplicated from X to their names on X.  Also reformat
comments and code.
(pgtk-use-im-context-handler): New function.

* src/pgtkfns.c (syms_of_pgtkfns): Delete useless
AppleScript (!) code copied from NS.
* src/pgtkselect.c: Write FIXME about selection API usage.

* src/pgtkterm.c (get_keysym_name): Implement correctly instead
of sprintf'ing the numeric value of the keysym into a static
buffer.
(pgtk_set_window_size):
(xg_scroll_callback): Delete code that was #if 0'd out and
doesn't make sense on PGTK.
(pgtk_delete_terminal): Remove misleading comment.

2 years ago* src/emacs.c (main): Improve accuracy of daemon warning message on PGTK.
Po Lu [Wed, 6 Apr 2022 02:29:53 +0000 (10:29 +0800)]
* src/emacs.c (main): Improve accuracy of daemon warning message on PGTK.

2 years ago* src/xterm.c (x_dnd_send_unsupported_drop): Also handle TEXT target.
Po Lu [Wed, 6 Apr 2022 01:09:13 +0000 (09:09 +0800)]
* src/xterm.c (x_dnd_send_unsupported_drop): Also handle TEXT target.

2 years agoPreserve contents of PRIMARY when sending unsupported drop
Po Lu [Wed, 6 Apr 2022 00:55:30 +0000 (08:55 +0800)]
Preserve contents of PRIMARY when sending unsupported drop

* src/xterm.c (x_dnd_send_unsupported_drop): Set local value of
PRIMARY to the preexisting selection value, if any.

2 years agoPort Org encode-time usage back to Emacs 25
Paul Eggert [Wed, 6 Apr 2022 00:48:05 +0000 (17:48 -0700)]
Port Org encode-time usage back to Emacs 25

* lisp/org/ol.el (org-store-link):
* lisp/org/org-clock.el (org-clock-sum)
(org-clock-update-time-maybe):
* lisp/org/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org/org-macro.el (org-macro--vc-modified-time):
* lisp/org/org-macs.el (org-2ft, org-matcher-time):
* lisp/org/org-table.el (org-table-eval-formula):
* lisp/org/org.el (org-read-date, org-display-custom-time)
(org-time-string-to-time, org-timestamp-change):
Don’t assume Emacs 27 encode-time, since standalone Org still
works with Emacs 25 and it’s easier if we minimize differences
from standalone Org.  Problem reported by Max Nikulin (Bug#54731).
This reverts much of 2021-12-16T17:40:21Z!eggert@cs.ucla.edu.

2 years ago* src/xterm.c (handle_one_xevent): Assert that hold_quit is present instead.
Po Lu [Wed, 6 Apr 2022 00:48:41 +0000 (08:48 +0800)]
* src/xterm.c (handle_one_xevent): Assert that hold_quit is present instead.

2 years agoPacify gcc -Wanalyzer-null-dereference
Paul Eggert [Wed, 6 Apr 2022 00:20:34 +0000 (17:20 -0700)]
Pacify gcc -Wanalyzer-null-dereference

* src/xterm.c (handle_one_xevent): Don’t dereference HOLD_QUIT if
it’s null.  Potential problem found with gcc 11.2.1 20220127 (Red
Hat 11.2.1-9), when configured with --enable-gcc-warnings.

2 years agoAllow completion wrapping in minibuffer completion navigation commands
Juri Linkov [Tue, 5 Apr 2022 20:08:48 +0000 (23:08 +0300)]
Allow completion wrapping in minibuffer completion navigation commands

* lisp/minibuffer.el (minibuffer-previous-completion)
(minibuffer-next-completion): Don't set completion-wrap-movement.

2 years ago* test/lisp/ses-tests.el: Require ert-x, for ert-simulate-keys.
Glenn Morris [Tue, 5 Apr 2022 19:45:59 +0000 (12:45 -0700)]
* test/lisp/ses-tests.el: Require ert-x, for ert-simulate-keys.

2 years agoNew commands for navigating completions from the minibuffer.
Juri Linkov [Tue, 5 Apr 2022 19:20:16 +0000 (22:20 +0300)]
New commands for navigating completions from the minibuffer.

* lisp/simple.el (minibuffer-local-shell-command-map):
* lisp/minibuffer.el (minibuffer-local-completion-map):
Bind "M-<up>" to minibuffer-choose-previous-completion,
"M-<down>" to minibuffer-choose-next-completion,
"M-S-<up>" to minibuffer-previous-completion,
"M-S-<down>" to minibuffer-next-completion,
"M-RET" to minibuffer-choose-completion.
(with-minibuffer-completions-window): New macro.
(minibuffer-previous-completion, minibuffer-next-completion)
(minibuffer-choose-previous-completion)
(minibuffer-choose-next-completion)
(minibuffer-choose-completion): New commands.

https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00335.html

2 years agoUse base prefix and suffix instead of completion-base-position (bug#49931)
Juri Linkov [Tue, 5 Apr 2022 18:54:11 +0000 (21:54 +0300)]
Use base prefix and suffix instead of completion-base-position (bug#49931)

* lisp/minibuffer.el (minibuffer-completion-help):
Set completion-base-affixes from base-prefix and base-suffix.
In completion-list-insert-choice-function handle
string values of start/end as prefix/suffix.

* lisp/simple.el (completion-base-affixes)
(completion-use-base-affixes): New variables.
(choose-completion): Let-bind base-affixes to completion-base-affixes.
Use base-affixes when completion-use-base-affixes is non-nil.
(completion-setup-function): Sync values of base-affixes and
completion-base-affixes.

2 years agoChoosing a completion with a prefix argument doesn't exit the minibuffer
Juri Linkov [Tue, 5 Apr 2022 18:21:42 +0000 (21:21 +0300)]
Choosing a completion with a prefix argument doesn't exit the minibuffer

* lisp/simple.el (choose-completion): New optional args NO-EXIT and NO-QUIT.
(bug#47417)

2 years ago* test/lisp/replace-tests.el: New tests for query-replace (bug#54733)
Juri Linkov [Tue, 5 Apr 2022 17:52:28 +0000 (20:52 +0300)]
* test/lisp/replace-tests.el: New tests for query-replace (bug#54733)

* test/lisp/replace-tests.el (query-replace-tests): New defconst.
(query-replace--perform-tests): New function.
(query-replace-tests, query-replace-search-function-tests): New ert-deftest.

2 years ago; * admin/notes/emba: Fix typos
Robert Pluim [Tue, 5 Apr 2022 16:12:59 +0000 (18:12 +0200)]
; * admin/notes/emba: Fix typos

2 years agoReject invalid time-string in appt-add immediately
Robert Pluim [Tue, 1 Mar 2022 14:24:08 +0000 (15:24 +0100)]
Reject invalid time-string in appt-add immediately

* lisp/calendar/appt.el (appt-add): Check the provided time-string for
validity immediately after reading it rather than after reading all
the parameters.  (Bug#54210)

2 years agoHandle remote system processes
Michael Albinus [Tue, 5 Apr 2022 15:08:03 +0000 (17:08 +0200)]
Handle remote system processes

* doc/lispref/files.texi (Magic File Names):
Add list-system-processes and process-attributes.

* doc/lispref/processes.texi (System Processes): Document changes
in list-system-processes and process-attributes.

* doc/misc/tramp.texi (Customizing Completion): Use @ftable.
(Remote processes): Document changes in list-system-processes and
process-attributes.

* etc/NEWS: Document changes in proced, list-system-processes and
process-attributes.

* lisp/proced.el (proced-show-remote-processes): New defcustom.
(proced-remote-directory): Remove.
(proced-filter-alist): Use it.
(proced-user-name): New defun.
(proced-available): Set it to t.
(proced-mode): Adapt docstring.
(proced): Adapt docstring.  Acknowledge prefix argument.
(proced-format): Change initialization of `standard-attributes'.
(proced-send-signal, proced-renice): Adapt docstring.  Remove
special handling of prefix argument.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add 'list-system-processes' and `process-attributes'.

* lisp/net/tramp-integration.el (files-x): Require `files-x'.
(tramp-bsd-process-attributes-ps-args)
(tramp-bsd-process-attributes-ps-format)
(tramp-connection-local-bsd-ps-variables)
(tramp-busybox-process-attributes-ps-args)
(tramp-busybox-process-attributes-ps-format)
(tramp-connection-local-busybox-ps-variables):
* lisp/net/tramp-adb.el (tramp-adb-connection-local-default-ps-variables):
New defconsts.  Add them to connection-local variables.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Add 'list-system-processes' and `process-attributes'.
(tramp-process-attributes-ps-args)
(tramp-process-attributes-ps-format): New defconsts.
(tramp-ps-time, tramp-get-process-attributes)
(tramp-handle-list-system-processes)
(tramp-handle-process-attributes): New defuns.

* src/process.c (Flist_system_processes, Fprocess_attributes):
Support remote system processes.
(Qlist_system_processes, Qprocess_attributes): Declare symbols.

2 years agoMark some data during drag-and-drop
Po Lu [Tue, 5 Apr 2022 12:03:48 +0000 (20:03 +0800)]
Mark some data during drag-and-drop

It doesn't make sense to prevent the return frame or movement
frame from being deleted, but we should at least protect them
from garbage collection.

* src/alloc.c (garbage_collect): Call mark_xterm.
* src/xterm.c (x_dnd_begin_drag_and_drop)
(x_dnd_cleanup_drag_and_drop): Clear movement and return frames
upon DND completion.
(mark_xterm): Mark those frames.
* src/xterm.h: Update prototypes.

2 years agoFix some details in completions
Jimmy Aguilar Mena [Tue, 5 Apr 2022 11:08:36 +0000 (13:08 +0200)]
Fix some details in completions

* lisp/minibuffer.el (completion--insert-one-column) : Remove the extra
new-line at the end.
* lisp/simple.el (next-completion) : Fix behavior when
completion-wrap-movement and remove bobp and eobp. This removes the
extra tab ad the end of the list before wrapping or going to the
minibuffer and apparently also fixes bug#54374
(switch-to-completions) : Simplify condition code and remove comment not
applicable anymore.

2 years ago; * lisp/term/haiku-win.el: Fix compiler warning on X.
Po Lu [Tue, 5 Apr 2022 10:33:45 +0000 (10:33 +0000)]
; * lisp/term/haiku-win.el: Fix compiler warning on X.

2 years agoAllow dropping text to the root window
Po Lu [Tue, 5 Apr 2022 08:19:02 +0000 (16:19 +0800)]
Allow dropping text to the root window

* src/xterm.c (x_dnd_send_unsupported_drop): Allow dropping to
the root window.
(handle_one_xevent): Send unsupported drops to the last toplevel
instead of the target window.

2 years agoAdd support for dragging text onto windows that don't support any DND protocol
Po Lu [Tue, 5 Apr 2022 03:37:29 +0000 (11:37 +0800)]
Add support for dragging text onto windows that don't support any DND protocol

* src/xselect.c (x_own_selection): Export function.
(x_handle_selection_request): Handle selection requests to the
pending DND time.
(x_set_pending_dnd_time): New function.

* src/xterm.c (x_dnd_send_unsupported_drop): New function.
Implement according to the suggestions in the XDND protocol
specification.
(x_dnd_get_target_window): Return the toplevel window as well.
(x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop)
(x_dnd_update_state, handle_one_xevent): Send unsupported drops
and use last seen toplevel instead of target for `return_frame'.
* src/xterm.h: Update prototypes.

2 years ago* configure.ac (HAVE_GIF): Respect --with-gif on PGTK. (bug#54633)
Po Lu [Tue, 5 Apr 2022 01:07:36 +0000 (09:07 +0800)]
* configure.ac (HAVE_GIF): Respect --with-gif on PGTK.  (bug#54633)

2 years agoRespect new DND options when dragging to ourselves on Haiku
Po Lu [Tue, 5 Apr 2022 00:54:03 +0000 (00:54 +0000)]
Respect new DND options when dragging to ourselves on Haiku

* lisp/mouse.el (mouse-drag-and-drop-region): Allow dragging to
the current frame if we know `return-frame' doesn't work.
* lisp/term/haiku-win.el (haiku-dnd-drag-handler): New function.
* src/haiku_support.cc (MouseMoved): Don't send drag motion
events for the drag frame.
* src/haikuselect.c (haiku_note_drag_motion_1)
(haiku_note_drag_motion_2, haiku_note_drag_motion): New
functions.
(syms_of_haikuselect): New variable `haiku-drag-track-function'.
* src/haikuterm.c (haiku_read_socket): Note mouse motion in that
case.q
* src/haikuterm.h: Update prototypes.

2 years ago* lisp/progmodes/cc-cmds.el (indent-new-comment-line): Delete advice
Stefan Monnier [Mon, 4 Apr 2022 19:11:46 +0000 (15:11 -0400)]
* lisp/progmodes/cc-cmds.el (indent-new-comment-line): Delete advice

This piece of advice was effective only for Emacs<20.1 and old XEmacs
(at least older than Aug 2007).

2 years agoOClosure: add support for `slot-value`
Stefan Monnier [Mon, 4 Apr 2022 19:06:47 +0000 (15:06 -0400)]
OClosure: add support for `slot-value`

* lisp/emacs-lisp/oclosure.el (oclosure--slot-index)
(oclosure--slot-value, oclosure--set-slot-value): New functions.

* lisp/emacs-lisp/eieio-core.el (eieio-oset, eieio-oref):
Consolidate the type test.  Use `oclosure--(set-)slot-value`.
(eieio--validate-slot-value, eieio--validate-class-slot-value):
Don't presume `class` is an EIEIO class.
(eieio--class): Fix bogus `:type` info.
(eieio--object-class): Simplify.
(eieio--known-slot-name-p): New function.
(eieio-oref, eieio-oref-default, eieio-oset-default): Use it.

* test/lisp/emacs-lisp/oclosure-tests.el: Require `eieio`.
(oclosure-test): Make `name` field mutable.
(oclosure-test-slot-value): New test.

2 years ago; * src/alloc.c (grow_mark_stack): Remove unused variable.
Eli Zaretskii [Mon, 4 Apr 2022 18:09:43 +0000 (21:09 +0300)]
; * src/alloc.c (grow_mark_stack): Remove unused variable.

2 years agoSES with case insensitive cell names for jumping.
Vincent Belaïche [Mon, 4 Apr 2022 17:42:07 +0000 (19:42 +0200)]
SES with case insensitive cell names for jumping.

* doc/misc/ses.texi (The Basics): Document that ses-jump may be
customized.
(Customizing @acronym{SES}): Document new customisations for ses-jump.

* lisp/ses.el (ses-jump-cell-name-function)
(ses-jump-prefix-function): New defcustoms.
(ses-jump-prefix): New defun.
(ses-jump): Make ses-jump use the new defcustoms.

* test/lisp/ses-tests.el (ses-jump-B2-prefix-arg)
(ses-jump-B2-lowcase, ses-jump-B2-lowcase-keys)
(ses-jump-B2-symbol, ses-jump-B2-renamed): New tests.

2 years agoReduce GC mark-phase recursion by using explicit stack (bug#54698)
Mattias Engdegård [Sat, 2 Apr 2022 14:02:09 +0000 (16:02 +0200)]
Reduce GC mark-phase recursion by using explicit stack (bug#54698)

An explict stack of objects to be traversed for marking replaces
recursion for most common object types: conses, vectors, records, hash
tables, symbols, functions etc.  Recursion is still used for other
types but those are less common and thus not as likely to cause a
problem.

The stack grows dynamically as required which eliminates almost all C
stack overflow crashes in the GC.  There is also a nontrivial GC
performance improvement.

* src/alloc.c (GC_REMEMBER_LAST_MARKED, GC_CDR_COUNT): New.
(mark_char_table, struct mark_entry):
Remove (subsumed into process_mark_stack).
(struct mark_entry, struct mark_stack, mark_stk)
(mark_stack_empty_p, mark_stack_pop, grow_mark_stack)
(mark_stack_push_value, mark_stack_push_values)
(process_mark_stack): New.
(mark_object, mark_objects):
Just push the object(s) and let process_mark_stack do the work.

2 years agoUse correct signal oldset in posix_spawn implementation
Jürgen Hötzel [Fri, 4 Mar 2022 09:08:14 +0000 (10:08 +0100)]
Use correct signal oldset in posix_spawn implementation

posix_spawn was restoring the wrong signal set, which still had
SIGCHLD and SIGINT masked, causing problems with child processes that
spawned child processes.  (Bug#54667)

See the thread ending at
https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00067.html
for more details.

* src/callproc.c (emacs_spawn): Pass oldset parameter.
(emacs_posix_spawn_init_attributes): Use correct oldset.
(emacs_posix_spawn_init): Remove intermediate function.

2 years agotest/lisp/edmacro-tests.el: Adjust to recent changes
Stefan Monnier [Mon, 4 Apr 2022 13:55:03 +0000 (09:55 -0400)]
test/lisp/edmacro-tests.el: Adjust to recent changes

2 years agoedmacro.el: Silence warnings due to kmacro changes
Stefan Monnier [Mon, 4 Apr 2022 13:13:10 +0000 (09:13 -0400)]
edmacro.el: Silence warnings due to kmacro changes

* lisp/edmacro.el (edit-kbd-macro): Use `kmacro-p` and kmacro accessors.
(edmacro-finish-edit): Use `kmacro-p` and the new `kmacro` constructor.

2 years agoHandle mouse movement correctly during DND from one of our own frames
Po Lu [Mon, 4 Apr 2022 12:32:46 +0000 (20:32 +0800)]
Handle mouse movement correctly during DND from one of our own frames

* lisp/dnd.el (dnd-handle-movement): Select the window specified
in posn.
* lisp/term/x-win.el (x-dnd-movement): New function.
(x-dnd-movement-function): Set it as the default.
* src/frame.c (delete_frame): Prevent deleting the drop source
frame.
* src/xterm.c (x_dnd_send_position): Set new mouse movement
flags if the target window is one of our own frames.
(x_dnd_begin_drag_and_drop): Call DND movement function whenever
appropriate.
(x_free_frame_resources): Remove useless code.
(syms_of_xterm): New defvar `x-dnd-movement-function'.
* src/xterm.h: Update prototypes.

2 years agoFix generation of extra DND events while dragging on Haiku
Po Lu [Mon, 4 Apr 2022 11:37:12 +0000 (11:37 +0000)]
Fix generation of extra DND events while dragging on Haiku

* src/haiku_support.cc (be_drag_message): Set new DND flag.
(be_drag_and_drop_in_progress): New function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_read_socket): Don't store DND motion
events if DND is in progress.