]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agocursor-face-highlight-nonselected-window default to nil
Jimmy Aguilar Mena [Thu, 17 Mar 2022 22:28:07 +0000 (23:28 +0100)]
cursor-face-highlight-nonselected-window default to nil

* lisp/simple.el (redisplay--update-cursor-face-highlight) : Use if-let*
and not check facep.
(cursor-face-highlight-nonselected-window) : default to nil

2 years agoAdd new variable cursor-face-highlight-nonselected-window
Jimmy Aguilar Mena [Thu, 17 Mar 2022 18:16:36 +0000 (19:16 +0100)]
Add new variable cursor-face-highlight-nonselected-window

* lisp/simple.el (cursor-face-highlight-nonselected-window) : New
custom default to cursor-in-non-selected-windows.
(redisplay--update-cursor-face-highlight) : Extend highlight condition
to consider the new variable.

2 years ago* lisp/simple.el (cursor-face-highlight-mode): Fix copy&paste
Stefan Monnier [Mon, 14 Mar 2022 12:27:31 +0000 (08:27 -0400)]
* lisp/simple.el (cursor-face-highlight-mode): Fix copy&paste

2 years agoAdd local to remove-hook in cursor-face-highlight-mode
Jimmy Aguilar Mena [Mon, 14 Mar 2022 08:46:32 +0000 (09:46 +0100)]
Add local to remove-hook in cursor-face-highlight-mode

Add LOCAL flag in remove-hook and reword the dock string.

Thanks to Stefan Monnier for this

2 years agoImprove cursor-face-highlight-mode a bit more.
Jimmy Aguilar Mena [Mon, 14 Mar 2022 01:55:27 +0000 (02:55 +0100)]
Improve cursor-face-highlight-mode a bit more.

Add the hook locally to the buffer only when needed to avoid even
calling the function redisplay--update-cursor-face-highlight when the
mode is enabled.

* lisp/simple.el (redisplay--update-cursor-face-highlight) : Remove
unneeded condition.
(cursor-face-highlight-mode) : Conditionally add or remove
redisplay--update-cursor-face-highlight to pre-redisplay-functions with
buffer local flag.

2 years agoImprove the cursor-face feature.
Jimmy Aguilar Mena [Mon, 14 Mar 2022 01:38:46 +0000 (02:38 +0100)]
Improve the cursor-face feature.

Use a minor mode to reduce potential performance issues.

* lisp/simple.el (cursor-face-highlight-mode) : New minor mode
(completion-setup-function) : Use the new minor mode
cursor-face-highlight-mode in completions.
(redisplay--unhighlight-overlay-function) : Add -- to the name
(redisplay--highlight-overlay-function) : Make the face parameter
optional and add -- in the name.

2 years agoMake the completion-header-format info more precise.
Jimmy Aguilar Mena [Sun, 13 Mar 2022 22:51:13 +0000 (23:51 +0100)]
Make the completion-header-format info more precise.

2 years agoSimplify unneeded condition.
Jimmy Aguilar Mena [Sun, 13 Mar 2022 21:22:02 +0000 (22:22 +0100)]
Simplify unneeded condition.

* lisp/minibuffer.el (display-completion-list) : The function
completion--insert-string already has a condition for when completions
is nil.

2 years agoRename hook
Jimmy Aguilar Mena [Sun, 13 Mar 2022 20:35:48 +0000 (21:35 +0100)]
Rename hook

* lisp/simple.el (redisplay--update-cursor-property-highlight) : Renamed
to redisplay--update-cursor-property-highlight

2 years agoExtend completion-auto-help 'always and 'visible.
Jimmy Aguilar Mena [Sun, 13 Mar 2022 19:42:08 +0000 (20:42 +0100)]
Extend completion-auto-help 'always and 'visible.

Make them behave the same also with exact but not single completion.

2 years agoUse the new cursor-face feature to highlight completions.
Jimmy Aguilar Mena [Sun, 13 Mar 2022 19:34:19 +0000 (20:34 +0100)]
Use the new cursor-face feature to highlight completions.

* lisp/minibuffer.el (completions-highlight-face) : New custom.
(completions-highlight-mode) : Removed

2 years agoRename completion-header-string to completion-header-format
Jimmy Aguilar Mena [Sun, 13 Mar 2022 18:44:11 +0000 (19:44 +0100)]
Rename completion-header-string to completion-header-format

And use a propertized default value.

2 years agoAdd new special text attribute cursor-face
Jimmy Aguilar Mena [Sun, 13 Mar 2022 18:26:23 +0000 (19:26 +0100)]
Add new special text attribute cursor-face

Reuse the functions for highlight region.
* lisp/simple.el (redisplay-unhighlight-overlay-function) :
(redisplay-highlight-overlay-function) : New functions from previous
lambda
(redisplay-unhighlight-region-function) :
(redisplay-highlight-region-function) : Redefined with the new functions.
(redisplay--update-cursor-property-highlight) : New function for
pre-redisplay-functions.

2 years agoMake minibuffer-hide-completions interactive.
Jimmy Aguilar Mena [Sun, 13 Mar 2022 15:04:58 +0000 (16:04 +0100)]
Make minibuffer-hide-completions interactive.

Mainly to find a binding for it.

2 years agoAdd completion-header-string.
Jimmy Aguilar Mena [Sun, 13 Mar 2022 14:59:13 +0000 (15:59 +0100)]
Add completion-header-string.

