]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoCount bytes, not records, in specpdl_ref
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.

3 years agoTurn specpdl_ref into a type of its own
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.

3 years agoReplace ptrdiff_t with new specpdl_ref type for specpdl references
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.

3 years agoFix entry and exit events with XI2 grabs on X toolkit menus
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.

3 years agoClean up mode-line-* faces handling
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.

3 years agoAdd documentation on how to delete files from Trash
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).

3 years agoImprove interaction between track-mouse and edebug
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).

3 years agoFix off-by-one file size formatting in ls-lisp
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).

3 years agoCross-link message-expand-name-standard-ui-relevant doc strings
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).

3 years agoImplement visual bell on Haiku like on X
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.

3 years agoFix compatibility with ancient versions of libXi
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.

3 years agoBe less strict about which PointerEmulated button events to ignore
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.

3 years agoNever set opaque region without an alpha channel
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.

3 years agoModernise byte-compilation chapters in manual
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.

3 years ago; * config.bat: Fix typo.
Po Lu [Fri, 11 Feb 2022 12:26:04 +0000 (20:26 +0800)]
; * config.bat: Fix typo.

3 years agoMerge remote-tracking branch 'origin/master'
Po Lu [Fri, 11 Feb 2022 12:20:50 +0000 (20:20 +0800)]
Merge remote-tracking branch 'origin/master'

3 years agoFix the DJGPP port
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.

3 years agoTolerate tilde in remote file names when needed
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'.

3 years ago; * etc/DEVEL.HUMOR: Add a recent joke.
Eli Zaretskii [Fri, 11 Feb 2022 08:15:20 +0000 (10:15 +0200)]
; * etc/DEVEL.HUMOR: Add a recent joke.

3 years agoAllow searching of nnselect (search) groups
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.

3 years ago* etc/PROBLEMS: Document some limitations of Xwayland and PGTK.
Po Lu [Fri, 11 Feb 2022 06:46:25 +0000 (14:46 +0800)]
* etc/PROBLEMS: Document some limitations of Xwayland and PGTK.

3 years agoDon't make cursors affected by background alpha on 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.

3 years agoSet _NET_WM_OPAQUE_REGION on non-GTK3 toolkits when using 32 bit visual
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.

3 years agoFix fallout from switch to 32-bit visuals
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.

3 years agoImprove reliability of selection ownership on Haiku
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.

3 years agoDisable nearest-color allocation on DirectColor visuals
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.

3 years agoSilence macOS vfork deprecation warnings
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.

3 years ago* lisp/mouse.el (context-menu-map): Select only unselected window (bug#53910)
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)

3 years ago* lisp/tab-line.el (tab-line-format): Use mode-line-window-selected-p.
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).

3 years agoAutoload package-installed-p
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

3 years agoMerge from origin/emacs-28
Eli Zaretskii [Thu, 10 Feb 2022 17:12:19 +0000 (19:12 +0200)]
Merge from origin/emacs-28

# Conflicts:
# lisp/startup.el

3 years ago; * lisp/startup.el (normal-top-level): Fix byte-compilation warning.
Eli Zaretskii [Thu, 10 Feb 2022 17:05:41 +0000 (19:05 +0200)]
; * lisp/startup.el (normal-top-level): Fix byte-compilation warning.

3 years agoNote current buffer and restore it in c-force-redisplay.
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.

3 years agoRestore command-line--load-script messaging
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.

3 years ago* lisp/startup.el (normal-top-level): Disable native-comp if not available
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

3 years agoImprove handling of file modes in Tramp
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.

3 years agoDon't signal a backtrace on empty --script files
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.

3 years agoEnable TrueColor allocation optimizations on all visuals
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.

3 years agoCorrectly premultiply background color of fringe bitmaps
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.

3 years agoCorrectly allocate colors in xftfont
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.

3 years agoMake comint-word actually check comint-file-name-quote-list
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).

3 years agoAllow customization of the user's eln-cache directory
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'.

3 years agoMerge from origin/emacs-28
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

3 years agoFix disconnect errors on some X servers
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.

