Po Lu [Thu, 17 Feb 2022 05:25:01 +0000 (13:25 +0800)]
Improve handling of XI2 wheel movement
* src/xterm.c (handle_one_xevent): Process movement in all
directions and send it as a single event.
Po Lu [Thu, 17 Feb 2022 02:32:55 +0000 (02:32 +0000)]
Fix SIGFPE on some fonts when calculating their average width on Haiku
* src/haiku_font_support.cc (estimate_font_ascii): Avoid divison
by zero.
Po Lu [Thu, 17 Feb 2022 02:28:02 +0000 (10:28 +0800)]
* src/emacsgtkfixed.c (XSetWMSizeHints): Improve fix for bug#8919.
Po Lu [Thu, 17 Feb 2022 01:26:14 +0000 (01:26 +0000)]
Don't auto-lower when moving onto a menu bar on Haiku
* src/haiku_io.c (haiku_len): Handle `MENU_BAR_LEFT'.
* src/haiku_support.cc (EmacsMenuBar::MouseMoved): New function.
* src/haiku_support.h (enum haiku_event_type): New event
`MENU_BAR_LEFT'.
(struct haiku_menu_bar_left_event): New structure.
* src/haikuterm.c (haiku_read_socket): Don't auto-lower when the
mouse exits the frame view onto the menu bar and handle
MENU_BAR_LEFT events.
Po Lu [Thu, 17 Feb 2022 01:25:24 +0000 (01:25 +0000)]
Handle `unspecified' values of symbolic font values on Haiku
* src/haikufont.c (haikufont_spec_or_entity_to_pattern): Handle
`unspecified' values of symbolic values.
Michael Albinus [Wed, 16 Feb 2022 19:22:45 +0000 (20:22 +0100)]
Fix problem with file-modification-time in tramp-sshfs.el
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Use `tramp-handle-file-notify-add-watch',
`tramp-handle-file-notify-rm-watch' and
`tramp-handle-file-notify-valid-p'.
(tramp-sshfs-handle-write-region): Set file modification time.
(Bug#54016)
* test/lisp/net/tramp-tests.el (tramp--test-asynchronous-processes-p):
Filter out tramp-adb on multi-byte `default-directory'.
(tramp--test-hpux-p, tramp--test-macos-p): Protect against errors.
(tramp--test-check-files): Discriminate also tramp-sshfs.el.
Matthias Meulien [Mon, 14 Feb 2022 21:29:49 +0000 (22:29 +0100)]
Fix computation of outline heading level for non-git diff
* lisp/vc/diff-mode.el (diff-setup-buffer-type): Compute outline heading level
using diff-hunk-header-re (bug#51809).
(diff--font-lock-prettify): Disable prettify in non-git diff.
Eli Zaretskii [Wed, 16 Feb 2022 15:07:58 +0000 (17:07 +0200)]
Add support for Tai Tham script
* lisp/international/fontset.el (setup-default-fontset)
(script-representative-chars): Add tai-tham.
* lisp/language/thai.el ("Northern Thai"): New language
environment. Patch by Richard Wordingham
<richard.wordingham@ntlworld.com>. Set
'composition-function-table' for the Tai Tham block. Original
code by Richard Wordingham <richard.wordingham@ntlworld.com>.
* etc/HELLO: Add Northern Thai greeting.
* etc/NEWS: Announce addition of Northern Thai language environment.
Eli Zaretskii [Wed, 16 Feb 2022 13:37:57 +0000 (15:37 +0200)]
; * etc/NEWS: Fix wording of a recently added text.
Po Lu [Wed, 16 Feb 2022 11:54:40 +0000 (19:54 +0800)]
Fix recent change in xwidget.c
* src/xwidget.c (xwidget_init_view): Don't assume ttip_widget
is NULL if tooltips have not been initialized.
Mattias Engdegård [Wed, 16 Feb 2022 11:27:59 +0000 (12:27 +0100)]
Speed up count_size_as_multibyte
This function is used in many places to calculate the length of
a unibyte string converted to multibyte.
* src/character.c (count_size_as_multibyte): Move the overflow test
outside the loop, which makes it much faster. Standard compilers
will even vectorise it if asked to (-O2 in Clang, -O3 in GCC).
Mattias Engdegård [Wed, 16 Feb 2022 11:26:30 +0000 (12:26 +0100)]
Avoid emacs-module-tests failure on macOS
* test/src/emacs-module-tests.el (module/describe-function-1):
Prevent string mismatch caused by line breaks after filling;
the macOS dynamic library suffix (.dylib) is longer than on other
platforms.
Po Lu [Wed, 16 Feb 2022 07:40:39 +0000 (15:40 +0800)]
Fix frame focus handling with native input
* lisp/term/x-win.el (x-gtk-use-native-input-watcher): Stop
passing frame parameter to `x-internal-focus-input-context'.
* src/xfns.c (Fx_internal_focus_input_context): Focus all focus
frames from all displays.
Po Lu [Wed, 16 Feb 2022 06:38:06 +0000 (14:38 +0800)]
Resolve xwidget scrolling mysteries
* src/xterm.c (x_any_window_to_frame): Handle xwidget views.
(handle_one_xevent): Always increment values array when handling
motion events.
Po Lu [Wed, 16 Feb 2022 03:28:08 +0000 (11:28 +0800)]
* etc/NEWS: Improve the PGTK entry.
Po Lu [Wed, 16 Feb 2022 02:53:00 +0000 (10:53 +0800)]
Decode keyboard input as latin-1 whenever appropriate
* src/keyboard.c (kbd_buffer_get_event_1): Use `coding'
property if present.
* src/termhooks.h (enum event_kind): Document meaning of
`coding' property on text strings.
* src/xterm.c (handle_one_xevent): Set coding property on text
to latin-1 if it was obtained with XLookupString.
Po Lu [Wed, 16 Feb 2022 02:10:13 +0000 (10:10 +0800)]
Don't decode text within XIM callbacks or handle_one_xevent
* src/keyboard.c (kbd_buffer_get_event_1):
(kbd_buffer_get_event_2): New functions.
(kbd_buffer_get_event): Accept a new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT where .arg can be a unibyte
string to be decoded in the locale coding system.
* src/termhooks.h (enum event_kind): Document new meaning of
.arg in a multibyte keystroke event.
* src/xfns.c (struct x_xim_text_conversion_data): New struct.
(x_xim_text_to_utf8_unix_1):
(x_xim_text_to_utf8_unix_2): New functions.
(x_xim_text_to_utf8_unix): Handle decode failure correctly.
(xic_preedit_draw_callback): Abort IM context if text could not
be decoded correctly.
* src/xterm.c (handle_one_xevent): Utilize new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT.
Michael Albinus [Tue, 15 Feb 2022 15:16:50 +0000 (16:16 +0100)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Tue, 15 Feb 2022 15:15:55 +0000 (16:15 +0100)]
Some Tramp cleanup
* doc/misc/tramp.texi (Remote processes): Add also tramp-sshfs.el.
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Error-out for multi-byte `default-directory'.
* lisp/net/tramp.el (tramp-tolerate-tilde): Move it up.
(tramp-handle-abbreviate-file-name): Use it.
(tramp-read-passwd): Show literal passphrase prompt.
Eli Zaretskii [Tue, 15 Feb 2022 14:33:42 +0000 (16:33 +0200)]
; * etc/NEWS: Improve wording of savehist.el's entry.
Jim Porter [Mon, 14 Feb 2022 21:16:05 +0000 (13:16 -0800)]
Don't attempt to connect to a remote server during 'abbreviate-file-name'
* lisp/net/tramp.el (tramp-handle-abbreviate-file-name): Only use the
"home-directory" when a connection has been established.
Lars Ingebrigtsen [Tue, 15 Feb 2022 10:29:43 +0000 (11:29 +0100)]
Allow savehist-additional-variables to truncate lists
* lisp/savehist.el (savehist-save): Allow truncating values (bug#30943).
Lars Ingebrigtsen [Tue, 15 Feb 2022 09:59:56 +0000 (10:59 +0100)]
Adjust files-test-file-size-human-readable test
* test/lisp/files-tests.el (files-test-file-size-human-readable):
Fix test after recent change.
Lars Ingebrigtsen [Tue, 15 Feb 2022 09:54:30 +0000 (10:54 +0100)]
Make autoarg obsolete
* lisp/obsolete/autoarg.el: Make obsolete.
Arash Esbati [Tue, 15 Feb 2022 09:00:57 +0000 (10:00 +0100)]
; Fix commit
d6fba624e6
* doc/misc/gnus.texi (Gravatars): Adjust vindex entries.
Po Lu [Tue, 15 Feb 2022 07:27:31 +0000 (07:27 +0000)]
Fix parsing of some semibold font styles on Haiku
* src/haiku_font_support.cc (font_style_to_flags): Accept
"Semibold" to mean SemiBold as well. Reported by
augiedoggie <augiedoggie@users.noreply.github.com>.
Po Lu [Tue, 15 Feb 2022 07:21:18 +0000 (07:21 +0000)]
Disable auto-lowering and raising on Haiku when a popup is active
* src/haikuterm.c (haiku_new_focus_frame):
(haiku_read_socket): Don't raise or lower if popup is activated.
Po Lu [Tue, 15 Feb 2022 05:41:52 +0000 (13:41 +0800)]
Replace use of `DefaultRootWindow' with our recorded root window
* src/xfns.c (x_relative_mouse_position):
(x_set_parent_frame):
(Fx_mouse_absolute_pixel_position):
(Fx_set_mouse_absolute_pixel_position):
* src/xterm.c (x_iconify_frame): Use dpyinfo->root_window
instead of DefaultRootWindow.
Po Lu [Tue, 15 Feb 2022 04:52:30 +0000 (12:52 +0800)]
Improve the help message for the pgtk configure option
* configure.ac: Describe the purpose of PGTK better.
Aleksandr Vityazev [Mon, 14 Feb 2022 20:30:58 +0000 (20:30 +0000)]
; * doc/lispref/variables.texi (Setting Variables): Fix a typo.
Po Lu [Tue, 15 Feb 2022 02:23:49 +0000 (10:23 +0800)]
* src/xterm.c (init_xterm): Use more reliable method to disable XI2.
Po Lu [Tue, 15 Feb 2022 01:19:12 +0000 (09:19 +0800)]
Better handle devices being enabled on XI2
* src/xterm.c (handle_one_xevent): Don't abort on DeviceChanged
if the device couldn't be found, instead regenerating the device
hierarchy to see if it was enabled.
Eric Abrahamsen [Tue, 15 Feb 2022 00:06:14 +0000 (16:06 -0800)]
Fix docstring and init of Gnus search -remove-prefix options
* lisp/gnus/gnus-search.el (*-remove-prefix): For all engine defaults,
remove incorrect docs stating this is a regexp (it's a string). Also,
use `expand-file-name' to get the correct default value, not `concat'
and (getenv "HOME").
Eric Abrahamsen [Mon, 14 Feb 2022 23:11:37 +0000 (15:11 -0800)]
Fix manual documentation of Gnus tool bars
* doc/misc/gnus.texi: The options `gnus-use-toolbar',
`gnus-toolbar-thickness', and `gnus-summary-mail-toolbar' no longer
exist. Other options in this section have been renamed from "toolbar"
to "tool-bar".
Eric Abrahamsen [Mon, 14 Feb 2022 23:20:06 +0000 (15:20 -0800)]
Be more explicit about the meaning of "remove prefix" in Gnus search
* doc/misc/gnus.texi (Search Engines): It's easy to get confused about
what we're removing and why.
Eli Zaretskii [Mon, 14 Feb 2022 17:47:44 +0000 (19:47 +0200)]
; * doc/lispref/variables.texi (Setting Variables): Fix markup.
Eli Zaretskii [Mon, 14 Feb 2022 17:38:56 +0000 (19:38 +0200)]
; Improve a recently added NEWS entry about 'command-query'.
Eli Zaretskii [Mon, 14 Feb 2022 17:23:28 +0000 (19:23 +0200)]
Improve recent addition to documentation of face remapping
* doc/lispref/display.texi (Basic Faces): Make the list of basic
faces more complete.
(Face Remapping): Improve wording of a recent addition; add
cross-reference to "Basic Faces".
Eli Zaretskii [Mon, 14 Feb 2022 16:59:38 +0000 (18:59 +0200)]
Improve format of values returned by 'file-size-human-readable'
* lisp/files.el (file-size-human-readable): Emit one digit of the
fractional part of the size only if there's just one digit before
the decimal point.
Lars Ingebrigtsen [Mon, 14 Feb 2022 14:16:42 +0000 (15:16 +0100)]
Fix typo in Face Remapping
* doc/lispref/display.texi (Face Remapping): Fix typo.
Lars Ingebrigtsen [Mon, 14 Feb 2022 11:00:22 +0000 (12:00 +0100)]
Don't signal errors in abbrev-table-p
* lisp/abbrev.el (abbrev-table-p): Ignore the error.
* src/lread.c (oblookup): Signal `wrong-type-argument' instead of
`error' if it turns out that we're not really in an obarray (bug#53988).
Philip Kaludercic [Mon, 14 Feb 2022 10:51:06 +0000 (11:51 +0100)]
Improve stability of message-hide-headers
* message.el (message-hide-headers): Use a pointer instead of tracking
the "end-of-headers" point manually (bug#53991).
Po Lu [Mon, 14 Feb 2022 10:39:56 +0000 (18:39 +0800)]
Premultiply background color by alpha for images
* src/xterm.c (x_query_frame_background_color): Premultiply
colors as X wants them when built without Cairo.
Lars Ingebrigtsen [Mon, 14 Feb 2022 10:39:55 +0000 (11:39 +0100)]
Fix typo in previous Face Remapping doc change
* doc/lispref/display.texi (Face Remapping): Fix typo.
Lars Ingebrigtsen [Mon, 14 Feb 2022 10:38:11 +0000 (11:38 +0100)]
Note caveat about remapping basic faces
* doc/lispref/display.texi (Face Remapping): Note caveat about
basic faces (bug#53636).
Po Lu [Mon, 14 Feb 2022 10:17:58 +0000 (10:17 +0000)]
Improve Haiku selection handling
* lisp/select.el (gui--selection-value-internal): Use X types on
Haiku as well.
* lisp/term/haiku-win.el (haiku--selection-type-to-mime): Update
types to correspond better with X.
* src/haikuselect.c (Fhaiku_selection_data):
(Fhaiku_selection_put): Remove a great deal of ad hoc code now
handled by the regular selection machinery.
Lars Ingebrigtsen [Mon, 14 Feb 2022 10:20:41 +0000 (11:20 +0100)]
Add a mechanism for querying before executing a command
* doc/emacs/custom.texi (Disabling): Document it.
* doc/lispref/commands.texi (Disabling Commands): Document the
low-level stuff.
* lisp/simple.el (command-execute): Respect the `(query ...)'
value for `disabled'.
(command-execute--query): New function.
(command-query): New function.
Po Lu [Mon, 14 Feb 2022 07:12:17 +0000 (07:12 +0000)]
Handle allocation failures of fringe bitmaps on Haiku
* src/haikuterm.c (haiku_define_fringe_bitmap): Handle
allocation failures.
Po Lu [Mon, 14 Feb 2022 06:05:46 +0000 (14:05 +0800)]
* etc/TODO: Update some entires related to macOS and NS.
Xwidgets have worked on NS for a long time, "smooth scrolling"
is now available as `pixel-scroll-precision-mode' for all GUI
platforms, and some mouse gestures have been implemented on NS
and X.
Po Lu [Mon, 14 Feb 2022 05:13:13 +0000 (13:13 +0800)]
Ensure bad values don't leak into scroll valuators after DeviceChange
* src/xterm.c (xi_reset_scroll_valuators_for_device_id): New
argument `pending_only'.
(handle_one_xevent): Reset pending scroll valuators on XI_Enter
and mark valuators updated via DeviceChanged events as pending.
* src/xterm.h (struct xi_scroll_valuator_t): New field
`pending_enter_reset'.
Po Lu [Mon, 14 Feb 2022 03:51:22 +0000 (11:51 +0800)]
Restore valuator values after receiving a DeviceChanged event
* src/xterm.c (x_init_master_valuators): Generate valuators for
both master and slave devices.
(handle_one_xevent): Find current valuator info and use that to
populate scroll valuators after a device changed.
Po Lu [Mon, 14 Feb 2022 03:16:38 +0000 (11:16 +0800)]
Improve efficency of handling DeviceChanged events
* src/xterm.c (handle_one_xevent): Just update the device that
was changed on DeviceChanged and only do hierarchy recalculation
upon HierarchyChanged events.
Po Lu [Mon, 14 Feb 2022 01:52:05 +0000 (09:52 +0800)]
Try to reduce empty areas on GTK when a frame is being resized
* src/xterm.c (x_fill_rectangle):
(x_clear_rectangle, x_draw_image_glyph_string):
(x_clear_area): Don't use picture if frame background is opaque.
Po Lu [Mon, 14 Feb 2022 01:34:09 +0000 (01:34 +0000)]
Fix wide fringe bitmap processing on Haiku
* src/haiku_support.cc (BBitmap_import_mono_bits): Rewrite to
use ImportBits.
(BBitmap_import_fringe_bitmap): New function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_define_fringe_bitmap): Pass entire
short array to BBitmap_import_fringe_bitmap instead.
Michael Albinus [Sun, 13 Feb 2022 19:50:51 +0000 (20:50 +0100)]
Improve Tramp's process-file implementations
* lisp/net/tramp-adb.el (tramp-adb-handle-process-file)
* lisp/net/tramp-sh.el (tramp-sh-handle-process-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-process-file):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file):
Improve implementation. (Bug#53854)
* test/lisp/net/tramp-tests.el (tramp-test28-process-file)
(tramp--test-check-files, tramp-test47-unload): Extend tests.
Juri Linkov [Sun, 13 Feb 2022 18:44:14 +0000 (20:44 +0200)]
* lisp/faces.el (read-face-name-sample-text): Add defconst (bug#53960).
(read-face-name): Use it instead of hard-coded string.
Lars Ingebrigtsen [Sun, 13 Feb 2022 15:29:26 +0000 (16:29 +0100)]
Add a new macro `setopt'
* doc/emacs/custom.texi (Examining): Mention it.
(Init Syntax): Ditto.
* doc/emacs/windows.texi (Window Choice): Adjust example.
* doc/lispref/windows.texi (Choosing Window Options): Adjust examples.
* doc/lispref/variables.texi (Setting Variables): Document setopt.
* doc/misc/eudc.texi (Emacs-only Configuration): Adjust examples.
* lisp/cus-edit.el (setopt): New macro.
Eli Zaretskii [Sun, 13 Feb 2022 13:05:13 +0000 (15:05 +0200)]
; * lisp/simple.el (count-words): Doc fix.
Po Lu [Sun, 13 Feb 2022 12:15:21 +0000 (12:15 +0000)]
* src/haikuterm.c (haiku_read_socket): Implement auto-lower.
Po Lu [Sun, 13 Feb 2022 11:50:20 +0000 (19:50 +0800)]
Only get rid of IC focus if focus is really gone
* src/xterm.c (x_focus_changed): Only unset IC focus if the
focus state is empty.
Lars Ingebrigtsen [Sun, 13 Feb 2022 10:23:43 +0000 (11:23 +0100)]
Remove the 'C-k' binding in ido-mode
* lisp/ido.el (ido-file-completion-map): Remove the `C-k' binding,
because it's too dangerous and probably not very useful (bug#44556).
Po Lu [Sun, 13 Feb 2022 10:19:51 +0000 (18:19 +0800)]
Prevent crashes from illegal locale coding systems
* src/xfns.c (xic_preedit_draw_callback):
* src/xterm.c (handle_one_xevent): Don't pass invalid coding
systems to `setup_coding_system'.
Lars Ingebrigtsen [Sun, 13 Feb 2022 09:56:20 +0000 (10:56 +0100)]
Make `C-u M-x count-words' also give totals
* lisp/simple.el (count-words-region): Adjust callers.
(count-words): If given a prefix, give totals (bug#9959).
(count-words--buffer-format, count-words--format): Rename and
don't message, but return the string.
Lars Ingebrigtsen [Sun, 13 Feb 2022 09:12:27 +0000 (10:12 +0100)]
Note meaning on nil HIST in Fread_from_minibuffer
* src/minibuf.c (Fread_from_minibuffer): Note the meaning of a nil
HIST parameter (bug#20063).
Lars Ingebrigtsen [Sun, 13 Feb 2022 08:35:55 +0000 (09:35 +0100)]
Fix mouse clicking in read-face-name
* lisp/faces.el (read-face-name): Put the data in the right
position so that clicking on completions work (bug#53960).
Bob Rogers [Sun, 13 Feb 2022 08:32:13 +0000 (09:32 +0100)]
Fix ietf-drums-remove-whitespace unmatched " and (
* lisp/mail/ietf-drums.el:
+ (ietf-drums-skip-comment): New helper function.
+ (ietf-drums-remove-comments): Use ietf-drums-skip-comment.
+ (ietf-drums-remove-whitespace): Handle unterminated quotes and
comments, as ietf-drums-remove-comments already does.
* test/lisp/mail/ietf-drums-tests.el:
+ Test unterminated quote and comment for
ietf-drums-remove-whitespace and ietf-drums-remove-comments (bug#53965).
Andreas Schwab [Sun, 13 Feb 2022 08:10:25 +0000 (09:10 +0100)]
* src/eval.c (specpdl_unrewind): Remove empty statement.
Lars Ingebrigtsen [Sun, 13 Feb 2022 07:26:55 +0000 (08:26 +0100)]
Avoid a compilation warning in eval.c
* src/eval.c (specpdl_unrewind): Avoid a compilation warning.
Po Lu [Sun, 13 Feb 2022 05:26:41 +0000 (13:26 +0800)]
Fix integer overflow with 32-bit visual
* src/xfns.c (x_set_border_pixel):
(x_set_border_color): Use `unsigned long' for border color.
Po Lu [Sun, 13 Feb 2022 03:29:44 +0000 (11:29 +0800)]
Work around tooltip bug on new versions of WebKitGTK
* src/xwidget.c (dummy_tooltip_string): New variable.
(xw_maybe_synthesize_crossing): Call `xg_prepare_tooltip' to
disable tooltips on WebKitGTK 2.34 or later.
(syms_of_xwidget): Make dummy string.
Po Lu [Sun, 13 Feb 2022 03:00:52 +0000 (11:00 +0800)]
Stop quering for Xinerama inside x_get_monitor_attributes
* src/xfns.c (x_get_monitor_attributes): Remove Xinerama check
and use xinerama_supported_p instead.
* src/xterm.c (x_term_init): Set `xinerama_supported_p'
* src/xterm.h (struct x_display_info): New field
`xinerama_supported_p'.
Po Lu [Sun, 13 Feb 2022 02:05:30 +0000 (10:05 +0800)]
* src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag.
Po Lu [Sun, 13 Feb 2022 01:34:12 +0000 (09:34 +0800)]
Use better GC for visible bell on colormapped visuals
* src/xterm.c (XTflash): Use normal_gc if the visual is not
TrueColor.
Po Lu [Sun, 13 Feb 2022 00:48:55 +0000 (00:48 +0000)]
Fix the Haiku port
* src/haiku_support.h [__cplusplus]: Define `specpdl_ref' type
on C++ since that code cannot include lisp.h.
Po Lu [Sun, 13 Feb 2022 00:39:24 +0000 (08:39 +0800)]
Fix last change in xterm.c
* src/xterm.c (x_update_opaque_region): Remove check that f is
non-NULL.
(handle_one_xevent): If f is NULL and the configure event is for
any's edit widget, use that instead.
Stefan Monnier [Sat, 12 Feb 2022 22:47:21 +0000 (17:47 -0500)]
* src/xterm.c (x_update_opaque_region): Avoid crash at startup in Lucid build
Stefan Monnier [Sat, 12 Feb 2022 20:25:53 +0000 (15:25 -0500)]
Rewrite thread context switch code (bug#48990)
Make the context switch code handle buffer-local variables more
correctly by reusing the code originally written for `backtrace-eval`.
This has the side benefit of making the `saved_value` field unused.
* src/lisp.h (enum specbind_tag): Remove `saved_value` field.
(rebind_for_thread_switch, unbind_for_thread_switch): Delete decls.
(specpdl_unrewind): Declare function.
* src/eval.c (specpdl_saved_value): Delete function.
(specbind): Delete the code related to `saved_value`, and consolidate
common code between the different branches.
(rebind_for_thread_switch, -unbind_for_thread_switch): Move to `thread.c`.
(specpdl_unrewind): New function, extracted from `backtrace_eval_unrewind`.
Use `SET_INTERNAL_THREAD_SWITCH`. Skip the buffer & excursion unwinds
depending on new arg `vars_only`.
(backtrace_eval_unrewind): Use it.
(mark_specpdl): Don't mark `saved_value`.
* src/thread.c (rebind_for_thread_switch, unbind_for_thread_switch):
Move from `eval.c` and rewrite using `specpdl_unrewind`.
* test/src/thread-tests.el (threads-test-bug48990): New test.
* test/Makefile.in (test_template): Add a + as suggested by make:
"warning: jobserver unavailable: using -j1. Add '+' to parent make rule".
Mattias Engdegård [Thu, 3 Feb 2022 09:26:27 +0000 (10:26 +0100)]
Speed up `=` on fixnums in bytecode
Now that EQ has become expensive, use BASE_EQ where possible.
* src/bytecode.c (exec_byte_code): Use cheaper operation for Beqlsign.
Eli Zaretskii [Sat, 12 Feb 2022 18:45:06 +0000 (20:45 +0200)]
; * src/xdisp.c (syms_of_xdisp): Fix formatting of last change.
Eli Zaretskii [Sat, 12 Feb 2022 18:38:51 +0000 (20:38 +0200)]
Optionally allow point to enter composed character sequences
This changeset is based on code originally posted by
Kenichi Handa <handa@gnu.org> as part of discussing bug#20140,
with a few adjustments and changes, mainly to support R2L
text and provide a user option to control the feature.
* src/xdisp.c (compute_stop_pos, next_element_from_buffer)
(composition_reseat_it): Don't allow auto-composing characters
past point when 'composition-break-at-point' is non-nil.
(syms_of_xdisp) <composition-break-at-point>: New boolean variable.
(redisplay_internal, redisplay_window): Disable "just move the
cursor" optimizations when 'composition-break-at-point' is non-nil.
* src/keyboard.c (command_loop_1): Force redisplay when
'composition-break-at-point' is non-nil.
* lisp/cus-start.el (standard): Provide customization form for
'composition-break-at-point'.
* etc/NEWS: Announce the new feature.
Mattias Engdegård [Wed, 2 Feb 2022 16:42:07 +0000 (17:42 +0100)]
Count bytes, not records, in specpdl_ref
SPECPDL_INDEX becomes much faster because the pointer subtraction,
expensive because of the inconveniently sized specpdl records, is now
gone. This translates to a useful speedup on a wide variety of code.
* src/lisp.h (specpdl_ref, wrap_specpdl_ref, unwrap_specpdl_ref):
Rename member.
(specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_add, specpdl_ref_to_ptr, SPECPDL_INDEX):
Count offset in bytes rather than in records.
Mattias Engdegård [Wed, 2 Feb 2022 15:51:43 +0000 (16:51 +0100)]
Turn specpdl_ref into a type of its own
Wrap the specpdl_ref contents in a struct, which gives us some very
useful type checking to make sure that all code that assumed integral
specpdl refs has been converted.
We only do this on 64-bit platforms, since those tend to have modern
ABIs where small structs are optimised as scalars. In other words,
this change should not affect the compiled code.
* src/lisp.h (specpdl_ref): Now a struct on 64-bit platforms.
(wrap_specpdl_ref, unwrap_specpdl_ref): New.
(specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_eq, specpdl_ref_lt)
(specpdl_ref_valid_p, make_invalid_specpdl_ref): Use new wrappers.
Mattias Engdegård [Sat, 12 Feb 2022 15:05:17 +0000 (16:05 +0100)]
Replace ptrdiff_t with new specpdl_ref type for specpdl references
The specpdl_ref type is just an alias for ptrdiff_t; the compiled code
remains the same. All operations on specpdl_ref (arithmetic,
comparison etc) now go through inline functions.
The bulk of the change is almost completely mechanical. It is done to
prepare for a type-safe representation and subsequent performance
improvement.
* src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count)
(specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p)
(make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New.
(SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free)
(safe_free_unbind_to):
* src/alloc.c (run_finalizer_function, inhibit_garbage_collection)
(garbage_collect, Fgarbage_collect, which_symbols):
* src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start):
* src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay)
(Fdelete_overlay):
* src/bytecode.c (exec_byte_code):
* src/callint.c (Ffuncall_interactively, Fcall_interactively):
* src/callproc.c (Fcall_process, call_process, create_temp_file)
(Fcall_process_region):
* src/charset.c (load_charset_map_from_file):
* src/coding.c (decode_coding_gap, decode_coding_object)
(encode_coding_object, Fread_coding_system):
* src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit):
* src/composite.c (update_compositions, autocmp_chars):
* src/cygw32.c (conv_filename_to_w32_unicode)
(conv_filename_from_w32_unicode):
* src/data.c (notify_variable_watchers):
* src/decompress.c (Fzlib_decompress_region):
* src/dired.c (directory_files_internal, file_name_completion)
(file_attributes):
* src/dispnew.c (Fredisplay):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/editfns.c (Fsave_excursion, Fsave_current_buffer)
(Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction)
(styled_format):
* src/emacs-module.c (Fmodule_load, funcall_module):
* src/emacs.c (init_cmdargs, Fdump_emacs):
* src/eval.c (call_debugger, do_debug_on_call, FletX, Flet)
(Ffuncall_with_delayed_message, Funwind_protect)
(internal_lisp_condition_case, signal_or_quit)
(load_with_autoload_queue, Feval, grow_specpdl_allocation)
(record_in_backtrace, eval_sub, Ffuncall, apply_lambda)
(funcall_lambda, clear_unwind_protect, set_unwind_protect)
(set_unwind_protect_ptr, unbind_to, Fbacktrace_eval):
* src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file)
(Finsert_file_contents, write_region, Fdo_auto_save):
* src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call):
* src/fringe.c (update_window_fringes):
* src/gtkutil.c (xg_dialog_run):
* src/haiku_io.c (c_specpdl_idx_from_cxx):
* src/haiku_support.cc (be_popup_file_dialog):
* src/haiku_support.h (c_specpdl_idx_from_cxx):
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame)
(haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name):
* src/haikumenu.c (haiku_popup_dialog, set_frame_menubar):
* src/image.c (slurp_file):
* src/indent.c (line_number_display_width, Fvertical_motion):
* src/insdel.c (signal_before_change, signal_after_change)
(Fcombine_after_change_execute):
* src/intervals.c (get_local_map):
* src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert)
(Fjson_parse_string, Fjson_parse_buffer):
* src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error)
(Finternal_track_mouse, command_loop_1, read_menu_command)
(safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2)
(menu_item_eval_property, read_key_sequence, read_key_sequence_vs)
(Fsuspend_emacs):
* src/keymap.c (Fcurrent_active_maps, Fdescribe_vector)
(Fhelp__describe_vector):
* src/lread.c (Fload, save_match_data_load, readevalloop)
(Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1):
* src/macros.c (Fexecute_kbd_macro):
* src/menu.c (x_popup_menu_1):
* src/minibuf.c (read_minibuf, set_minibuffer_mode)
(read_minibuf_unwind, Fread_string, Fread_buffer):
* src/nsfns.m (Fx_create_frame, Fx_show_tip):
* src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
* src/pdumper.c (Fdump_emacs_portable):
* src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip)
(Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font):
* src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu)
(pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show)
(pgtk_popup_dialog):
* src/pgtkterm.c (pgtk_cr_export_frames):
* src/print.c (PRINTPREPARE, temp_output_buffer_setup)
(Fprin1_to_string, print_vectorlike):
* src/process.c (Fmake_process, create_process, Fmake_pipe_process)
(Fmake_serial_process, connect_network_socket, Fmake_network_process)
(network_interface_info, server_accept_connection)
(wait_reading_process_output, read_process_output, exec_sentinel):
* src/regex-emacs.c (re_match_2_internal):
* src/search.c (looking_at_1, fast_looking_at, search_buffer_re):
* src/sound.c (Fplay_sound_internal):
* src/sysdep.c (system_process_attributes):
* src/term.c (tty_menu_show):
* src/textprop.c (Fnext_single_char_property_change)
(Fprevious_single_char_property_change, add_text_properties_1)
(set_text_properties, set_text_properties_1, Fremove_text_properties)
(Fremove_list_of_text_properties):
* src/thread.c (Fmutex_lock, invoke_thread_function):
* src/undo.c (truncate_undo_list):
* src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip)
(Fx_show_tip, Fx_file_dialog):
* src/w32font.c (Fx_select_font):
* src/w32menu.c (set_frame_menubar):
* src/window.c (window_list, next_window, window_list_1)
(run_window_configuration_change_hook, Frun_window_scroll_functions)
(run_window_change_functions, set_window_buffer)
(temp_output_buffer_show, window_scroll, scroll_command)
(Fscroll_other_window, Fscroll_other_window_down):
* src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop)
(handle_single_display_spec, Fbuffer_text_pixel_size)
(message_dolog, with_echo_area_buffer, setup_echo_area_for_printing)
(display_echo_area, set_message, clear_message, echo_area_display)
(gui_consider_frame_title, prepare_menu_bars, update_menu_bar)
(update_tab_bar, update_tool_bar, redisplay_internal)
(redisplay_preserve_echo_area, run_window_scroll_functions)
(redisplay_window, extend_face_to_end_of_line)
(display_count_lines_logically, display_count_lines_visually)
(display_mode_lines, display_mode_line, Fformat_mode_line)
(decode_mode_spec):
* src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip)
(Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog):
* src/xmenu.c (set_frame_menubar, create_and_show_popup_menu)
(x_menu_show, create_and_show_dialog, x_dialog_show)
(xw_popup_dialog):
* src/xselect.c (x_get_local_selection, x_reply_selection_request)
(x_handle_selection_request, wait_for_property_change):
* src/xterm.c (x_cr_export_frames, x_connection_closed):
Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the
corresponding functions instead of direct arithmetic.
Po Lu [Sat, 12 Feb 2022 12:25:00 +0000 (20:25 +0800)]
Fix entry and exit events with XI2 grabs on X toolkit menus
* src/xmenu.c (popup_get_selection): Only claim cookie if new
event will be generated.
(create_and_show_popup_menu): Ungrab XI2 device, then
immediately set core grab on the frame's edit widget window.
* src/xterm.c (handle_one_xevent): Use x_any_window_to_frame to
find exit event frame if a popup menu is active.
Eli Zaretskii [Sat, 12 Feb 2022 11:43:36 +0000 (13:43 +0200)]
Clean up mode-line-* faces handling
* src/xfaces.c (realize_basic_faces):
* src/dispextern.h (enum face_id): Remove MODE_LINE_ID.
Lars Ingebrigtsen [Sat, 12 Feb 2022 08:04:14 +0000 (09:04 +0100)]
Add documentation on how to delete files from Trash
* doc/emacs/files.texi (Misc File Ops): Note trick to make `D'
work in Trash directories (bug#44059).
Lars Ingebrigtsen [Sat, 12 Feb 2022 07:40:30 +0000 (08:40 +0100)]
Improve interaction between track-mouse and edebug
* lisp/emacs-lisp/edebug.el (edebug--display-1): Work around
`track-mouse' oddity (bug#675).
Lars Ingebrigtsen [Sat, 12 Feb 2022 07:07:42 +0000 (08:07 +0100)]
Fix off-by-one file size formatting in ls-lisp
* lisp/ls-lisp.el (ls-lisp-format, ls-lisp-format-file-size): The
human-readable file sizes can be 7 characters wide (e.g.,
"1016.1k") (bug#53937).
Lars Ingebrigtsen [Fri, 11 Feb 2022 06:22:52 +0000 (07:22 +0100)]
Cross-link message-expand-name-standard-ui-relevant doc strings
* lisp/gnus/message.el (message-expand-name-standard-ui): Mention
the other relevant variables in the doc string (bug#50667).
Po Lu [Sat, 12 Feb 2022 04:42:42 +0000 (04:42 +0000)]
Implement visual bell on Haiku like on X
* src/haiku_draw_support.cc
(BView_FillRectangleForVisibleBell): Delete function.
(BView_InvertRect): New function.
* src/haiku_support.cc (class EmacsView): Delete field
`visible_bell_color' and visible bell related methods.
(EmacsView_do_visible_bell): Delete function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_flash): Implement using
`BView_InvertRect'.
(haiku_beep): Use `haiku_flash' instead.
Po Lu [Sat, 12 Feb 2022 02:33:14 +0000 (10:33 +0800)]
Fix compatibility with ancient versions of libXi
* src/xmenu.c (popup_get_selection): Don't rely on xev->display
being non-NULL.
Po Lu [Sat, 12 Feb 2022 02:23:51 +0000 (10:23 +0800)]
Be less strict about which PointerEmulated button events to ignore
* src/xterm.c (handle_one_xevent): Ignore all PointerEmulated
button events.
Po Lu [Sat, 12 Feb 2022 01:20:53 +0000 (09:20 +0800)]
Never set opaque region without an alpha channel
* src/xfns.c (x_set_alpha_background): Don't modify opaque
region if the visual has no alpha channel.
Mattias Engdegård [Fri, 11 Feb 2022 20:41:11 +0000 (21:41 +0100)]
Modernise byte-compilation chapters in manual
* doc/lispref/compile.texi (Speed of Byte-Code): More representative
numbers for byte code; the difference is much greater today.
(Compilation Functions, Disassembly): Example output for lexbind
bytecode.
Po Lu [Fri, 11 Feb 2022 12:26:04 +0000 (20:26 +0800)]
; * config.bat: Fix typo.
Po Lu [Fri, 11 Feb 2022 12:20:50 +0000 (20:20 +0800)]
Merge remote-tracking branch 'origin/master'
Po Lu [Fri, 11 Feb 2022 12:19:34 +0000 (20:19 +0800)]
Fix the DJGPP port
* config.bat:
* msdos/sed1v2.inp:
* msdos/sedlibmk.inp: Update for present Emacs.
* src/Makefile.in (MAKE_PDUMPER_FINGERPRINT): Fix indentation
to not confuse sed*.inp.
* src/conf_post.h [MSDOS]: Define some things gnulib wants.
Michael Albinus [Fri, 11 Feb 2022 08:37:48 +0000 (09:37 +0100)]
Tolerate tilde in remote file names when needed
* lisp/net/tramp.el (tramp-tolerate-tilde): New defvar.
(tramp-handle-expand-file-name):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name):
Respect it.
* lisp/net/tramp-adb.el (tramp-adb-tolerate-tilde):
* lisp/net/tramp-sshfs.el (tramp-sshfs-tolerate-tilde): New defuns.
Advice `shell-mode' with them.
(tramp-methods) <sshfs>: Add "-t -t" to `tramp-login-args'.
Eli Zaretskii [Fri, 11 Feb 2022 08:15:20 +0000 (10:15 +0200)]
; * etc/DEVEL.HUMOR: Add a recent joke.
Andrew G Cohen [Fri, 11 Feb 2022 07:09:46 +0000 (15:09 +0800)]
Allow searching of nnselect (search) groups
* lisp/gnus/gnus-group.el (gnus-group-make-search-group):
(gnus-group-read-ephemeral-search-group): Ensure the server is
correctly identified even for nnselect groups.
* lisp/gnus/gnus-search.el (gnus-search-nnselect): New function.
(gnus-search-default-engines): Use it.
(gnus-search-make-spec): Queries from nnselect should always be raw.
* lisp/gnus/nnselect.el (gnus-search): Silence the byte-compiler.