]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoFinal documentation tweaks.
Gregory Heytings [Thu, 28 Jul 2022 21:12:05 +0000 (21:12 +0000)]
Final documentation tweaks.

* etc/NEWS: Update the NEWS entry.

* src/xdisp.c (syms_of_xdisp): Mention the fact that restrictions
may be locked around 'fontification-functions'.

2 years agoAdd an optional 'lock' parameter to 'narrow-to-region'
Gregory Heytings [Thu, 28 Jul 2022 20:37:49 +0000 (20:37 +0000)]
Add an optional 'lock' parameter to 'narrow-to-region'

* src/editfns.c (Fnarrow_to_region): Add the parameter to the
function, and handle it. Update docstring.
(unwind_locked_begv, unwind_locked_zv): New functions.
(Fwiden): Do nothing when restrictions are locked. Update
docstring.
(syms_of_editfns): Replace the 'inhibit-widen' symbol and variable
with a 'restrictions-locked' symbol and variable. Update docstring.

* src/xdisp.c (handle_fontified_prop): Use Fnarrow_to_region with
the new parameter.
(unwind_narrowed_zv): Remove function.

* src/process.c (Finternal_default_process_filter): Add a third
argument to Fnarrow_to_region.

* src/lread.c (readevalloop): Add a third argument to
Fnarrow_to_region.

* src/bytecode.c (exec_byte_code): Add a third argument to
Fnarrow_to_region.

* etc/NEWS (like): Mention the new parameter of 'narrow-to-region'.

* doc/lispref/positions.texi (Narrowing): Document it.

2 years agoMinor update of truncate-line optimization
Eli Zaretskii [Thu, 28 Jul 2022 08:39:28 +0000 (11:39 +0300)]
Minor update of truncate-line optimization

* src/xdisp.c (forward_to_next_line_start): Look into display and
overlay strings only when lines are truncated on display.

2 years ago; Fix typos in comments and remove debug code.
Eli Zaretskii [Wed, 27 Jul 2022 17:10:46 +0000 (20:10 +0300)]
; Fix typos in comments and remove debug code.

2 years agoSpeed up Isearch in very long lines under line truncation
Eli Zaretskii [Wed, 27 Jul 2022 17:05:44 +0000 (20:05 +0300)]
Speed up Isearch in very long lines under line truncation