3 years agoFill in missing pixel after PolyLine on scroll bars
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.

3 years ago* src/haikugui.h [_cplusplus]: Remove extern "C" declarations.
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.

3 years agoImprove reliability of hotplugging window managers
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.

3 years agoIgnore tooltip frames when setting PGTK scrollbar foreground
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)

3 years ago; * src/xterm.c (handle_one_event): Fix build error.
Po Lu [Thu, 10 Feb 2022 02:01:06 +0000 (10:01 +0800)]
; * src/xterm.c (handle_one_event): Fix build error.

3 years ago; show-paren: improve previous commit bb69361cbe
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.

3 years ago; * src/xterm.c (x_display_set_last_user_time): Fix compilation error.
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.

3 years agoFix integer arithmetic miss-compilation (bug#53451)
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.

3 years agoTilde expansion is not possible for Tramp sshfs method
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)

3 years agoshow-paren: Don't show context again after C-g-ing it away.
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.

3 years agoGet rid of `register' declarations in X11 related files
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'.

3 years agoFix compiler warning on GTK
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.

3 years agoAdd support for _NET_WM_USER_TIME_WINDOW
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'.

3 years agoImprove the set-fill-column prompt
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).

3 years agoMake calendar-exit actually respect the KILL parameter
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).

3 years agoImplement _NET_WM_USER_TIME protocol
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.

3 years agoExplictly specify whether or not to respect alpha-background on Cairo
Po Lu [Wed, 9 Feb 2022 07:01:36 +0000 (15:01 +0800)]
Explictly specify whether or not to respect alpha-background on Cairo

* src/ftcrfont.c (ftcrfont_draw): Don't respect
`alpha-background' if drawing cursor.  (bug#53890)
* src/xterm.c (x_set_cr_source_with_gc_foreground):
(x_set_cr_source_with_gc_background): New parameters
`respect_alpha_background'.  All callers changed.
* src/xterm.h: Update protoypes.

3 years agoMention `overlay' show-paren-context-when-offscreen value in NEWS
Tassilo Horn [Wed, 9 Feb 2022 05:54:11 +0000 (06:54 +0100)]
Mention `overlay' show-paren-context-when-offscreen value in NEWS

* etc/NEWS: Mention `overlay' value of
show-paren-context-when-offscreen.

3 years agoMerge from origin/emacs-28
Stefan Kangas [Wed, 9 Feb 2022 05:30:54 +0000 (06:30 +0100)]
Merge from origin/emacs-28

82e74e4559 flymake: Ensure compatibility with older Emacsen

3 years agoMake haikufont_list_family actually work
Po Lu [Wed, 9 Feb 2022 05:09:24 +0000 (05:09 +0000)]
Make haikufont_list_family actually work

* haikufont.c (haikufont_list_family): Intern returned font
families.

3 years agoImplement `list_family' for the haikufont driver
Po Lu [Wed, 9 Feb 2022 03:53:13 +0000 (03:53 +0000)]
Implement `list_family' for the haikufont driver

* src/haiku_font_support.cc (be_list_font_families): New
function.
* src/haiku_support.h: Update prototypes.
* src/haikufont.c (haikufont_list_family): New function.
(haikufont_driver): Add `haikufont_list_family'.

3 years agoImprove selection of fonts available from `mouse-set-font'
Po Lu [Wed, 9 Feb 2022 03:26:47 +0000 (11:26 +0800)]
Improve selection of fonts available from `mouse-set-font'

People get confused on a build without font dialogs (such as a
Lucid build) if `menu-set-font' and `mouse-set-font' don't
present them a list of the fonts actually available on their
system.