* doc/emacs/mini.texi (completion-header-string): Remove
completion-header-text-property-list and completion-lazy-count.
(completion-header-string): Substitutes the removed variable.

2 years agoAdd two new options for completions.
Jimmy Aguilar Mena [Fri, 11 Mar 2022 23:54:39 +0000 (00:54 +0100)]
Add two new options for completions.

* doc/emacs/mini.texi (completion-lazy-count):
(completion-header-text-property-list) : New customs

Updated NEWS and manual.

2 years agoFix new option completions-max-height and new values for completion-auto-help
Juri Linkov [Thu, 10 Mar 2022 18:48:48 +0000 (20:48 +0200)]
Fix new option completions-max-height and new values for completion-auto-help

* doc/emacs/mini.texi (Completion Options): Fix pxref for
"Buffer Display Action Alists".

* lisp/minibuffer.el (completion-auto-help): Explain new values in docstring.
(completions-max-height): Use choice to allow nil.

2 years agoAdd new mode completions-highlight-mode.
Jimmy Aguilar Mena [Thu, 10 Mar 2022 13:36:02 +0000 (14:36 +0100)]
Add new mode completions-highlight-mode.

2 years agocompletions-max-height new custom variable.
Jimmy Aguilar Mena [Tue, 8 Mar 2022 11:46:56 +0000 (12:46 +0100)]
completions-max-height new custom variable.

2 years agocompletion-auto-help new values.
Jimmy Aguilar Mena [Thu, 10 Mar 2022 10:24:17 +0000 (11:24 +0100)]
completion-auto-help new values.

Added also entries to news and manual

2 years agoSupport remote home directories via connection property
Michael Albinus [Thu, 10 Mar 2022 11:31:22 +0000 (12:31 +0100)]
Support remote home directories via connection property

* doc/misc/tramp.texi (Home directories): New section.
(Top, Usage): Add it to the menue.
(Predefined connection information): Mention "~".
(Multi-hops, File name syntax): Fix typos.