* src/xdisp.c (strings_with_newlines): New function.
(forward_to_next_line_start): Call 'strings_with_newlines' in
buffers with very long lines, to avoid falling back on slow
iteration.  (Bug#56682)

2 years agoImprovement for long lines in buffers with font locking.
Gregory Heytings [Mon, 25 Jul 2022 20:27:17 +0000 (20:27 +0000)]
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'.

2 years agoImprove display of columns on mode-line
Eli Zaretskii [Sat, 23 Jul 2022 16:27:30 +0000 (19:27 +0300)]
Improve display of columns on mode-line

* src/xdisp.c (decode_mode_spec): A better representation for
"unknown column number".

2 years agoOptimize 'set_vertical_scroll_bar' for long lines
Eli Zaretskii [Sat, 23 Jul 2022 15:57:06 +0000 (18:57 +0300)]
Optimize 'set_vertical_scroll_bar' for long lines

* src/xdisp.c (set_vertical_scroll_bar): Don't bother
being accurate about window_end_pos if long-line shortcuts
are in effect in the current buffer.

2 years agoAvoid calling 'current_column' in buffers with long lines.
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.

2 years agoSpeed up redisplay of long truncated lines
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'.

2 years agoAvoid assertion violations in 'handle_fontified_prop'
Eli Zaretskii [Fri, 22 Jul 2022 19:22:08 +0000 (22:22 +0300)]
Avoid assertion violations in 'handle_fontified_prop'

* src/xdisp.c (handle_fontified_prop): Avoid assertion violations
due to automatic narrowing.  (Bug#56682)

2 years agoImprove font locking in buffers with long lines (bug#56682).
Gregory Heytings [Fri, 22 Jul 2022 10:03:13 +0000 (10:03 +0000)]
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.

2 years agoMerge branch 'feature/fix-the-long-lines-display-bug'
Gregory Heytings [Thu, 21 Jul 2022 10:37:45 +0000 (12:37 +0200)]
Merge branch 'feature/fix-the-long-lines-display-bug'

2 years agoUpdate buffer's chars-modified tick when inserting from gap
Eli Zaretskii [Thu, 21 Jul 2022 09:40:28 +0000 (12:40 +0300)]
Update buffer's chars-modified tick when inserting from gap

* src/insdel.c (insert_from_gap): Update buffer's chars-modified
tick.  (Bug#56393)

* test/src/buffer-tests.el (test-buffer-chars-modified-ticks): New
test.

2 years agoApply tooltip assertions to all instances of x-show-tip
Po Lu [Thu, 21 Jul 2022 08:26:34 +0000 (16:26 +0800)]
Apply tooltip assertions to all instances of x-show-tip

* src/haikufns.c (Fx_show_tip):
(syms_of_haikufns):
* src/nsfns.m (Fx_show_tip):
(syms_of_nsfns):
* src/pgtkfns.c (Fx_show_tip):
(syms_of_pgtkfns):
* src/xfns.c (Fx_show_tip):
(syms_of_xfns): Add assertion and adjust default values.

2 years agoMinor doc fix in search-forward-help-for-help
Stefan Kangas [Thu, 21 Jul 2022 07:23:27 +0000 (09:23 +0200)]
Minor doc fix in search-forward-help-for-help

* lisp/help.el (search-forward-help-for-help): Use command
substitution.

2 years agoMake bs-help obsolete in favor of describe-mode
Stefan Kangas [Thu, 21 Jul 2022 07:04:12 +0000 (09:04 +0200)]
Make bs-help obsolete in favor of describe-mode

* lisp/bs.el (bs-help): Make obsolete in favor of describe-mode.
Update uses.

2 years agoMake dictionary-help obsolete in favor of describe-mode
Stefan Kangas [Thu, 21 Jul 2022 06:56:59 +0000 (08:56 +0200)]
Make dictionary-help obsolete in favor of describe-mode

* lisp/net/dictionary.el (dictionary-help): Make obsolete in favor
of describe-mode.  Update uses.

2 years agoDon't list obsolete in "other commands" help section
Stefan Kangas [Thu, 21 Jul 2022 06:55:28 +0000 (08:55 +0200)]
Don't list obsolete in "other commands" help section

* lisp/help-fns.el (help-fns--list-local-commands): Don't list
obsolete commands.

2 years agoMake sure we don't unknowingly truncate tooltip text
Eli Zaretskii [Thu, 21 Jul 2022 07:12:03 +0000 (10:12 +0300)]
Make sure we don't unknowingly truncate tooltip text

* src/w32fns.c (Fx_show_tip): Add assertion when the default
tooltip dimension limits are insufficient.  (Bug#56561)

2 years agoAvoid wasting bandwidth to set user time
Po Lu [Thu, 21 Jul 2022 06:55:05 +0000 (14:55 +0800)]
Avoid wasting bandwidth to set user time

* src/xterm.c (x_display_set_last_user_time): Don't change the
user time property if nothing actually changed.

2 years agoMake bubbles-quit obsolete in favor of quit-window
Stefan Kangas [Thu, 21 Jul 2022 06:21:16 +0000 (08:21 +0200)]
Make bubbles-quit obsolete in favor of quit-window

* lisp/play/bubbles.el (bubbles-quit): Make obsolete in favor of
quit-window.  Update uses.

2 years agoRemove superfluous installation instructions
Stefan Kangas [Thu, 21 Jul 2022 06:11:41 +0000 (08:11 +0200)]
Remove superfluous installation instructions

These functions are already autoloaded.
* lisp/mail/mspools.el:
* lisp/progmodes/opascal.el:
* lisp/textmodes/remember.el:
* lisp/woman.el: Remove superfluous installation instructions.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Thu, 21 Jul 2022 04:30:38 +0000 (06:30 +0200)]
Merge from origin/emacs-28

ea44d7ddfc ; * lisp/mail/smtpmail.el (smtpmail-via-smtp): Explain wit...

2 years agoImprove handling screen resizes when built without RandR
Po Lu [Thu, 21 Jul 2022 01:39:24 +0000 (09:39 +0800)]
Improve handling screen resizes when built without RandR

* src/xterm.c (handle_one_xevent): Update DND tooltip position
upon ConfigureNotify for root window.

2 years agoRevert "Prefer defvar-keymap in xwidget.el"
Po Lu [Thu, 21 Jul 2022 01:19:14 +0000 (09:19 +0800)]
Revert "Prefer defvar-keymap in xwidget.el"

This reverts commit daf2c3e23a45bff14f9d444d2d07455376d4b6da.

2 years ago; Normalize some "Author" headers
Stefan Kangas [Wed, 20 Jul 2022 20:34:34 +0000 (22:34 +0200)]
; Normalize some "Author" headers

2 years agoPrefer defvar-keymap in xwidget.el
Stefan Kangas [Wed, 20 Jul 2022 20:26:44 +0000 (22:26 +0200)]
Prefer defvar-keymap in xwidget.el

* lisp/xwidget.el (xwidget-webkit-mode-map)
(xwidget-webkit-edit-mode-map): Prefer defvar-keymap.

2 years ago* src/xdisp.c (redisplay_window): Small optimization.
Gregory Heytings [Wed, 20 Jul 2022 19:53:36 +0000 (19:53 +0000)]
* src/xdisp.c (redisplay_window): Small optimization.

2 years ago; * src/data.c (Fash): Improve wording of the doc string.
Eli Zaretskii [Wed, 20 Jul 2022 19:03:45 +0000 (22:03 +0300)]
; * src/data.c (Fash): Improve wording of the doc string.

2 years ago; * lisp/mail/smtpmail.el (smtpmail-via-smtp): Explain with-case-table.
Eli Zaretskii [Wed, 20 Jul 2022 18:27:15 +0000 (21:27 +0300)]
; * lisp/mail/smtpmail.el (smtpmail-via-smtp): Explain with-case-table.

2 years agoFurther tweaks to long lines handling.
Gregory Heytings [Wed, 20 Jul 2022 17:12:23 +0000 (17:12 +0000)]
Further tweaks to long lines handling.

* 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.

* etc/NEWS: Small improvement.

2 years agoFix mouse wheel DND scroll direction on Haiku
Po Lu [Wed, 20 Jul 2022 12:16:06 +0000 (12:16 +0000)]
Fix mouse wheel DND scroll direction on Haiku

* lisp/term/haiku-win.el (haiku-handle-drag-wheel): Record the
last wheel direction.  If it differs, clear the click counter.

2 years agoFix error during startup in -nw sessions
Eli Zaretskii [Wed, 20 Jul 2022 11:57:15 +0000 (14:57 +0300)]
Fix error during startup in -nw sessions

* lisp/startup.el (normal-top-level, command-line-1): Don't mess
with fonts in a text-mode session.  (Bug#56660)

2 years agoGently discourage use of `lsh` (bug#56641)
Mattias Engdegård [Wed, 20 Jul 2022 09:24:49 +0000 (11:24 +0200)]
Gently discourage use of `lsh` (bug#56641)

* 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.

2 years ago; * lisp/org/ol.el (org-link--decode-compound): `lsh` -> `ash`
Mattias Engdegård [Wed, 20 Jul 2022 09:17:51 +0000 (11:17 +0200)]
; * lisp/org/ol.el (org-link--decode-compound): `lsh` -> `ash`

2 years agoFix calculation of default highlightForeground in the lucid menu bar
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>.

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Wed, 20 Jul 2022 08:30:41 +0000 (10:30 +0200)]
; Merge from origin/emacs-28

The following commit was skipped:

f02944f5a1 Prevent GC of window referenced from EmacsScroller

2 years agoMerge from origin/emacs-28
Stefan Kangas [Wed, 20 Jul 2022 08:30:41 +0000 (10:30 +0200)]
Merge from origin/emacs-28

cb911febc6 ; Fix typos

# Conflicts:
# test/lisp/net/tramp-tests.el

2 years agoImplement wheel movement during DND on Haiku
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.

* src/haikuterm.c (haiku_read_socket): Call
`haiku_note_drag_wheel' when appropriate.
* src/haikuterm.h: Update prototypes.

2 years agoPrefer defvar-keymap in some trivial cases
Stefan Kangas [Wed, 20 Jul 2022 07:27:10 +0000 (09:27 +0200)]
Prefer defvar-keymap in some trivial cases

* lisp/calendar/diary-lib.el (diary-fancy-overriding-map):
* lisp/emacs-lisp/chart.el (chart-mode-map):
* lisp/emulation/cua-base.el (cua-global-keymap)
(cua--cua-keys-keymap, cua--prefix-override-keymap)
(cua--prefix-repeat-keymap, cua--global-mark-keymap)
(cua--rectangle-keymap, cua--region-keymap):
* lisp/emulation/viper-keym.el (viper-vi-intercept-map)
(viper-insert-intercept-map, viper-emacs-intercept-map)
(viper-vi-global-user-map, viper-vi-basic-map, viper-vi-kbd-map)
(viper-vi-diehard-map, viper-insert-global-user-map)
(viper-insert-basic-map, viper-insert-diehard-map)
(viper-insert-kbd-map, viper-replace-map)
(viper-emacs-global-user-map, viper-emacs-kbd-map)
(viper-empty-keymap, viper-mode-map, viper-minibuffer-map)
(viper-ex-cmd-map, ex-read-filename-map)
(viper-slash-and-colon-map, viper-comint-mode-modifier-map)
(viper-dired-modifier-map, viper-gnus-modifier-map):
* lisp/gnus/gnus-sum.el (gnus-summary-generic-mark-map):
* lisp/menu-bar.el (global-buffers-menu-map)
(menu-bar-preferences-menu):
* lisp/mh-e/mh-e.el (mh-folder-mode-map, mh-inc-spool-map)
(mh-search-mode-map, mh-show-mode-map):
* lisp/play/dunnet.el (dungeon-batch-map):
* lisp/progmodes/autoconf.el (autoconf-mode-map):
* lisp/tool-bar.el (tool-bar-map):
* lisp/vc/ediff-help.el (ediff-help-region-map):
* lisp/vc/ediff-hook.el (menu-bar-epatch-menu)
(menu-bar-ediff-merge-menu, menu-bar-ediff-menu):
* lisp/windmove.el (windmove-mode-map):
* lisp/xwidget.el (xwidget-webkit-isearch-mode-map)
(xwidget-webkit-edit-mode-map): Prefer defvar-keymap.

2 years agoFix setting user time upon scrolling self during DND
Po Lu [Wed, 20 Jul 2022 01:41:43 +0000 (09:41 +0800)]
Fix setting user time upon scrolling self during DND

* src/xterm.c (handle_one_xevent): Set user time for emulated
scroll wheel events if Emacs ends up scrolled during DND.

2 years agoMake eldoc-echo-area-prefer-doc-buffer consider all frames
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.

2 years agoEnsure Eldoc buffer displays on interactive M-x eldoc
João Távora [Tue, 19 Jul 2022 23:24:44 +0000 (00:24 +0100)]
Ensure Eldoc buffer displays on interactive M-x eldoc

* lisp/emacs-lisp/eldoc.el (eldoc-display-in-buffer): Call
eldoc-doc-buffer with interactive set to t.
(Version): Bump to 1.13.0.

2 years agoSimplified and improved heuristic for long lines detection.
Gregory Heytings [Tue, 19 Jul 2022 21:21:40 +0000 (21:21 +0000)]
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.

2 years agoRevert commits 1ff69cc744 and 9a894206f6.
Gregory Heytings [Tue, 19 Jul 2022 21:30:17 +0000 (23:30 +0200)]
Revert commits 1ff69cc744 and 9a894206f6.

2 years ago* eudc.texi: Unquote setopt option names
Philip Kaludercic [Mon, 18 Jul 2022 20:44:52 +0000 (22:44 +0200)]
* eudc.texi: Unquote setopt option names

2 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Tue, 19 Jul 2022 13:43:37 +0000 (16:43 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

2 years ago; Fix punctuation in recently changed EUDC documentation
Eli Zaretskii [Tue, 19 Jul 2022 13:42:43 +0000 (16:42 +0300)]
; Fix punctuation in recently changed EUDC documentation

* lisp/net/eudcb-macos-contacts.el (eudc-macos-contacts-search-helper):
* lisp/net/eudc-vars.el (eudc-inline-expansion-format):
* etc/NEWS: Fix punctuation in recent EUDC changes.

2 years agoImprove the heuristic for long lines detection again.
Gregory Heytings [Tue, 19 Jul 2022 13:33:38 +0000 (13:33 +0000)]
Improve the heuristic for long lines detection again.

* src/xdisp.c (redisplay_window): Improve the heuristic again.

2 years agoUse `ash` instead of `lsh`
Mattias Engdegård [Tue, 19 Jul 2022 11:57:47 +0000 (13:57 +0200)]
Use `ash` instead of `lsh`

* lisp/files.el (file-modes-number-to-symbolic):
* lisp/image/exif.el (exif--direct-ascii-value):
* lisp/term/haiku-win.el (defun):
* lisp/x-dnd.el (x-dnd-handle-xdnd, x-dnd-handle-motif):
`lsh` is slower and has confusing semantics; avoid.

2 years ago; * src/data.c (Fash): More precise doc string
Mattias Engdegård [Tue, 19 Jul 2022 11:56:08 +0000 (13:56 +0200)]
; * src/data.c (Fash): More precise doc string

2 years agoPrevent GC of window referenced from EmacsScroller
Gerd Moellmann [Tue, 21 Jun 2022 13:49:44 +0000 (15:49 +0200)]
Prevent GC of window referenced from EmacsScroller

* src/nsterm.m (EmacsScroller.mark, mark_nsterm): New functions.
* src/nsterm.h (EmacsScroller.mark, mark_nsterm): Declare.
* src/alloc.c (garbage_collect) [MAVE_NS]: Call mark_nsterm.
(Bug#56095)

(cherry picked from commit 5f1bd872478927ad4bc635502e74628d39885286)

2 years ago; Fix typos
Stefan Kangas [Tue, 19 Jul 2022 11:57:20 +0000 (13:57 +0200)]
; Fix typos

2 years ago; * lisp/bindings.el: Remove conflicting commented out bindings.
Stefan Kangas [Tue, 19 Jul 2022 11:52:12 +0000 (13:52 +0200)]
; * lisp/bindings.el: Remove conflicting commented out bindings.

2 years agoPrefer defvar-keymap in bindings.el
Stefan Kangas [Mon, 18 Jul 2022 15:32:10 +0000 (17:32 +0200)]
Prefer defvar-keymap in bindings.el

* lisp/bindings.el (narrow-map, undo-repeat-map)
(next-error-repeat-map, goto-map, search-map, ctl-x-r-map)
(page-navigation-repeat-map, abbrev-map, ctl-x-x-map): Prefer
defvar-keymap.
(mode-specific-map): Minor doc fix.

2 years agoSpeed up `butlast`
Mattias Engdegård [Tue, 19 Jul 2022 09:59:37 +0000 (11:59 +0200)]
Speed up `butlast`

* lisp/subr.el (butlast): Don't duplicate the removed part.
* test/lisp/subr-tests.el (subr-tests--butlast-ref, subr-butlast):
Add test.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Tue, 19 Jul 2022 04:30:56 +0000 (06:30 +0200)]
Merge from origin/emacs-28

282dde887d ; Fix typo missed in previous change
62c47ffd5f ; * lisp/net/tramp-crypt.el: Improve commentary
cba30431ff Merge branch 'emacs-28' of git.savannah.gnu.org:/srv/git/e...
8f9993bb3f ; * src/buffer.c (syms_of_buffer) <mode-line-format>: Doc ...
fec4bb89f9 ; Fix typos (Bug#56550)

2 years agoDocument workaround for bug#56627
Po Lu [Tue, 19 Jul 2022 03:29:34 +0000 (11:29 +0800)]
Document workaround for bug#56627

* etc/PROBLEMS: Document problems with GTK tool bar icons on
some icon themes.  (bug#56627)

2 years ago(help-fns--first-release): Try and avoid false positives
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.

2 years agoFix timestamp specified in wheel movement XDND events
Po Lu [Tue, 19 Jul 2022 01:41:36 +0000 (09:41 +0800)]
Fix timestamp specified in wheel movement XDND events

* src/xterm.c (handle_one_xevent): Use the time of the wheel
event in XDND events sent in response to wheel movement.

2 years agoMake drag-and-drop wheel movement work locally too on X
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'.

2 years ago* src/xdisp.c (set_vertical_scroll_bar): Remove stale comment.
Eli Zaretskii [Fri, 8 Jul 2022 06:48:44 +0000 (09:48 +0300)]
* src/xdisp.c (set_vertical_scroll_bar): Remove stale comment.

2 years agoFix calculation of the vertical scroll bar's thumb
Eli Zaretskii [Fri, 8 Jul 2022 06:42:02 +0000 (09:42 +0300)]
Fix calculation of the vertical scroll bar's thumb

* src/xdisp.c (set_vertical_scroll_bar): Compute window's end
position "by hand" if w->window_end_pos cannot be relied upon.

2 years ago* etc/PROBLEMS: Remove the entry which is no longer relevant.
Gregory Heytings [Mon, 18 Jul 2022 18:49:58 +0000 (20:49 +0200)]
* etc/PROBLEMS: Remove the entry which is no longer relevant.

2 years agoUse ntake also in tramp-adb.el
Michael Albinus [Mon, 18 Jul 2022 17:33:50 +0000 (19:33 +0200)]
Use ntake also in tramp-adb.el

* lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes):
Use `tramp-compat-ntake'.

2 years agoAdditional query and results attributes in eudcb-macos-contacts.el
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

2 years agoImprove the heuristic for long lines detection.
Gregory Heytings [Mon, 18 Jul 2022 15:50:57 +0000 (15:50 +0000)]
Improve the heuristic for long lines detection.

* src/buffer.h (struct buffer_text): New 'unchanged_size' field.
(BUF_UNCHANGED_SIZE): New macro to access the field.

* src/buffer.c (Fget_buffer_create): Initialize the field.
(Fbuffer_swap_text): Handle it.

* src/xdisp.c (mark_window_display_accurate_1): Set the field.
(redisplay_window): Use the field for long lines detection.

2 years ago; Fix typo missed in previous change
Robert Pluim [Mon, 18 Jul 2022 14:54:16 +0000 (16:54 +0200)]
; Fix typo missed in previous change

2 years agoShorter and safer fix for the segfault.
Gregory Heytings [Mon, 18 Jul 2022 14:04:04 +0000 (14:04 +0000)]
Shorter and safer fix for the segfault.

* src/xdisp.c (get_visually_first_element): Shorter and safer fix for
the segfault.  Improves the fix introduced in cc7f37b2a4.

2 years agoAdapt Tramp new test macros
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.

2 years agoUse ntake in Tramp
Michael Albinus [Mon, 18 Jul 2022 13:47:28 +0000 (15:47 +0200)]
Use ntake in Tramp

* lisp/net/tramp-compat.el (tramp-compat-ntake): New defalias.

* lisp/net/tramp.el (tramp-handle-directory-files):
* lisp/net/tramp-crypt.el (tramp-crypt-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Use it.

2 years ago* lisp/rect.el (rectangle-mark-mode-map): Prefer defvar-keymap.
Stefan Kangas [Mon, 18 Jul 2022 13:21:15 +0000 (15:21 +0200)]
* lisp/rect.el (rectangle-mark-mode-map): Prefer defvar-keymap.

2 years ago; * doc/lispref/lists.texi (List Elements): No passive tense!
Eli Zaretskii [Mon, 18 Jul 2022 12:46:18 +0000 (15:46 +0300)]
; * doc/lispref/lists.texi (List Elements): No passive tense!

2 years ago; * lisp/net/tramp-crypt.el: Improve commentary
Robert Pluim [Mon, 18 Jul 2022 12:37:15 +0000 (14:37 +0200)]
; * lisp/net/tramp-crypt.el: Improve commentary

2 years agoMerge branch 'emacs-28' of git.savannah.gnu.org:/srv/git/emacs into emacs-28
Eli Zaretskii [Mon, 18 Jul 2022 12:32:10 +0000 (15:32 +0300)]
Merge branch 'emacs-28' of git.savannah.gnu.org:/srv/git/emacs into emacs-28

2 years ago; * src/buffer.c (syms_of_buffer) <mode-line-format>: Doc fix.
Eli Zaretskii [Mon, 18 Jul 2022 12:31:26 +0000 (15:31 +0300)]
; * src/buffer.c (syms_of_buffer) <mode-line-format>: Doc fix.

2 years ago; Fix typos (Bug#56550)
Stefan Kangas [Mon, 18 Jul 2022 12:22:33 +0000 (14:22 +0200)]
; Fix typos (Bug#56550)

2 years agoFix typo in NEWS title.
Gregory Heytings [Mon, 18 Jul 2022 11:46:15 +0000 (13:46 +0200)]
Fix typo in NEWS title.

2 years agoClarify `take` and `ntake` documentation (bug#56521)
Mattias Engdegård [Mon, 18 Jul 2022 10:19:38 +0000 (12:19 +0200)]
Clarify `take` and `ntake` documentation (bug#56521)

* doc/lispref/lists.texi (List Elements): Describe `ntake` better.
* src/fns.c (Ftake, Fntake): Rephrase doc strings.

2 years agoSpeed up `seq-subseq` for lists (bug#56521)
Mattias Engdegård [Mon, 18 Jul 2022 09:32:22 +0000 (11:32 +0200)]
Speed up `seq-subseq` for lists (bug#56521)

* 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.

2 years agoUse `take` where clearly safe to do so (bug#56521)
Mattias Engdegård [Sun, 17 Jul 2022 17:05:03 +0000 (19:05 +0200)]
Use `take` where clearly safe to do so (bug#56521)

* lisp/emacs-lisp/seq.el (seq-take):
* lisp/auth-source.el (auth-source-secrets-search)
(auth-source-plstore-search):
* lisp/gnus/message.el (message-insert-formatted-citation-line):
* lisp/net/dbus.el (dbus-unregister-object):
* lisp/replace.el (occur-context-lines):
* test/src/print-tests.el (print-circular): Replace hand-written loop
or `butlast` call with `take` for clarity, performance and validation.
We have the equivalence
(take N LIST) = (butlast LIST (- (length LIST) N)).

2 years agoFurther improvements to long lines handling.
Gregory Heytings [Mon, 18 Jul 2022 10:08:33 +0000 (10:08 +0000)]
Further improvements to long lines handling.

* src/xdisp.c (get_visually_first_element): Fix segfault.
(get_narrowed_begv): Specific improvement for character-only terminals.

2 years ago* lisp/minibuffer.el (minibuffer-complete-history): Define sorting by metadata
Juri Linkov [Mon, 18 Jul 2022 07:23:41 +0000 (10:23 +0300)]
* lisp/minibuffer.el (minibuffer-complete-history): Define sorting by metadata

(minibuffer-complete-history, minibuffer-complete-defaults):
Use completion metadata to disable sorting of the completion table
(bug#56613)

2 years agoImplement last change on Haiku as well
Po Lu [Mon, 18 Jul 2022 04:49:46 +0000 (04:49 +0000)]
Implement last change on Haiku as well

* lisp/term/haiku-win.el (haiku-dnd-drag-handler): Stop
redisplaying here.
* src/haikuselect.c (haiku_note_drag_motion): Use
redisplay_preserve_echo_area.

2 years agoPreserve echo area message when running DND mouse movement function
Po Lu [Mon, 18 Jul 2022 04:42:23 +0000 (12:42 +0800)]
Preserve echo area message when running DND mouse movement function

* lisp/term/x-win.el (x-dnd-movement): Stop redisplaying here.
* src/xterm.c (x_dnd_begin_drag_and_drop): Redisplay with the
echo area preserved.

2 years agoDerive `Info-mode' from `special-mode'
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').

2 years agoinfo-edit: Delay `ibuffer' var change until after `ibuffer' loads
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'.

2 years agoHandle virtual modifiers in the DND scrolling code
Po Lu [Mon, 18 Jul 2022 01:20:05 +0000 (09:20 +0800)]
Handle virtual modifiers in the DND scrolling code

* lisp/x-dnd.el (x-dnd-modifier-mask): Handle virtual modifiers.
* src/xfns.c (Fx_get_modifier_masks): New function.
(syms_of_xfns): Define new subr.
* src/xterm.c (x_get_keyboard_modifiers): New function.
* src/xterm.h: Update prototypes.

2 years ago* lisp/minibuffer.el (minibuffer-complete-history): Ensure a list of strings
Stefan Monnier [Sun, 17 Jul 2022 18:30:43 +0000 (14:30 -0400)]
* lisp/minibuffer.el (minibuffer-complete-history): Ensure a list of strings

2 years ago* lisp/subr.el (read-char-from-minibuffer, y-or-n-p): Simplify to use HIST=t.
Juri Linkov [Sun, 17 Jul 2022 18:06:31 +0000 (21:06 +0300)]
* lisp/subr.el (read-char-from-minibuffer, y-or-n-p): Simplify to use HIST=t.

2 years ago* lisp/minibuffer.el (minibuffer-complete-history): Check for history=t.
Juri Linkov [Sun, 17 Jul 2022 18:04:29 +0000 (21:04 +0300)]
* lisp/minibuffer.el (minibuffer-complete-history): Check for history=t.

Signal a user error when the history is not a list (bug#56613).

2 years agoAdd `take` and `ntake` (bug#56521)
Mattias Engdegård [Wed, 13 Jul 2022 11:46:52 +0000 (13:46 +0200)]
Add `take` and `ntake` (bug#56521)

These are useful list primitives, complementary to `nthcdr`.

* src/fns.c (Ftake, Fntake): New.
(syms_of_fns): Defsubr them.
* doc/lispref/lists.texi (List Elements):
* lisp/emacs-lisp/shortdoc.el (list): Document.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns):
Declare `take` pure and side-effect-free.
* test/src/fns-tests.el (fns-tests--take-ref, fns--take-ntake):
New test.
* etc/NEWS: Announce.

2 years agoFix leaking of file descriptors due to pipe processes on MS-Windows
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)

2 years agoImprove handling of tilt scroll and flip options during DND
Po Lu [Sun, 17 Jul 2022 12:14:02 +0000 (20:14 +0800)]
Improve handling of tilt scroll and flip options during DND

* lisp/x-dnd.el (x-dnd-mwheel-scroll): New function.
(x-dnd-handle-xdnd): Use that instead of abusing mwheel.el.

2 years agoPrefer defvar-keymap in mpc.el
Stefan Kangas [Sun, 17 Jul 2022 10:56:38 +0000 (12:56 +0200)]
Prefer defvar-keymap in mpc.el

* lisp/mpc.el (mpc-mode-map, mpc-tagbrowser-dir-mode-map)
(mpc-volume-map, mpc-songs-mode-map): Prefer defvar-keymap.

2 years agoMake `C' in over tramp work in archive mode
Lars Ingebrigtsen [Sun, 17 Jul 2022 10:12:24 +0000 (12:12 +0200)]
Make `C' in over tramp work in archive mode

* lisp/arc-mode.el (archive-copy-file): Make `C' in over tramp
work (bug#56574).

2 years ago; * src/xdisp.c (redisplay_tool_bar): Fix a possible typo.
Eli Zaretskii [Sun, 17 Jul 2022 10:12:03 +0000 (13:12 +0300)]
; * src/xdisp.c (redisplay_tool_bar): Fix a possible typo.

2 years agoFix tab-bar resizing under 'auto-resize-tab-bars' = 'grow-only'
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'.

2 years agoEnsure that directories exist when copying files from archive
Visuwesh [Sun, 17 Jul 2022 09:22:32 +0000 (11:22 +0200)]
Ensure that directories exist when copying files from archive

* lisp/arc-mode.el (archive-copy-file): If the directory the file is
being extracted to does not exist, then create it (bug#56603).