Improvement for long lines in buffers with font locking.
* src/xdisp.c (get_narrowed_width): Factored out from 'get_narrowed_len'.
(get_narrowed_len): Updated to use 'get_narrowed_width'.
(get_closer_narrowed_begv): New function.
(SET_WITH_NARROWED_BEGV): Add parameter to the macro.
(back_to_previous_line_start): Use the new function.
(get_visually_first_element, move_it_vertically_backward): Update the
calls to the macro.
* src/dispextern.h: Prototype of 'get_closer_narrowed_begv'.
Fix the prototypes of 'get_narrowed_begv' and 'get_narrowed_zv'.
Eli Zaretskii [Sat, 23 Jul 2022 14:43:40 +0000 (17:43 +0300)]
Avoid calling 'current_column' in buffers with long lines.
* src/xdisp.c (decode_mode_spec, redisplay_window)
(mode_line_update_needed):
* src/indent.c (Fcurrent_column): In a buffer with long-line
optimizations enabled, avoid calling 'current_column', which is
very slow in that case.
Eli Zaretskii [Sat, 23 Jul 2022 13:13:32 +0000 (16:13 +0300)]
Speed up redisplay of long truncated lines
* src/xdisp.c (forward_to_next_line_start): Fix logic of
interpreting the result of Fnext_single_property_change.
(reseat_at_next_visible_line_start): When ON_NEWLINE_P is zero,
pass NULL to 'forward_to_next_line_start', to avoid costly bidi
iteration when none is needed. This speeds up redisplay of very
long lines under 'truncate-lines'.
Improve font locking in buffers with long lines (bug#56682).
* src/dispextern.h (struct it): New 'narrowed_zv' field.
* src/xdisp.c (init_iterator): Set the field.
(get_narrowed_zv): New function to set the field.
(handle_fontified_prop): Use the field, together with 'narrowed_begv',
to narrow the portion of the buffer that 'Vfontification_functions'
will see. Also bind 'inhibit-widen'.
(get_narrowed_len): New function, factored out of 'get_narrowed_begv'.
(unwind_narrowed_zv): New function.
* src/editfns.c (syms_of_editfns): New variable and symbol 'inhibit-widen'.
(Fwiden): Do nothing when 'inhibit-widen' is non-nil.
* src/xdisp.c (redisplay_window): Increase the threshold above which
long lines detection is performed in the buffer. This should avoid
triggering that detection for most simple editing operations.
* src/lisp.h (modiff_incr): Explain why the counter is incremented
logarithmically.
* src/buffer.h (struct buffer_text): Adapt the comment about the
'modiff' field accordingly.
* src/buffer.c (modify_overlay): Increase the counter by 1 instead of
the size of the buffer section on which the overlay is placed.
* lisp/subr.el (lsh): Note the general preference for `ash`.
* lisp/emacs-lisp/shortdoc.el (number): Remove entry for `lsh`.
It was identical to that for `ash` which is misleading.
Shortdoc is very helpful for finding the right function to use,
and `lsh` is just for compatibility at this point.
Po Lu [Wed, 20 Jul 2022 11:05:58 +0000 (19:05 +0800)]
Fix calculation of default highlightForeground in the lucid menu bar
* lwlib/xlwmenu.c (xlwMenuResources, display_menu_item)
(make_drawing_gcs, make_shadow_gcs, openXftFont, XlwMenuRealize)
(XlwMenuSetValues): Use -1 as the default for
highlight_foreground. Replace that with the normal foreground
when creating GCs. Reported by Colin Baxter
<m43cap@yandex.com>.
Po Lu [Wed, 20 Jul 2022 07:37:24 +0000 (07:37 +0000)]
Implement wheel movement during DND on Haiku
* lisp/term/haiku-win.el (haiku-dnd-wheel-count): New defvar.
(haiku-note-wheel-click, haiku-handle-drag-wheel): New
functions.
* src/haiku_support.cc (EmacsWindow): Get rid of window ID
logic.
(MessageReceived, MouseMoved, be_drag_message): Use thread ID to
identify windows instead of window ID.
* src/haikuselect.c (Fhaiku_drag_message): Record whether or not
the DND frame is a valid drop target.
(haiku_note_drag_wheel): New function.
(syms_of_haikuselect): New defvar.
João Távora [Tue, 19 Jul 2022 23:35:08 +0000 (00:35 +0100)]
Make eldoc-echo-area-prefer-doc-buffer consider all frames
Previously, it considered only windows on 'visible' frames (according
to get-buffer-window). This seemed correct at first, but it's not
much use for multiple TTY frames and not particularly reliable on GUI
frames either. There's no reliable way to tell what is actually
visible, so it's best to assume that users setup frames that are
indeed visible when using this parameter.
* lisp/emacs-lisp/eldoc.el (eldoc--echo-area-prefer-doc-buffer-p):
Consider all frames.
Simplified and improved heuristic for long lines detection.
* src/lisp.h (modiff_incr): Add a parameter to 'modiff_incr' to record
the extent of the modification.
* src/insdel.c (insert_1_both, insert_from_string_1, insert_from_gap,
insert_from_buffer_1, adjust_after_replace, replace_range,
replace_range_2, del_range_2, modify_text): Add an argument to each
call to 'modiff_incr'.
* src/textprop.c (modify_text_properties): Add an argument to the call
to 'modiff_incr'.
* src/buffer.c (Frestore_buffer_modified_p, Fbuffer_swap_text,
modify_overlay): Add an argument to each call to 'modiff_incr'.
* src/xdisp.c (redisplay_window): Use the improved version of 'MODIFF'
for the heuristic.
Stefan Monnier [Mon, 18 Jul 2022 21:39:55 +0000 (17:39 -0400)]
(help-fns--first-release): Try and avoid false positives
We used to use a very "optimistic" regexp which worked well for
longish symbol names but suffered from too many false positives on
short names. Use a more restrictive regexp, which should make the
recent "weed out" change unnecessary.
This in turn requires the use of '...' more consistently in etc/NEWS* files.
* lisp/help-fns.el (help-fns--first-release-regexp): New function.
(help-fns--first-release): Use it. Fix minor issue with the Emacs
version regexp.
(help-fns--mention-first-release): Undo last change.
* etc/NEWS*: Replace `...' with '...'. Indent code examples by at
least 2 spaces. Add previously missing '...' quotes around many of
the variables and functions described.
Po Lu [Tue, 19 Jul 2022 01:33:09 +0000 (09:33 +0800)]
Make drag-and-drop wheel movement work locally too on X
This is provided by the XDND protocol, so it isn't fair for it
to not work with local drag-and-drop.
* lisp/x-dnd.el (x-dnd-note-wheel-movement): New function. Set
it as the `x-dnd-wheel-function'.
* src/xterm.c (x_dnd_cleanup_drag_and_drop): Clear new flags.
(x_dnd_note_self_wheel): New function. Set some flags.
(x_dnd_process_quit, x_dnd_begin_drag_and_drop, handle_one_xevent)
(x_connection_closed, x_delete_terminal, mark_xterm): Handle and
set new wheel movement flags
(syms_of_xterm): New variable `x-dnd-wheel-function'.
Alexander Adolf [Wed, 13 Jul 2022 21:52:46 +0000 (23:52 +0200)]
Additional query and results attributes in eudcb-macos-contacts.el
* lisp/net/eudcb-macos-contacts.el: wider set of attributes for
queries, and in query results
* lisp/net/eudc-vars.el (eudc-inline-expansion-format): update
docstring to explain how to use the function eudc-translate-query to
translate to generic attribute names in the user supplied formatting
function
* etc/NEWS: announce wider query/result attribute set
* doc/misc/eudc.texi: more details on eudcb-mab.el's limitations
Michael Albinus [Mon, 18 Jul 2022 13:48:14 +0000 (15:48 +0200)]
Adapt Tramp new test macros
* test/lisp/net/tramp-tests.el (tramp--test-deftest-with-stat)
(tramp--test-deftest-with-perl, tramp--test-deftest-with-ls):
Skip for all methods but those from tramp-sh.el.
* lisp/emacs-lisp/seq.el (seq-subseq):
Make faster by using `take` instead of a lisp loop,
and more importantly by not front-loading the error text formatting.
* test/lisp/emacs-lisp/seq-tests.el (seq-tests--list-subseq-ref)
(test-seq-subseq): Test `seq-subseq` for lists more thoroughly.
Richard Hansen [Sun, 17 Jul 2022 04:56:10 +0000 (00:56 -0400)]
Derive `Info-mode' from `special-mode'
* lisp/info.el (Info-mode): Derive `Info-mode' from `special-mode'.
This makes it easier to exclude it from globalized minor modes that
don't apply to special modes (such as `global-whitespace-mode' and
`global-display-fill-column-indicator-mode').
Richard Hansen [Sun, 17 Jul 2022 18:32:42 +0000 (14:32 -0400)]
info-edit: Delay `ibuffer' var change until after `ibuffer' loads
* lisp/obsolete/info-edit.el: Delay the addition of `Info-edit-mode'
to the `ibuffer-help-buffer-modes' list until after `ibuffer' is
loaded. This fixes a "(void-variable ibuffer-help-buffer-modes)"
error when `info-edit' is loaded before `ibuffer'.
Eli Zaretskii [Sun, 17 Jul 2022 12:44:50 +0000 (15:44 +0300)]
Fix leaking of file descriptors due to pipe processes on MS-Windows
* src/w32proc.c (reader_thread): Wait for 'sys_close' to finish
processing the pipe read descriptor, before trying to close it.
* src/w32.c (sys_close): Attempt to detect when the reader thread
already exited, so that it would be possible to close descriptors
open by pipe processes for reading from the pipe. (Bug#56606)
Eli Zaretskii [Sun, 17 Jul 2022 09:33:34 +0000 (12:33 +0300)]
Fix tab-bar resizing under 'auto-resize-tab-bars' = 'grow-only'
* src/xdisp.c (redisplay_tab_bar): Compute the desired height of
the tab-bar before iterating over the tab-bar string, to detect
the required resizing earlier. Default 'change_p' to 'false'.
* lisp/tab-bar.el (tab-bar--update-tab-bar-lines): Support
'auto-resize-tab-bars' set to 'grow-only'.
Improve error messaging when parent archive buffers are missing
* lisp/arc-mode.el (archive-write-file-member):
* lisp/tar-mode.el (tar-subfile-save-buffer): Give a better error
message when the parent buffer is dead (bug#56605).