* lisp/net/tramp.el (tramp-handle-expand-file-name): Check for
remote home directory.  (Bug#53847)

2 years agoFix display of minibuffer prompts in some circumstances on Haiku
Po Lu [Thu, 10 Mar 2022 10:39:03 +0000 (10:39 +0000)]
Fix display of minibuffer prompts in some circumstances on Haiku

* src/haikuterm.c (haiku_flush): Always flip buffers as long as
buffer flipping is not blocked.

2 years agoFix menu bar activation on PGTK
Po Lu [Thu, 10 Mar 2022 03:48:12 +0000 (11:48 +0800)]
Fix menu bar activation on PGTK

* src/gtkutil.c (menu_bar_button_pressed_cb): Only update menu
bar if no menu is active, and the event window is not the widget
window itself.  Also make menu in use.
* src/pgtkmenu.c (popup_deactivate_callback): Make menu not in
use.
* src/xdisp.c (redisplay_internal): Return if popup_activated
also on PGTK.

2 years agoFix stray button release events being reported on GTK 2
Po Lu [Thu, 10 Mar 2022 01:16:39 +0000 (09:16 +0800)]
Fix stray button release events being reported on GTK 2

* src/xterm.c (handle_one_xevent): Drop ButtonRelease events
that are destined for a popup menu.

2 years agoFix menu bar event detection on XI2 builds using Core Input
Po Lu [Thu, 10 Mar 2022 01:12:59 +0000 (09:12 +0800)]
Fix menu bar event detection on XI2 builds using Core Input

* src/gtkutil.c (xg_get_gdk_scale): Always return 1 on GTK+ 2.
(xg_event_is_for_menubar): Fix some ifdefs.
* src/xterm.c (handle_one_xevent): Update a comment.

2 years agoFix regression in vtable-goto-object
Lars Ingebrigtsen [Wed, 9 Mar 2022 16:37:36 +0000 (17:37 +0100)]
Fix regression in vtable-goto-object

* lisp/emacs-lisp/vtable.el (vtable-goto-object): Fix moving to
the object.

2 years agoFix some issues with GTK native input and modifiers on GTK 2
Po Lu [Wed, 9 Mar 2022 13:33:48 +0000 (21:33 +0800)]
Fix some issues with GTK native input and modifiers on GTK 2

* src/gtkutil.c (xg_widget_key_press_event_cb): Manually ignore
modifier keys on GTK 2.

2 years agoMake XInput 2 features work on GTK 2 builds
Po Lu [Wed, 9 Mar 2022 13:29:17 +0000 (21:29 +0800)]
Make XInput 2 features work on GTK 2 builds

* src/xfns.c (setup_xi_event_mask): On GTK 2, select for
button, motion, entry/exit and key events.
* src/xmenu.c (create_and_show_popup_menu): Clear XI grab if
appropriate.
* src/xterm.c (handle_one_xevent): Pass some kinds of input
extension events to GTK manually on versions of GTK+ that don't
understand them.

2 years agoFix GTK widgets not appearing inside child frames
Po Lu [Wed, 9 Mar 2022 12:43:59 +0000 (20:43 +0800)]
Fix GTK widgets not appearing inside child frames

* src/xfns.c (x_set_parent_frame): Disable GTK's own frame
synchronization in child frames.

2 years agoFix error when creating frames on NS with no main window
Po Lu [Wed, 9 Mar 2022 08:28:33 +0000 (16:28 +0800)]
Fix error when creating frames on NS with no main window

* nsfns.m (Fx_create_frame): If main window is not present,
center frame window instead of cascading it.

2 years agoDon't update Haiku menu bar if nothing changed
Po Lu [Wed, 9 Mar 2022 06:58:01 +0000 (06:58 +0000)]
Don't update Haiku menu bar if nothing changed

* haikumenu.c (set_frame_menubar): If Lisp-level contents didn't
change, refrain from actually updating the menu bar.

2 years agoFix flicker during frame resize on Haiku
Po Lu [Wed, 9 Mar 2022 03:50:16 +0000 (03:50 +0000)]
Fix flicker during frame resize on Haiku

* haikuterm.c (haiku_update_end): Call BWindow_Flush directly.
(haiku_set_vertical_scroll_bar): Stop calling flush_frame.
(haiku_flush): Only flip buffer of tooltip frames.

2 years agoFix the MS-DOS build
Po Lu [Wed, 9 Mar 2022 03:29:05 +0000 (11:29 +0800)]
Fix the MS-DOS build

* sed1v2.inp: Update for recent changes.

2 years agoImprove handling of tooltips inside menus on Haiku
Po Lu [Wed, 9 Mar 2022 03:21:36 +0000 (03:21 +0000)]
Improve handling of tooltips inside menus on Haiku

* src/haiku_support.cc (BMenu_run): Make
`process_pending_signals_function' return a struct timespec.
* src/haiku_support.h: Update prototypes.
* src/haikumenu.c (haiku_process_pending_signals_for_menu):
Return result of `timer_run'.
* src/haikuterm.c (haiku_flush): Flip buffers if frame is dirty.

2 years agoDecouple mod-test.c from Gnulib
Paul Eggert [Wed, 9 Mar 2022 02:46:47 +0000 (18:46 -0800)]
Decouple mod-test.c from Gnulib

mod-test.c should not use Gnulib code, as that creates
unnecessary coupling between Emacs internals and this test module.
Also Gnulib code is compiled without -fPIC whereas mod-test.c
needs -fPIC and recompiling Gnulib with -fPIC would be too painful.
* src/Makefile.in (LIB_NANOSLEEP): New macro.
(LIBES): Use it.
* test/Makefile.in (REPLACE_FREE, FREE_SOURCE_0, FREE_SOURCE_0):
Remove.  All uses removed.
(LIB_CLOCK_GETTIME, LIB_NANOSLEEP): New macros.
(MODULE_CFLAGS): Do not -I from lib as that would include Gnulib
modifications to standard .h files (e.g., "#define nanosleep
rpl_nanosleep") and we don’t want the Gnulib replacements.
Instead, for gmp.h (on platforms lacking <gmp.h>) simply '-I.'
with a suitable gmp.h.
(gmp.h): New rule to create a suitable gmp.h.
($(test_module)): Depend on config.h since the code uses config.h.
Depend on gmp.h if we need to create a suitable one.
If compiling mini-gmp.h, compile the original one and not
the Emacs-specific one, to lessen coupling with Emacs internals.
Link with LIB_CLOCK_GETTIME and LIB_NANOSLEEP.
(clean): Remove gmp.h.
* test/src/emacs-module-resources/mod-test.c: Don’t include timespec.h.
All uses of timespec.h APIs changed to use system-supplied APIs.
Change _Static_assert to plain assert, so that we needn’t rely
on Gnulib’s _Static_assert.
(timespec_le) [CLOCK_REALTIME]: New function.
Change use of timespec_cmp changed to use this instead.
(Fmod_test_sleep_until, Fmod_test_nanoseconds):
Define these functions and their Lisp names mod-test-sleep-until
and mod-test-nanoseconds only if CLOCK_REALTIME,
since they now won’t work on platforms lacking CLOCK_REALTIME.
(Fmod_test_nanoseconds): Just use _Static_assert since it
should work on all platforms.
* test/src/emacs-module-tests.el (mod-test-sleep-until)
(mod-test-nanoseconds, mod-test-double):
Skip test if the corresponding functione is not defined.

2 years agoDo not include <attribute.h> from <config.h>
Paul Eggert [Wed, 9 Mar 2022 02:46:47 +0000 (18:46 -0800)]
Do not include <attribute.h> from <config.h>

This is because mod-test.c shouldn’t use source code from lib,
but it does need to include <config.h>.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/seccomp-filter.c, src/dynlib.h, src/lisp.h:
* src/syssignal.h, src/sysstdio.h, src/systhread.h, src/tparam.h:
Include <attribute.h>.
* src/conf_post.h: Do not include <attribute.h>.
All uses of attribute.h macros replaced with their _GL_ equivalents.

2 years ago* src/xterm.c (handle_one_xevent): Add more dead keys.
Po Lu [Wed, 9 Mar 2022 00:50:24 +0000 (08:50 +0800)]
* src/xterm.c (handle_one_xevent): Add more dead keys.

2 years agoMark tramp test unstable on EMBA
Lars Ingebrigtsen [Tue, 8 Mar 2022 20:11:18 +0000 (21:11 +0100)]
Mark tramp test unstable on EMBA

* test/lisp/net/tramp-tests.el
(tramp-test44-asynchronous-requests): Mark timed-out EMBA test as
unstable.

2 years agoImplement abbreviate-file-name in Tramp for Google drive
Michael Albinus [Tue, 8 Mar 2022 16:28:30 +0000 (17:28 +0100)]
Implement abbreviate-file-name in Tramp for Google drive

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-get-home-directory):
Implement for Google drive.

2 years agoSupport applying indices to more Eshell dollar expansions
Jim Porter [Sat, 5 Mar 2022 19:45:49 +0000 (11:45 -0800)]
Support applying indices to more Eshell dollar expansions

For example, '${echo -e "hi\nbye"}[1]' should expand to "bye".

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Support applying
indices to '${}', '$()', and '$<>' forms.
(Bug#54227)

* lisp/eshell/esh-var-tests.el (esh-var-test/interp-lisp-indices)
(esh-var-test/interp-cmd-indices)
(esh-var-test/interp-cmd-external-indices)
(esh-var-test/quoted-interp-lisp-indices)
(esh-var-test/quoted-interp-cmd-indices): New tests.

2 years agoImprove wording of Eshell variable interpolation code/documentation
Jim Porter [Thu, 3 Mar 2022 17:37:25 +0000 (09:37 -0800)]
Improve wording of Eshell variable interpolation code/documentation

* lisp/eshell/esh-arg.el (eshell-unescape-inner-double-quote): Rename
from 'eshell-parse-inner-double-quote'.

* lisp/eshell/esh-cmd.el (eshell-with-temp-command): Improve
docstring.

* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Use
'eshell-unescape-inner-double-quote' and improve robustness of quoted
variable name matching.
(eshell-parse-indices): Use 'eshell-unescape-inner-double-quote'.

* doc/misc/eshell.texi (Dollars Expansion): Improve wording of
subscript notation.

2 years agoMerge from origin/emacs-28
Eli Zaretskii [Tue, 8 Mar 2022 13:41:46 +0000 (15:41 +0200)]
Merge from origin/emacs-28

d184773 Avoid assertion violations in 'bidi_resolve_brackets'

2 years agoAvoid assertion violations in 'bidi_resolve_brackets'
Eli Zaretskii [Tue, 8 Mar 2022 13:35:39 +0000 (15:35 +0200)]
Avoid assertion violations in 'bidi_resolve_brackets'

* src/bidi.c (bidi_resolve_brackets): Move assertion to where it
really matters.  (Bug#54295)

2 years agoHandle XI focus change events that specify implicit focus correctly
Po Lu [Tue, 8 Mar 2022 13:25:37 +0000 (21:25 +0800)]
Handle XI focus change events that specify implicit focus correctly

* src/xterm.c (x_detect_focus_change): If detail is
XINotifyPointer, set focus type to implicit.

2 years agoFix detection of modifier keys on XInput 2
Po Lu [Tue, 8 Mar 2022 10:31:12 +0000 (18:31 +0800)]
Fix detection of modifier keys on XInput 2

* src/xterm.c (handle_one_xevent): Fix iteration over sets of
modifiers.

2 years agoHandle bug#54294 in Tramp
Michael Albinus [Tue, 8 Mar 2022 07:52:57 +0000 (08:52 +0100)]
Handle bug#54294 in Tramp

* lisp/net/tramp.el (tramp-handle-file-locked-p, tramp-handle-lock-file):
Use `tramp-system-name'.  (Bug#54294)

2 years agoFix more uses of opaque Visual structure
Po Lu [Tue, 8 Mar 2022 07:19:37 +0000 (15:19 +0800)]
Fix more uses of opaque Visual structure

* src/image.c (x_kill_gs_process):
* src/xfaces.c (x_free_colors):
(x_free_dpy_colors):
* src/xfns.c (Fxw_display_color_p):
(Fx_display_grayscale_p):
(Fx_display_visual_class):
* src/xterm.c (x_copy_color):
* src/xterm.h (x_mutable_colormap): Stop using private fields of
Visual.

2 years agoReturn actual color cell count in x-display-color-cells
Po Lu [Tue, 8 Mar 2022 06:15:01 +0000 (14:15 +0800)]
Return actual color cell count in x-display-color-cells

* src/xfns.c (Fx_display_color_cells): Return the actual amount
of color cells, or the amount of individual combinations of
components.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Tue, 8 Mar 2022 05:32:57 +0000 (06:32 +0100)]
Merge from origin/emacs-28

80736aef90 Fix which-func-update doc string
d9e5ae5e20 Improve wording of 'dired-jump's description

2 years ago(cl-macro-list): Simplify by unifying the variants
Stefan Monnier [Tue, 8 Mar 2022 03:27:19 +0000 (22:27 -0500)]
(cl-macro-list): Simplify by unifying the variants

* lisp/emacs-lisp/cl-macs.el (cl-macro-list): Add the &whole and the
dotted tail cases from `cl-macro-list1`.
(cl-macro-list1, cl-define-compiler-macro-list): Delete edebug elem specs.
(cl-destructuring-bind, cl-define-compiler-macro): Use `cl-macro-list`
instead, now that it covers all the cases we need.

2 years agoAvoid color leaks while better ensuring a close color is found
Po Lu [Tue, 8 Mar 2022 01:14:41 +0000 (09:14 +0800)]
Avoid color leaks while better ensuring a close color is found

* src/xterm.c (x_alloc_nearest_color_1): Verify nearest can be
allocated, and use that color value.

2 years agoFix choice of visuals for XPM icon
Po Lu [Tue, 8 Mar 2022 00:41:15 +0000 (08:41 +0800)]
Fix choice of visuals for XPM icon

* src/xterm.c (x_bitmap_icon): Allow using XPM icon on
StaticColor and StaticGray as well.

2 years agoRemove lock file in --no-build-details, too
Lars Ingebrigtsen [Mon, 7 Mar 2022 17:03:14 +0000 (18:03 +0100)]
Remove lock file in --no-build-details, too

* src/filelock.c (current_lock_owner): Make file writes work when
using --no-build-details (bug#54294).

2 years agoMark ert-test-run-tests-batch-expensive unstable on EMBA
Lars Ingebrigtsen [Mon, 7 Mar 2022 16:39:00 +0000 (17:39 +0100)]
Mark ert-test-run-tests-batch-expensive unstable on EMBA

2 years agoAdd user stylesheet option for doc-view EPUB support
Kjartan Oli Agustsson [Mon, 7 Mar 2022 16:29:38 +0000 (17:29 +0100)]
Add user stylesheet option for doc-view EPUB support

* lisp/doc-view.el (doc-view-start-process): Add user stylesheet to
process arguments when appropriate.

* lisp/doc-view.el (doc-view-mutool-user-stylesheet): New user option.

Copyright-paperwork-exempt: yes

2 years agoFix which-func-update doc string
Lars Ingebrigtsen [Mon, 7 Mar 2022 15:19:19 +0000 (16:19 +0100)]
Fix which-func-update doc string

* lisp/progmodes/which-func.el (which-func-update): Make the doc
string match the code (bug#54288).

2 years ago* lisp/emacs-lisp/seq.el (seq-concatenate): Accept non-`sequencep` sequences
Stefan Monnier [Mon, 7 Mar 2022 14:59:43 +0000 (09:59 -0500)]
* lisp/emacs-lisp/seq.el (seq-concatenate): Accept non-`sequencep` sequences

2 years agoCorrectly handle exposure in oldXMenu
Po Lu [Mon, 7 Mar 2022 13:36:25 +0000 (21:36 +0800)]
Correctly handle exposure in oldXMenu

* oldXMenu/Activate.c (XMenuActivate): Call set expose_func if
no pane was found.
(XMenuActivateSetExposeFunction): New function.
* oldXMenu/XMenu.h: New typedef `expose_func'.  Update
prototypes.
* src/xmenu.c (x_menu_expose_event): New function.
(x_menu_show): Set expose event handler.
* src/xterm.c (x_dispatch_event): Make `static' only on GTK.
* src/xterm.h: Expose `x_dispatch_event' on no-toolkit builds.

2 years agoImprove color handling on colormapped displays
Po Lu [Mon, 7 Mar 2022 13:08:07 +0000 (21:08 +0800)]
Improve color handling on colormapped displays

* src/xfns.c (select_visual): Set `visual_info' field whenever
appropriate.
(x_create_tip_frame, XDisplayCells): Don't access private fields
of Visual.

* src/xterm.c (x_color_cells, x_alloc_nearest_color_1): Use
colormap_size instead of default cell count.
(XTflash, x_bitmap_icon, x_term_init):
* src/xterm.h (struct x_display_info, FRAME_X_VISUAL_INFO): Stop
accessing private fields of Visual.

2 years agoHandle color allocation failures caused by colormap changes
Po Lu [Mon, 7 Mar 2022 12:08:13 +0000 (20:08 +0800)]
Handle color allocation failures caused by colormap changes

* src/xterm.c (x_alloc_nearest_color_1): Recompute color cells
if allocation of cached value failed.

2 years agoRework `abbreviate-file-name' in Tramp
Michael Albinus [Mon, 7 Mar 2022 12:42:30 +0000 (13:42 +0100)]
Rework `abbreviate-file-name' in Tramp

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Add 'tramp-get-home-directory'.

* lisp/net/tramp-compat.el (tramp-file-name-handler): Declare.
(tramp-compat-exec-path): Use it.

* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
Add 'tramp-get-home-directory'.
(tramp-gvfs-handle-expand-file-name): Rewrite tilde handling.
(tramp-gvfs-handle-get-home-directory): New defun.

* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
Add 'tramp-get-home-directory'.
(tramp-sh-handle-get-home-directory): New defun.
(tramp-sh-handle-expand-file-name): Rewrite tilde handling.

* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Add 'tramp-get-home-directory'.
(tramp-smb-handle-expand-file-name): Rewrite tilde handling.
(tramp-smb-handle-get-home-directory): New defun.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add 'tramp-get-home-directory'.
(tramp-sudoedit-handle-expand-file-name): Rewrite tilde handling.
(tramp-sudoedit-handle-get-home-directory): New defun.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Add `tramp-get-home-directory'.
(tramp-get-home-directory): New defun.
(tramp-handle-abbreviate-file-name): Use it.
(tramp-set-file-uid-gid, tramp-get-remote-uid)
(tramp-get-remote-gid): Use `tramp-file-name-handler'.
(tramp-get-remote-null-device): Do not check for null VEC, it
doesn't happen anymore.

* test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name-relative):
Reorder checks.
(tramp-test07-abbreviate-file-name):
(tramp--test-ange-ftp-p): Adapt tests.

2 years agoImprove wording of 'dired-jump's description
Eli Zaretskii [Mon, 7 Mar 2022 12:38:01 +0000 (14:38 +0200)]
Improve wording of 'dired-jump's description

* doc/emacs/dired.texi (Dired Enter): Clarify wording.  Reported
by Natalie <batalie@riseup.net>.

2 years ago; * src/xterm.c (x_alloc_nearest_color_1): Commit missing hunk (again).
Po Lu [Mon, 7 Mar 2022 11:57:19 +0000 (19:57 +0800)]
; * src/xterm.c (x_alloc_nearest_color_1): Commit missing hunk (again).

2 years ago; * src/xterm.c (x_alloc_nearest_color_1): Add missing part of change.
Po Lu [Mon, 7 Mar 2022 11:56:23 +0000 (19:56 +0800)]
; * src/xterm.c (x_alloc_nearest_color_1): Add missing part of change.

2 years agoFix color leak
Po Lu [Mon, 7 Mar 2022 11:53:52 +0000 (19:53 +0800)]
Fix color leak

* src/xterm.c (x_alloc_nearest_color_1): Don't allocate colors
multiple times when searching for a closest match.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Mon, 7 Mar 2022 05:33:56 +0000 (06:33 +0100)]
Merge from origin/emacs-28

73f28fbde8 Add a comment for previous browse-url-of-dired-file change
9b74e84857 Restore documented Emacs 27.2 behaviour of browse-url-of-d...
cd77fd3b85 Update to Org 9.5.2-24-g668205

2 years agoFix bookmark-bmenu-list sorting.
Manuel Giraud [Thu, 3 Mar 2022 16:32:13 +0000 (17:32 +0100)]
Fix bookmark-bmenu-list sorting.

Do not sort bookmarks in `bookmark-bmenu-list' if `bookmark-sort-flag'
is nil.

Also, make the default order of bookmark-bmenu-list be the LIFO order
defined in `bookmark-sort-flag's documentation.

2 years agoFix maximum selection size reporting
Po Lu [Mon, 7 Mar 2022 05:09:07 +0000 (13:09 +0800)]
Fix maximum selection size reporting

* src/xselect.c (selection_quantum): Take into account extended
request size.

2 years agoFix typo in previous browse-url-file-url change
Lars Ingebrigtsen [Mon, 7 Mar 2022 04:58:39 +0000 (05:58 +0100)]
Fix typo in previous browse-url-file-url change

* lisp/net/browse-url.el (browse-url-file-url): Fix typo in
previous change.

2 years agoAdd a comment for previous browse-url-of-dired-file change
Lars Ingebrigtsen [Mon, 7 Mar 2022 04:15:58 +0000 (05:15 +0100)]
Add a comment for previous browse-url-of-dired-file change

* lisp/net/browse-url.el (browse-url-of-dired-file): Add a comment
for previous change.

2 years agoRestore documented Emacs 27.2 behaviour of browse-url-of-dired-file
Lars Ingebrigtsen [Mon, 7 Mar 2022 04:13:19 +0000 (05:13 +0100)]
Restore documented Emacs 27.2 behaviour of browse-url-of-dired-file

* lisp/net/browse-url.el (browse-url-of-dired-file): Restore the
documented behaviour -- open a web browser instead of passing to
the various handlers.

2 years agoFix esh-proc-test/kill-pipeline-head loop syntax
Lars Ingebrigtsen [Mon, 7 Mar 2022 03:25:21 +0000 (04:25 +0100)]
Fix esh-proc-test/kill-pipeline-head loop syntax

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-pipeline-head): Fix syntax of loop.

2 years agoInhibit extpipe tests on EMBA, because they apparently time out?
Lars Ingebrigtsen [Mon, 7 Mar 2022 03:09:27 +0000 (04:09 +0100)]
Inhibit extpipe tests on EMBA, because they apparently time out?

https://emba.gnu.org/emacs/emacs/-/pipelines/16387

2 years agoFix clearing of scroll bars on builds with disabled double buffers
Po Lu [Mon, 7 Mar 2022 02:54:48 +0000 (10:54 +0800)]
Fix clearing of scroll bars on builds with disabled double buffers

* src/xterm.c (x_scroll_bar_clear): Use XClearArea if the scroll
bar is not double-buffered.

2 years agoTweak how bibtex-mark-entry places point
Lars Ingebrigtsen [Mon, 7 Mar 2022 02:51:55 +0000 (03:51 +0100)]
Tweak how bibtex-mark-entry places point

* lisp/textmodes/bibtex.el (bibtex-mark-entry): Make `C-M-h'
behave like in other modes (with point at the beginning of the
region) (bug#4717).

2 years agoShow SVN status on "." directories, too
Lars Ingebrigtsen [Mon, 7 Mar 2022 02:47:13 +0000 (03:47 +0100)]
Show SVN status on "." directories, too

* lisp/vc/vc-svn.el (vc-svn-after-dir-status): Allow tracking
state of the "." directory, too, since they may have modified
properties (bug#7861).

2 years agoFix `W' in Dired with non-ASCII file names
Lars Ingebrigtsen [Mon, 7 Mar 2022 02:27:55 +0000 (03:27 +0100)]
Fix `W' in Dired with non-ASCII file names

* lisp/net/browse-url.el (browse-url--file-name-coding-system):
Factor out into own function.
(browse-url-file-url): Property encode non-ASCII characters so
that external browsers can understand them.
(browse-url-emacs): Make `W' in Dired work with non-ASCII file
names (bug#54271).

2 years agoUpdate to Org 9.5.2-24-g668205
Kyle Meyer [Mon, 7 Mar 2022 01:18:26 +0000 (20:18 -0500)]
Update to Org 9.5.2-24-g668205

2 years agoGet rid of a loop through all frames when processing events
Po Lu [Mon, 7 Mar 2022 00:53:50 +0000 (08:53 +0800)]
Get rid of a loop through all frames when processing events

* src/xterm.c (handle_one_xevent): Just flip back buffer of f
and any instead.
(flush_dirty_back_buffer_on): New function.
(flush_dirty_back_buffers): Delete function.

2 years agoDisplay complex data types in gdb-mi
Gustaf Waldemarson [Sun, 6 Mar 2022 21:56:04 +0000 (22:56 +0100)]
Display complex data types in gdb-mi

* lisp/progmodes/gdb-mi.el (bindat): Require.
(gdb-invalidate-locals): Use `-stack-list-variables` instead of
the deprecated `-stack-list-locals`. Additionally, this allow
function arguments to be displayed in the locals buffer.
(gdb-locals-values-buffer, gdb-locals-values-buffer-name)
(gdb-locals-simple-values-only, gdb-locals-values-table): New
variables.
(gdb-locals-values-handler-custom): Create a new gdb buffer for
extracting local variable values. To
extract the values for 'complex' data-types, the command
`-stack-list-locals` is used with the `--all-values` flag.

The extracted values are then stored in a hash-table for later use in
the `gdb-locals-handler-custom` that performs the actual update of the
Local variable buffer.

All variable values are filtered to fit it into a single line, being
truncated as necessary by the user customizable option
`gdb-locals-value-limit`.

The old behavior of hiding complex values can be restored using the
customizable `gdb-locals-simple-values-only` option.

Patch amended by William Xu <william.xwl@gmail.com>.

2 years agoFix syntax error in obsolete message function
Lars Ingebrigtsen [Sun, 6 Mar 2022 18:34:54 +0000 (19:34 +0100)]
Fix syntax error in obsolete message function

* lisp/gnus/message.el (message-send-mail-function): Fix syntax error.

2 years agoFix url-interactive-p type
Lars Ingebrigtsen [Sun, 6 Mar 2022 18:02:45 +0000 (19:02 +0100)]
Fix url-interactive-p type

* lisp/url/url-vars.el (url-interactive-pw): Fix typo in previous
checkin (bug#54275).

2 years agoFix problem with fetching images via Cloudflare
Lars Ingebrigtsen [Sun, 6 Mar 2022 16:41:18 +0000 (17:41 +0100)]
Fix problem with fetching images via Cloudflare

* lisp/url/url-http.el (url-http): Factor out url-interactive-p.
* lisp/url/url-auth.el (url-basic-auth):
(url-basic-auth):
(url-digest-prompt-creds): Use it to not query the user.

* lisp/url/url-queue.el (url-queue-start-retrieve): Don't send a
bogus empty Authorization header (bug#54246) -- this triggers
Cloudflare's anti-attack software.  Instead rely on
url-request-noninteractive.

* lisp/url/url-vars.el (url-interactive-p): New utility function.

2 years ago(ecomplete-add-item): Preserve the more complete text
Stefan Monnier [Sun, 6 Mar 2022 15:14:42 +0000 (10:14 -0500)]
(ecomplete-add-item): Preserve the more complete text

Avoid replacing "John Doe <john@doe.ch>" with "john@doe.ch".

* lisp/ecomplete.el (ecomplete-add-item): Keep the longest text

2 years agoRestore call to byte-run-strip-symbol-positions in byte-compile-out
Alan Mackenzie [Sun, 6 Mar 2022 13:37:30 +0000 (13:37 +0000)]
Restore call to byte-run-strip-symbol-positions in byte-compile-out

Also increment a loop counter.  This should fix bug #54248.

* lisp/emacs-lisp/byte-run.el (byte-run--strip-vector/record): increment the
loop counter 'i' in the main loop.

* lisp/emacs-lisp/bytecomp.el (byte-compile-out): call
byte-run-strip-symbol-positions on operands which are one-element lists.

2 years agoDon't accept whitespace or hex floats in rgbi: colour specs
Mattias Engdegård [Sun, 6 Mar 2022 09:50:27 +0000 (10:50 +0100)]
Don't accept whitespace or hex floats in rgbi: colour specs

`color-values-from-color-spec` (new in Emacs 28) erroneously accepted
leading whitespace and hex floats in rgbi: components.

Reported by Philip Kaludercic.

* src/xfaces.c (parse_float_color_comp): Disallow leading whitespace
and hex floats.
* test/src/xfaces-tests.el
(xfaces-internal-color-values-from-color-spec): Add test cases.

2 years agoRespect inhibit-double-buffering on non-toolkit scroll bars
Po Lu [Sun, 6 Mar 2022 13:04:34 +0000 (21:04 +0800)]
Respect inhibit-double-buffering on non-toolkit scroll bars

* src/xfns.c (x_set_inhibit_double_buffering): Force scroll bars
to be re-created on builds without toolkit scroll bars.

* src/xterm.c (x_scroll_bar_create): Don't initialize back
buffer if double buffering is disabled for the frame.

2 years agoSlightly fix mouse-highlight processing on Haiku
Po Lu [Sun, 6 Mar 2022 10:42:33 +0000 (10:42 +0000)]
Slightly fix mouse-highlight processing on Haiku

* src/haikuterm.c (haiku_read_socket): If no corresponding frame
was found for a keyboard event, clear mouse highlight.

2 years agoImplement frame cascading on Haiku
Po Lu [Sun, 6 Mar 2022 07:13:07 +0000 (07:13 +0000)]
Implement frame cascading on Haiku

* haikufns.c (haiku_create_frame): Cascade frame position with
the focused frame if position is not user or programmer
specified.

2 years agoMerge from origin/emacs-28
Stefan Kangas [Sun, 6 Mar 2022 05:32:23 +0000 (06:32 +0100)]
Merge from origin/emacs-28

0090318c61 * lib-src/seccomp-filter.c (main): Use faccessat2 only if ...
3bb01a499b Fix regression in derived-mode-init-mode-variables

2 years agoImplement "window cascading" on NS
Po Lu [Sun, 6 Mar 2022 02:43:25 +0000 (10:43 +0800)]
Implement "window cascading" on NS

* src/nsfns.m (Fx_create_frame): Cascade new frame position if
size hint flags are not USPosition or PPosition.

2 years agoReduce non-toolkit scroll bar flicker
Po Lu [Sun, 6 Mar 2022 02:02:03 +0000 (10:02 +0800)]
Reduce non-toolkit scroll bar flicker

* src/xterm.c (x_scroll_bar_create): Initialize double buffer
for scroll bar.
(x_scroll_bar_set_handle)
(x_scroll_bar_remove, x_scroll_bar_expose): Draw to back buffer
instead.
(x_scroll_bar_end_update): New function.
(x_scroll_bar_clear): Fill the scroll bar with the background
instead when double buffered.
* src/xterm.h (struct scroll_bar): New field `x_drawable'.

2 years agoFix reporting of menu bar wheel events on no toolkit builds
Po Lu [Sun, 6 Mar 2022 00:56:02 +0000 (08:56 +0800)]
Fix reporting of menu bar wheel events on no toolkit builds

* src/xterm.c (x_toolkit_position): Handle menu bar position
on no-toolkit builds.
(x_create_terminal): Always add `toolkit_position_hook'.

2 years agoUse pselect instead of select in nsterm.m
Robert Pluim [Sat, 5 Mar 2022 19:00:09 +0000 (20:00 +0100)]
Use pselect instead of select in nsterm.m

* src/nsterm.m ([EmacsApp fdhandler:]): Use pselect instead of
the single remaining use of select (because we try to avoid using
select directly) (bug#54245).

2 years agoFix emacs-module-test after recent changes
Lars Ingebrigtsen [Sat, 5 Mar 2022 18:06:20 +0000 (19:06 +0100)]
Fix emacs-module-test after recent changes

* test/Makefile.in ($(test_module)): Include libgnu.a in the
module test (because the module uses functions from gnulib)
(bug#32452).

2 years ago* lib-src/seccomp-filter.c (main): Use faccessat2 only if defined.
Andreas Schwab [Sat, 5 Mar 2022 12:44:08 +0000 (13:44 +0100)]
* lib-src/seccomp-filter.c (main): Use faccessat2 only if defined.

2 years agoObey decorator-specified width and height of tooltip frames on Haiku
Po Lu [Sat, 5 Mar 2022 10:20:04 +0000 (10:20 +0000)]
Obey decorator-specified width and height of tooltip frames on Haiku

* src/haiku_support.cc (BWindow_dimensions): New functions.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (Fx_show_tip): Use actual dimensions, because
the decorator might specify a minimum width and height for the
tooltip frame.
* src/haikuterm.c (haiku_update_size_hints): Ignore tooltip
frames.

2 years agoGarbage Haiku tooltip frames on size change
Po Lu [Sat, 5 Mar 2022 06:23:30 +0000 (06:23 +0000)]
Garbage Haiku tooltip frames on size change

* haikuterm.c (haiku_read_socket): If tooltip frame dimensions
actually changed, garbage the frame.

2 years agoFix process-attributes time precision on BSD
Paul Eggert [Sat, 5 Mar 2022 03:21:38 +0000 (19:21 -0800)]
Fix process-attributes time precision on BSD

* src/sysdep.c (timeval_to_timespec) [__FreeBSD__ || DARWIN_OS]:
Remove; no longer needed.
(make_lisp_s_us) [__FreeBSD__ || DARWIN_OS || __OpenBSD__]:
New function.
(make_lisp_timeval) [__FreeBSD__ || DARWIN_OS || __OpenBSD__]:
Rework in terms of make_lisp_s_us.
(system_process_attributes) [__FreeBSD__ || DARWIN_OS ||
__OpenBSD__]: Simplify by using the above.  This fixes some minor
problems where timestamps promised more precision than was
actually available.

2 years agoFix process-attributes time precision on GNU/Linux
Paul Eggert [Sat, 5 Mar 2022 03:21:38 +0000 (19:21 -0800)]
Fix process-attributes time precision on GNU/Linux

* src/sysdep.c [GNU_LINUX]:
(time_from_jiffies): Simplify by using time-convert.  Change args
and result type.  All uses changed.
(ltime_from_jiffies): Remove; call time_from_jiffies instead.
(put_jiffies): New function.
(get_up_time): Return Lisp_Object not struct timespec.
All uses changed.  Simplify by using time-add.
(system_process_attributes): Simplify by using the above.
This fixes some minor problems where timestamps promised more
precision than was actually available.  When info is not
available (e.g., sysconf fails) do not place it into the alist.
* src/timefns.c (float_time): Now extern.