* lisp/mouse.el (mouse-generate-font-name-for-menu)
(mouse-generate-font-menu): New functions.
(mouse-select-font): Allow the user to select from all fonts
available on the system.
(mouse-set-font): Use `mouse-select-font' to display font menu.

3 years agoMake sure the cursor can't move on top of a tooltip on Haiku
Po Lu [Wed, 9 Feb 2022 02:10:36 +0000 (02:10 +0000)]
Make sure the cursor can't move on top of a tooltip on Haiku

* src/haikuterm.c (haiku_read_socket): Work around leave
notification events not being sent on tooltip frames.

3 years agoFix creation of tooltip frames with a stippled background
Po Lu [Wed, 9 Feb 2022 01:10:50 +0000 (09:10 +0800)]
Fix creation of tooltip frames with a stippled background

* src/xfns.c (x_create_tip_frame): Init faces after creating the
drawable, since that's needed for loading stipple files.

3 years agoAllow showing show-paren context in an overlay
Tassilo Horn [Tue, 8 Feb 2022 20:54:56 +0000 (21:54 +0100)]
Allow showing show-paren context in an overlay

* lisp/paren.el (show-paren-context-when-offscreen): Add new
possibility `overlay'.
(show-paren--context-overlay): New defvar.
(show-paren--delete-context-overlay): New function.
(show-paren--show-context-in-overlay): New function.
(show-paren-function): Handle the new `overlay' case.
* lisp/emacs-lisp/eldoc.el (eldoc-display-message-no-interference-p):
There's no interference if `show-paren-context-when-offscreen' is
overlay or child-frame.

3 years ago* lisp/replace.el (perform-replace): Allow using isearch in recursive-edit.
Juri Linkov [Tue, 8 Feb 2022 19:35:12 +0000 (21:35 +0200)]
* lisp/replace.el (perform-replace): Allow using isearch in recursive-edit.

