1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-31 04:41:23 -08:00
Commit graph

155589 commits

Author SHA1 Message Date
Alan Third
9d20b47ad3 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.
2022-04-08 22:43:05 +01:00
Paul Eggert
022a1f48a4 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.
2022-04-08 10:19:21 -07:00
Mattias Engdegård
c2d78d09c1 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.
2022-04-08 15:34:57 +02:00
Mattias Engdegård
13c8cc58bb 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.
2022-04-08 15:00:38 +02:00
Lars Ingebrigtsen
e2f3b0f16e 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).
2022-04-08 14:46:14 +02:00
Po Lu
5c532fe303 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.
2022-04-08 19:36:34 +08:00
Mattias Engdegård
deb40b2267 ; * src/nsterm.m: Remove stray semicolon 2022-04-08 13:13:24 +02:00
Po Lu
410690085e 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.
2022-04-08 18:57:29 +08:00
Michael Albinus
d9851c6df2 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'.
2022-04-08 12:47:53 +02:00
Po Lu
c4921d1157 Fix GC marking of input events with devices
* src/keyboard.c (mark_kboards):
* src/pgtkterm.c (mark_pgtkterm): Mark `device' as well.
2022-04-08 17:00:37 +08:00
Po Lu
ac2708bf6f 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.
2022-04-08 13:37:16 +08:00
Po Lu
e984993954 * lisp/term/x-win.el (x-device-class): Detect more keyboards. 2022-04-08 12:12:08 +08:00
Sean Whitton
d8b7771418 ; * src/emacs.c (main): Reword & reflow description of PGTK problem. 2022-04-07 21:09:14 -07:00
Po Lu
c42ef4e7c1 Ignore input extension errors caused by grabbing
* src/xterm.c (x_error_handler): Ignore GrabDevice and
UngrabDevice errors.
2022-04-08 11:22:06 +08:00
Po Lu
598d1a2aa3 * lisp/term/x-win.el (x-device-class): Detect "USB USB Keykoard"s. 2022-04-08 11:03:27 +08:00
Po Lu
1a1c5a6884 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.
2022-04-08 09:47:25 +08:00
Po Lu
6ac7fa7e78 Fix reporting of last-event-device for synthetic events
* src/keyboard.c (read_char): Clear `last-event-device' earlier.
2022-04-08 08:22:40 +08:00
Po Lu
5414331d07 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.
2022-04-08 08:13:49 +08:00
Po Lu
0622df3611 * src/xterm.c (handle_one_xevent): Fix build warning on non-GTK builds. 2022-04-08 07:47:10 +08:00
Stefan Monnier
3c57867df4 lisp/simple.el: Use #' in new code
* lisp/simple.el (minibuffer-local-shell-command-map): Use #' to quote
function names.
2022-04-07 19:20:54 -04:00
Matthias Meulien
4397755983 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.
2022-04-07 16:01:31 -04:00
Stefan Monnier
39e8fd357d 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.
2022-04-07 15:59:09 -04:00
Po Lu
3b41141708 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'.
2022-04-07 21:16:11 +08:00
Po Lu
c1a6aa0c3e 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.
2022-04-07 19:43:41 +08:00
Lars Ingebrigtsen
4c8e23d5d7 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'.
2022-04-07 13:37:16 +02:00
Andrew G Cohen
d859cdd621 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.
2022-04-07 13:17:47 +02:00
Jai Flack
77f3bc37e1 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).
2022-04-07 13:14:01 +02:00
Michael Albinus
7e9807d41b * lisp/net/tramp-integration.el: Don't require files-x. 2022-04-07 12:11:11 +02:00
Po Lu
510eb1d401 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.
2022-04-07 14:32:10 +08:00
Po Lu
57ad2f333c * src/xterm.c (xm_write_targets_table): Remove extra XGrabServer pair. 2022-04-07 14:25:52 +08:00
Po Lu
48bbc4a9a1 Fix DND bugs on GTK
* src/xterm.c (handle_one_xevent): Don't let some client
messages reach the toolkit.
2022-04-07 14:02:34 +08:00
Po Lu
c6ea0772ec 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'.
2022-04-07 11:44:59 +08:00
Po Lu
1f4a0828cc ; * etc/PROBLEMS: Explain how to get dropping text on xterm to work. 2022-04-07 10:20:47 +08:00
Po Lu
7108c4165f 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.
2022-04-07 10:15:12 +08:00
Po Lu
33055c2608 Improve doc of x-begin-drag
* doc/lispref/frames.texi (Drag and Drop): Fix typos and clarify
meaning of XdndActionPrivate.
2022-04-07 08:57:25 +08:00
Po Lu
1e901298e3 Return an appropriate action when performing unsupported drop
* src/xterm.c (x_dnd_send_unsupported_drop): Set action to
XdndActionPrivate.
2022-04-07 08:55:00 +08:00
Po Lu
340e81f476 * src/xselect.c (x_atom_to_symbol): Add XdndSelection. 2022-04-07 08:37:53 +08:00
Vincent Belaïche
9a15e15b62 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.
2022-04-06 22:59:43 +02:00
Stefan Monnier
9b8b39cce1 * lisp/ses.el: Fix 80-column-docstring warnings
Also remove redundant `:group` args and prefer #' to quote function names.
2022-04-06 14:42:33 -04:00
Po Lu
fc62efc563 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.
2022-04-06 20:48:06 +08:00
Po Lu
c0bb11432e 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.
2022-04-06 20:30:24 +08:00
Lars Ingebrigtsen
406da54bc6 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).
2022-04-06 13:47:46 +02:00
Davide Masserut
45621c0b79 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).
2022-04-06 12:24:09 +02:00
Kien Nguyen
7eca680e54 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).
2022-04-06 11:58:02 +02:00
Davide Masserut
e32dcc7527 Add .bashrc detection to sh-mode
* lisp/progmodes/sh-script.el (sh-mode): Add .bashrc string-match
(bug#54727).
2022-04-06 11:38:08 +02:00
Markus Kopp
51a98a92e9 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)
2022-04-06 17:30:20 +08:00
Po Lu
f9da45df47 Prevent races when trying to set Motif drag window
* src/xterm.c (xm_get_drag_window): Grab temp connection when
setting the drag window.
2022-04-06 17:18:26 +08:00
Michael Albinus
fbf6b7d2f0 Revert unneeded change in tramp-integration.el
* lisp/net/tramp-integration.el:
Apply `connection-local-set-profiles' w/o retrieving old values.
2022-04-06 09:51:09 +02:00
Lars Ingebrigtsen
069e0ba9f3 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.
2022-04-06 09:27:52 +02:00
Po Lu
78ecd67888 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.
2022-04-06 05:54:31 +00:00