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.
Po Lu [Fri, 11 Feb 2022 06:46:25 +0000 (14:46 +0800)]
* etc/PROBLEMS: Document some limitations of Xwayland and PGTK.
Po Lu [Fri, 11 Feb 2022 05:59:03 +0000 (13:59 +0800)]
Don't make cursors affected by background alpha on PGTK
* src/ftcrfont.c (ftcrfont_draw):
* src/pgtkterm.c (x_clear_glyph_string_rect): Make behavior on
PGTK consistent with X.
Po Lu [Fri, 11 Feb 2022 05:44:42 +0000 (13:44 +0800)]
Set _NET_WM_OPAQUE_REGION on non-GTK3 toolkits when using 32 bit visual
* src/xfns.c (x_set_alpha_background): Set opaque region if
opaque.
* src/xterm.c (x_update_opaque_region): New parameter
`configure'. All callers changed.
(handle_one_xevent): Call `x_update_opaque_region' on configure
events.
Po Lu [Fri, 11 Feb 2022 05:30:11 +0000 (13:30 +0800)]
Fix fallout from switch to 32-bit visuals
* src/xfns.c (x_decode_color): Make return type wide enough to
hold any pixel value.
* src/xterm.h (x_make_truecolor_pixel): Simplify.
Po Lu [Fri, 11 Feb 2022 02:37:38 +0000 (02:37 +0000)]
Improve reliability of selection ownership on Haiku
* src/haiku_select.cc (count_clipboard, count_primary)
(count_secondary): Initialize to -1
(BClipboard_set_system_data)
(BClipboard_set_primary_selection_data)
(BClipboard_set_secondary_selection_data): Store count before
saving to the the clipboard.
(BClipboard_owns_clipboard, BClipboard_owns_primary)
(BClipboard_owns_secondary): Adjust tests accordingly.
Po Lu [Fri, 11 Feb 2022 01:26:45 +0000 (09:26 +0800)]
Disable nearest-color allocation on DirectColor visuals
* src/xterm.c (x_alloc_nearest_color_1): Disable such allocation
on DirectColor. The method we use can't possibly work there.
Mattias Engdegård [Thu, 10 Feb 2022 21:59:26 +0000 (22:59 +0100)]
Silence macOS vfork deprecation warnings
The vfork system call exists and works in macOS 11.6 but the compiler
gives a deprecation message; silence it, because the performance is
still better than that of plain fork. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2022-02/msg00260.html
* src/conf_post.h (VFORK): New #define.
* src/callproc.c (emacs_spawn):
* src/sysdep.c (sys_subshell): Use it.
Juri Linkov [Thu, 10 Feb 2022 18:57:42 +0000 (20:57 +0200)]
* lisp/mouse.el (context-menu-map): Select only unselected window (bug#53910)
Juri Linkov [Thu, 10 Feb 2022 18:52:55 +0000 (20:52 +0200)]
* lisp/tab-line.el (tab-line-format): Use mode-line-window-selected-p.
Recently 'mode-line-window-selected-p' was added to
'tab-line-tab-name-format-default'. Now add the same to another
place that handles the face 'tab-line-tab-current' (bug#53629).
Corwin Brust [Tue, 8 Feb 2022 23:48:14 +0000 (17:48 -0600)]
Autoload package-installed-p
* lisp/emacs-lisp/package.el (package-installed-p): Add autoload
cookie. (Bug#53885)
Copyright-paperwork-exempt: yes
Eli Zaretskii [Thu, 10 Feb 2022 17:12:19 +0000 (19:12 +0200)]
Merge from origin/emacs-28
# Conflicts:
# lisp/startup.el
Eli Zaretskii [Thu, 10 Feb 2022 17:05:41 +0000 (19:05 +0200)]
; * lisp/startup.el (normal-top-level): Fix byte-compilation warning.
Alan Mackenzie [Thu, 10 Feb 2022 17:03:50 +0000 (17:03 +0000)]
Note current buffer and restore it in c-force-redisplay.
This fixes bug #52709.
* lisp/progmodes/cc-fonts.el (c-force-redisplay): New parameter BUFFER. Set
current buffer to this before fontifying.
(c-fontify-new-found-type): Give the current buffer as argument to
run-with-timer.
Lars Ingebrigtsen [Thu, 10 Feb 2022 14:13:21 +0000 (15:13 +0100)]
Restore command-line--load-script messaging
* lisp/startup.el (command-line--load-script): Restore previous
non-messaging behaviour.
Andrea Corallo [Thu, 10 Feb 2022 08:46:31 +0000 (09:46 +0100)]
* lisp/startup.el (normal-top-level): Disable native-comp if not available
Michael Albinus [Thu, 10 Feb 2022 13:14:06 +0000 (14:14 +0100)]
Improve handling of file modes in Tramp
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-get-remote-uid)
(tramp-gvfs-handle-get-remote-gid): Do not assume that the default
location is owned be the remote uid/gid.
(tramp-gvfs-handle-file-executable-p):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-executable-p):
Check also for setuid/setgid bit.
* lisp/net/tramp.el (tramp-check-cached-permissions): Check also
for ?s access type. Check whether remote uid/gid are unknown.
Lars Ingebrigtsen [Thu, 10 Feb 2022 12:44:55 +0000 (13:44 +0100)]
Don't signal a backtrace on empty --script files
* lisp/startup.el (command-line--load-script): New function that
avoids erroring out if it turns out there's no forms in the buffer
(bug#4616).
* lisp/subr.el (delete-line): New utility function.
* lisp/international/mule.el (load-with-code-conversion): Accept
an eval function.
Po Lu [Thu, 10 Feb 2022 12:00:47 +0000 (20:00 +0800)]
Enable TrueColor allocation optimizations on all visuals
* src/xterm.c (x_alloc_nearest_color): Enable optimizations on
32-bit TrueColor visuals that legitimately don't have an alpha
mask.
Po Lu [Thu, 10 Feb 2022 11:56:30 +0000 (19:56 +0800)]
Correctly premultiply background color of fringe bitmaps
* src/xterm.c (x_draw_fringe_bitmap): Premultiply alphas by
alpha_background.
Po Lu [Thu, 10 Feb 2022 10:43:08 +0000 (18:43 +0800)]
Correctly allocate colors in xftfont
* src/xftfont.c (struct xftface_info): New fields
`bg_allocated_p' and `fg_allocated_p'.
(xftfont_get_colors): Actually allocate colors and tell the
caller whether colors were allocated.
(xftfont_prepare_face): Set allocated fields.
(xftfont_done_face):
(xftfont_draw): Free colors that were allocated.
Dima Kogan [Thu, 10 Feb 2022 07:01:24 +0000 (08:01 +0100)]
Make comint-word actually check comint-file-name-quote-list
* lisp/comint.el (comint-word): We were checking for
comint-file-name-quote-list existing, but not actually comparing
to the characters in that list. This patch actually checks the
contents of comint-file-name-quote-list (bug#53911).
Eli Zaretskii [Thu, 10 Feb 2022 08:34:29 +0000 (10:34 +0200)]
Allow customization of the user's eln-cache directory
* lisp/startup.el (startup-redirect-eln-cache)
(startup--update-eln-cache): New functions.
(startup--original-eln-load-path): New defvar.
(normal-top-level): Record the original value of
'native-comp-eln-load-path' in 'startup--original-eln-load-path'.
Do not amend 'native-comp-eln-load-path' here, as that could
overwrite user customizations.
(command-line): Amend 'native-comp-eln-load-path' after loading
the early-init file, and then again after loading the user init
file. (Bug#53891)
* etc/NEWS: Announce 'startup-redirect-eln-cache'.
Stefan Kangas [Thu, 10 Feb 2022 05:56:22 +0000 (06:56 +0100)]
Merge from origin/emacs-28
69e82968d7 Fix integer arithmetic miss-compilation (bug#53451)
31af9bca99 Mark flymake as compatible with emacs-26.1
Po Lu [Thu, 10 Feb 2022 05:36:24 +0000 (13:36 +0800)]
Fix disconnect errors on some X servers
* src/xfns.c (x_make_gc): Don't set FillOpaqueStippled on cursor
GC. The reason is that some X servers break on such a fill
style if the operation being performed is not a stiple
operation.
Po Lu [Thu, 10 Feb 2022 04:57:47 +0000 (12:57 +0800)]
Fill in missing pixel after PolyLine on scroll bars
* src/xterm.c (x_scroll_bar_expose): Draw bottom right corner of
scroll bar manually.
Po Lu [Thu, 10 Feb 2022 03:25:19 +0000 (03:25 +0000)]
* src/haikugui.h [_cplusplus]: Remove extern "C" declarations.
These were left over from an old implementation strategy
abandoned long before the port was installed.
Po Lu [Thu, 10 Feb 2022 02:21:15 +0000 (10:21 +0800)]
Improve reliability of hotplugging window managers
* src/xterm.c (x_make_frame_visible): Change the user time
window if the window manager supports something different from
what it did the first time the frame was made visible.
Po Lu [Thu, 10 Feb 2022 02:11:19 +0000 (10:11 +0800)]
Ignore tooltip frames when setting PGTK scrollbar foreground
* src/pgtkfns.c (pgtk_set_scroll_bar_foreground): Ignore tip
frames. (bug#53900)
Po Lu [Thu, 10 Feb 2022 02:01:06 +0000 (10:01 +0800)]
; * src/xterm.c (handle_one_event): Fix build error.
Tassilo Horn [Wed, 9 Feb 2022 19:48:02 +0000 (20:48 +0100)]
; show-paren: improve previous commit
bb69361cbe
Update show-paren--last-pos also in the "not at paren position" case.
Otherwise, we don't get the context info when moving point from a
paren position to a non-paren position and back again.
Eli Zaretskii [Wed, 9 Feb 2022 17:31:45 +0000 (19:31 +0200)]
; * src/xterm.c (x_display_set_last_user_time): Fix compilation error.
Andrea Corallo [Wed, 9 Feb 2022 16:38:10 +0000 (17:38 +0100)]
Fix integer arithmetic miss-compilation (bug#53451)
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-range-for-arithm):
When one of the two sources is negated revert to set dst as
number.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add test to
verify this is effective.
Michael Albinus [Wed, 9 Feb 2022 16:02:29 +0000 (17:02 +0100)]
Tilde expansion is not possible for Tramp sshfs method
* lisp/net/tramp.el (tramp-handle-expand-file-name):
Tilde expansion is not possible. (Bug#53847)
Tassilo Horn [Wed, 9 Feb 2022 14:14:18 +0000 (15:14 +0100)]
show-paren: Don't show context again after C-g-ing it away.
* lisp/paren.el (show-paren--last-pos): New variable.
(show-paren-function): Don't show context again after C-g-ing it away.
Po Lu [Wed, 9 Feb 2022 11:05:54 +0000 (19:05 +0800)]
Get rid of `register' declarations in X11 related files
* src/xfns.c (XScreenNumberOfScreen): Rewrite K&R declaration.
* src/xterm.c (x_set_offset): Remove `register' from `xoff' and
`yoff'.
Po Lu [Wed, 9 Feb 2022 10:51:51 +0000 (18:51 +0800)]
Fix compiler warning on GTK
* src/xterm.c (x_make_frame_visible): Make some fields that are
set but never used conditioned out on GTK.
Po Lu [Wed, 9 Feb 2022 10:47:07 +0000 (18:47 +0800)]
Add support for _NET_WM_USER_TIME_WINDOW
* src/xterm.c (x_make_frame_visible):
(x_display_set_last_user_time): Use and set user time window if
the WM supports it.
(x_term_init): Intern new atom.
* src/xterm.h (struct x_display_info): New atom
`_NET_WM_USER_TIME_WINDOW'.
(struct x_output): New field `user_time_window'.
Antoine Levitt [Wed, 9 Feb 2022 09:53:19 +0000 (10:53 +0100)]
Improve the set-fill-column prompt
* lisp/simple.el (set-fill-column): Improve the prompt (bug#53874).
Lars Ingebrigtsen [Wed, 9 Feb 2022 08:32:24 +0000 (09:32 +0100)]
Make calendar-exit actually respect the KILL parameter
* lisp/calendar/calendar.el (calendar-exit): Really kill off all
the buffers (if requested) (bug#53870).
Po Lu [Wed, 9 Feb 2022 08:07:59 +0000 (16:07 +0800)]
Implement _NET_WM_USER_TIME protocol
* src/xterm.c (x_display_set_last_user_time): Set user time on
the active window.
(handle_one_xevent): Only set user time when the user actually
interacted with Emacs.
(x_make_frame_visible): Set user time if non-zero.
(x_term_init): Intern `_NET_WM_USER_TIME'.
* src/xterm.h (struct x_display_info): New field
`Xatom_net_wm_user_time'.
(x_display_set_last_user_time): Implement in xterm.c instead.