Let-bind isearch-filter-predicate to the default value before calling
recursive-edit to allow using isearch in a recursive edit (bug#53758).

3 years ago; * etc/PROBLEMS: Fix typos and improve wording.
Eli Zaretskii [Tue, 8 Feb 2022 16:53:40 +0000 (18:53 +0200)]
; * etc/PROBLEMS: Fix typos and improve wording.

3 years agoImprove make-frame-on-display initial values
Robert Pluim [Tue, 1 Feb 2022 11:01:14 +0000 (12:01 +0100)]
Improve make-frame-on-display initial values

* doc/emacs/frames.texi (Multiple Displays): Add index entry for
'display server'.
* lisp/frame.el (make-frame-on-display): Specify sensible initial
values when reading display name.
* lisp/menu-bar.el (menu-bar-file-menu): Use 'display server' rather
than 'display' to avoid monitor<->display confusion.

3 years agoImprove thing-at-point-url-at-point docstring
Robert Pluim [Tue, 1 Feb 2022 10:59:42 +0000 (11:59 +0100)]
Improve thing-at-point-url-at-point docstring

* lisp/thingatpt.el (thing-at-point-url-at-point): Correct description
of BOUNDS argument.

3 years agoRespect customization nature of `connection-local-*' user options
Michael Albinus [Tue, 8 Feb 2022 15:23:05 +0000 (16:23 +0100)]
Respect customization nature of `connection-local-*' user options

* lisp/files-x.el (connection-local-set-profiles)
(connection-local-set-profile-variables): Set user options via
`customize-set-variable'.

3 years agoMark flymake as compatible with emacs-26.1
Robert Pluim [Tue, 8 Feb 2022 15:04:15 +0000 (16:04 +0100)]
Mark flymake as compatible with emacs-26.1

* lisp/progmodes/flymake.el: Bump package version and set
emacs version in Package-Requires to 26.1 (Bug#53853).

3 years agoFix processes on remote default-directory with special characters
Michael Albinus [Tue, 8 Feb 2022 14:45:09 +0000 (15:45 +0100)]
Fix processes on remote default-directory with special characters

* lisp/net/tramp.el (tramp-handle-make-process): Quote `localname'.

* test/lisp/net/tramp-tests.el (tramp--test-check-files):
Test also remote `default-directory' for processes.  (Bug#53846)

3 years ago* src/pgtkterm.c (map_event): Fix last change.
Po Lu [Tue, 8 Feb 2022 13:36:51 +0000 (21:36 +0800)]
* src/pgtkterm.c (map_event): Fix last change.

3 years agoDocument some problems found during testing on various X servers
Po Lu [Tue, 8 Feb 2022 13:32:07 +0000 (21:32 +0800)]
Document some problems found during testing on various X servers

* etc/PROBLEMS (General X problems): Document some problems
found during testing on various X servers.

3 years agoImprove robustness of override-redirect on Haiku
Po Lu [Tue, 8 Feb 2022 12:20:47 +0000 (12:20 +0000)]
Improve robustness of override-redirect on Haiku

* src/haiku_support.cc (class EmacsWindow): New field
`override_redirect_p'.
(BWindow_change_decoration, BWindow_set_override_redirect): Set
and restore from the saved pre-override redirect state fields if
appropriate.

3 years agoFix frame offset reporting on PGTK
Po Lu [Tue, 8 Feb 2022 11:57:01 +0000 (19:57 +0800)]
Fix frame offset reporting on PGTK

* src/pgtkterm.c (configure_event): Handle changes in window
position.  (bug#52697)

3 years agoImplement frame resize synchronization on GTK 3
Po Lu [Tue, 8 Feb 2022 11:14:52 +0000 (19:14 +0800)]
Implement frame resize synchronization on GTK 3

* src/xterm.c (XTframe_up_to_date):
(handle_one_xevent): Use the GTK frame clock to implement frame
resize synchronization.

* src/xterm.h (struct x_output): New variable
`xg_sync_end_pending_p'.

3 years agoExtend find-lisp-object-file-name
Lars Ingebrigtsen [Tue, 8 Feb 2022 10:10:03 +0000 (11:10 +0100)]
Extend find-lisp-object-file-name

* lisp/help-fns.el (find-lisp-object-file-name): Add optional
parameter to always look in the DOC file (bug#17685).

3 years agoDocument pcase-lambda
Lars Ingebrigtsen [Tue, 8 Feb 2022 07:51:30 +0000 (08:51 +0100)]
Document pcase-lambda

* doc/lispref/control.texi (Destructuring with pcase Patterns):
Document pcase-lambda (bug#20268).

3 years agoFix some standard-output/help-buffer confusion in describe-function-1
Lars Ingebrigtsen [Tue, 8 Feb 2022 07:24:30 +0000 (08:24 +0100)]
Fix some standard-output/help-buffer confusion in describe-function-1

* lisp/help-fns.el (describe-function-1): We're outputting to
standard-output, so deconfuse slightly.

3 years agoFix describe-function-1 test failure from previous change
Lars Ingebrigtsen [Tue, 8 Feb 2022 07:15:08 +0000 (08:15 +0100)]
Fix describe-function-1 test failure from previous change

* lisp/help-fns.el (describe-function-1): Fix test failure from
previous patch.

3 years agoMinor fix to how describe-function-1 displays symbols with spaces
Lars Ingebrigtsen [Tue, 8 Feb 2022 07:02:52 +0000 (08:02 +0100)]
Minor fix to how describe-function-1 displays symbols with spaces

* lisp/help-fns.el (describe-function-1): Ensure that symbols like
`bar\ ' aren't rendered incorrectly (bug#23130).

3 years agoImprove handling of frame-inherited-parameters
martin rudalics [Tue, 8 Feb 2022 06:38:25 +0000 (07:38 +0100)]
Improve handling of frame-inherited-parameters

* lisp/frame.el (make-frame): Improve handling of
frame-inherited-parameters (bug#24651).

3 years agoMake exit from text-scale-adjust less confusing
Lars Ingebrigtsen [Tue, 8 Feb 2022 06:33:24 +0000 (07:33 +0100)]
Make exit from text-scale-adjust less confusing

* lisp/face-remap.el (text-scale-adjust): Clear the prompt after
exiting (bug#25978).

3 years agoClear mouse highlight when mouse moves outside edit widget
Po Lu [Tue, 8 Feb 2022 06:17:23 +0000 (14:17 +0800)]
Clear mouse highlight when mouse moves outside edit widget

* src/xterm.c (handle_one_xevent): Clear mouse highlight when
leaving the edit widget.  Otherwise, it stays around on the
toolbar after the mouse is moved onto the menu bar.

3 years agoflymake: Ensure compatibility with older Emacsen
Brian Leung [Tue, 8 Feb 2022 06:16:25 +0000 (07:16 +0100)]
flymake: Ensure compatibility with older Emacsen

* lisp/progmodes/flymake.el (flymake--log-1): Use
replace-regexp-in-string instead of Emacs 28's
string-replace (bug#53853).

3 years agonnselect.el: Speed up group info updating
Andrew G Cohen [Tue, 8 Feb 2022 06:05:02 +0000 (14:05 +0800)]
nnselect.el: Speed up group info updating

* lisp/gnus/nnselect.el (nnselect-request-update-info): Use a hash and
other tricks to speed things up.
(nnselect-request-group-scan): Make sure the artlist is uncompressed.

3 years ago; Merge from origin/emacs-28
Stefan Kangas [Tue, 8 Feb 2022 05:30:53 +0000 (06:30 +0100)]
; Merge from origin/emacs-28

The following commit was skipped:

0d46ee2dde Don't remove dummy.group from gnus-newsrc-alist on Gnus save

3 years agoTry harder to preserve cursor when mapping tooltip frames on Haiku
Po Lu [Tue, 8 Feb 2022 05:14:16 +0000 (05:14 +0000)]
Try harder to preserve cursor when mapping tooltip frames on Haiku

* src/haikufns.c (haiku_set_cursor_color): Fix argument to
`error'.
(Fx_show_tip): Define cursors on both views.

3 years agoFix menu bar not opening after popup menu is dismissed on Lucid
Po Lu [Tue, 8 Feb 2022 02:37:24 +0000 (10:37 +0800)]
Fix menu bar not opening after popup menu is dismissed on Lucid

* lwlib/xlwmenu.c (XlwMenuDestroy): Only set submenu_destroyed
if menu bar widget.

3 years ago* src/pgtkfns.c (Fx_create_frame): Realize frame widgets. (bug#53861)
Po Lu [Tue, 8 Feb 2022 01:38:33 +0000 (09:38 +0800)]
* src/pgtkfns.c (Fx_create_frame): Realize frame widgets. (bug#53861)

3 years agoDon't allow tooltips to be transient for override redirect windows
Po Lu [Tue, 8 Feb 2022 01:25:24 +0000 (09:25 +0800)]
Don't allow tooltips to be transient for override redirect windows

* src/xfns.c (Fx_show_tip): Delete WM_TRANSIENT_FOR if the child
window is override-redirect.

* src/xterm.c (x_term_init): Intern new atom.
* src/xterm.h (struct x_display_info): New atom
`Xatom_wm_transient_for'.

3 years agoMake sure `update_wm_hints' finds the WMShell
Po Lu [Tue, 8 Feb 2022 00:46:31 +0000 (08:46 +0800)]
Make sure `update_wm_hints' finds the WMShell

* src/widget.c (update_wm_hints): Accept frame separately from
the shell widget.
(widget_update_wm_size_hints): Require WM shell to be explictly
specified.
(EmacsFrameRealize):
(EmacsFrameResize): Update callers to `update_wm_hints'.
* src/widget.h: Update prototypes.
* src/xterm.c (x_wm_set_size_hint): Pass frame widget
(ApplicationShell) and the edit widget (EmacsFrame) to
`widget_update_wm_size_hints'.  (bug#53839)

3 years agominibuffer.el: Try and fix bug#53053
Stefan Monnier [Mon, 7 Feb 2022 21:51:18 +0000 (16:51 -0500)]
minibuffer.el: Try and fix bug#53053

* lisp/minibuffer.el (completion--sifn-requote): Special case for when
`upos` is at the very end.

3 years ago; paren.el: fix comment speaking of an undefined variable
Tassilo Horn [Mon, 7 Feb 2022 20:03:53 +0000 (21:03 +0100)]
; paren.el: fix comment speaking of an undefined variable

3 years ago* lisp/progmodes/xref.el (xref--marker-ring): Fix typo
Stefan Monnier [Mon, 7 Feb 2022 18:37:09 +0000 (13:37 -0500)]
* lisp/progmodes/xref.el (xref--marker-ring): Fix typo