]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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

3 years agoMake connection-local variables user options
Michael Albinus [Mon, 7 Feb 2022 18:32:38 +0000 (19:32 +0100)]
Make connection-local variables user options

* lisp/files-x.el (connection-local-profile-alist)
(connection-local-criteria-alist): Make them user options.

* doc/lispref/variables.texi (Connection Local Variables):
* etc/NEWS: Document this.

3 years agolisp-mnt, checkdoc: Reduce run-time dependencies
Stefan Monnier [Mon, 7 Feb 2022 17:59:27 +0000 (12:59 -0500)]
lisp-mnt, checkdoc: Reduce run-time dependencies

* lisp/emacs-lisp/lisp-mnt.el: Don't require `mail-parse` at top-level.
(lm-crack-address): Require it here instead.

* lisp/emacs-lisp/checkdoc.el (dired): Don't load at run-time.
(checkdoc-dired): Add corresponding `declare-function`.

3 years agoPin lazily read bytecode (bug#53809)
Mattias Engdegård [Mon, 7 Feb 2022 16:36:11 +0000 (17:36 +0100)]
Pin lazily read bytecode (bug#53809)

* src/eval.c (Ffetch_bytecode): Bytecode strings read lazily weren't
pinned as they must be.  Do so.

Bug reported by Gregor Zattler.

3 years ago; * doc/emacs/xresources.texi (Table of Resources): Fix typo.
Po Lu [Mon, 7 Feb 2022 13:39:19 +0000 (21:39 +0800)]
; * doc/emacs/xresources.texi (Table of Resources): Fix typo.

3 years ago; Set show-paren--context-child-frame to nil after deleting it
Tassilo Horn [Mon, 7 Feb 2022 12:37:14 +0000 (13:37 +0100)]
; Set show-paren--context-child-frame to nil after deleting it

3 years agoImprove contrast of `custom-button' in the leuven-dark theme
Po Lu [Mon, 7 Feb 2022 11:59:43 +0000 (19:59 +0800)]
Improve contrast of `custom-button' in the leuven-dark theme

* etc/themes/leuven-dark-theme.el (custom-button): Improve
contrast of custom-button foreground.

3 years ago* lwlib/xlwmenu.c (pop_up_menu): Fix cast.
Po Lu [Mon, 7 Feb 2022 09:48:00 +0000 (17:48 +0800)]
* lwlib/xlwmenu.c (pop_up_menu): Fix cast.

3 years agoCorrect off-by-one errors with frame resizing on Haiku
Po Lu [Mon, 7 Feb 2022 09:43:26 +0000 (09:43 +0000)]
Correct off-by-one errors with frame resizing on Haiku

* src/haiku_support.cc (UnZoom):
(MakeFullscreen):
(BWindow_resize): Fix off-by-one errors in calls to
`BWindow::ResizeTo'.

3 years agoMake menus work better on X toolkit builds with XInput 2
Po Lu [Mon, 7 Feb 2022 08:22:06 +0000 (16:22 +0800)]
Make menus work better on X toolkit builds with XInput 2

* src/xmenu.c (popup_get_selection): Translate some important
XI2 events into events the toolkit can understand.
(x_activate_menubar):
(create_and_show_popup_menu): Clear grab regardless of reported
status on Motif.
* src/xterm.c (xi_device_from_id): Export function.
* src/xterm.h: Update prototypes.

3 years agoSanitize ls switches in ange-ftp (bug#53360)
Michael Albinus [Mon, 7 Feb 2022 09:07:15 +0000 (10:07 +0100)]
Sanitize ls switches in ange-ftp (bug#53360)

* lisp/net/ange-ftp.el (ls-lisp--sanitize-switches): Declare.
(ange-ftp-ls): Sanitize LSARGS.  (Bug#53360)

3 years agoImprove indentation of some shell script forms
Lars Ingebrigtsen [Mon, 7 Feb 2022 08:13:46 +0000 (09:13 +0100)]
Improve indentation of some shell script forms

* lisp/progmodes/sh-script.el (sh-smie--default-backward-token):
Don't skip past things like "true;then" (bug#53817).

3 years agoReally fix extended frame synchronization
Po Lu [Mon, 7 Feb 2022 06:58:32 +0000 (14:58 +0800)]
Really fix extended frame synchronization

* src/xterm.c (XTframe_up_to_date): Make sure the extended
counter ends up even.

3 years ago; Fix previous commit (6e5d79c048)
Tassilo Horn [Mon, 7 Feb 2022 05:52:04 +0000 (06:52 +0100)]
; Fix previous commit (6e5d79c048)

3 years agoFix the Scroll key binding on Windows
Lars Ingebrigtsen [Mon, 7 Feb 2022 03:57:27 +0000 (04:57 +0100)]
Fix the Scroll key binding on Windows

* lisp/bindings.el (global-map): Fix the binding on Windows
(bug#38007).

* lisp/scroll-lock.el (scroll-lock-mode): The event is `scroll' on
Windows, not `Scroll_Lock'.

3 years agoMake the eintr.html target match what's on the web
Lars Ingebrigtsen [Mon, 7 Feb 2022 03:51:06 +0000 (04:51 +0100)]
Make the eintr.html target match what's on the web

* doc/lispintro/Makefile.in (HTML_TARGETS, eintr.html): Make the
name match the URL at
https://www.gnu.org/software/emacs/manual/eintr.html (bug#38817).

3 years agoGive a better error in locate-default-make-command-line
Lars Ingebrigtsen [Mon, 7 Feb 2022 00:59:18 +0000 (01:59 +0100)]
Give a better error in locate-default-make-command-line

* lisp/locate.el (locate-default-make-command-line): Error out
more nicely.

3 years agoImprove the ediff-diff-options documentation
Lars Ingebrigtsen [Mon, 7 Feb 2022 00:38:41 +0000 (01:38 +0100)]
Improve the ediff-diff-options documentation

* lisp/vc/ediff-diff.el (ediff-diff-options):
* doc/misc/ediff.texi (Patch and Diff Programs): Note that setting
this variable directly is probably the wrong thing to do (bug#6512).

3 years agoRespect `x-cursor-fore-pixel' on Haiku
Po Lu [Mon, 7 Feb 2022 03:00:25 +0000 (03:00 +0000)]
Respect `x-cursor-fore-pixel' on Haiku

* src/haikufns.c (haiku_set_cursor_color): Respect
`x-cursor-fore-pixel'.
(syms_of_haikufns): Declare variable `x-cursor-fore-pixel'.

3 years agoClean up more code from PGTK port
Po Lu [Mon, 7 Feb 2022 02:37:08 +0000 (10:37 +0800)]
Clean up more code from PGTK port

* lisp/term/pgtk-win.el (pgtk-disown-selection-internal)
(pgtk-get-selection-internal): Fix declarations for new calling
conventions.
* src/gtkutil.c (xg_frame_set_char_size, x_wm_set_size_hint):
Clean up meaningless variables on PGTK.
* src/pgtkfns.c (Fx_create_frame, syms_of_pgtkfns): Clean up
meaningless variables and fix copied doc strings to use "skip".
* src/pgtkim.c (im_context_commit_cb)
(im_context_retrieve_surrounding_cb)
(im_context_delete_surrounding_cb, make_color_string)
(im_context_preedit_changed_cb, im_context_preedit_end_cb)
(im_context_preedit_start_cb): Fix coding style.
* src/pgtkselect.c (pgtk_selection_usable)
(Fpgtk_disown_selection_internal, Fpgtk_get_selection_internal):
Remove unused arguments.
(syms_of_pgtkselect): Fix doc strings and old style variable
declarations.
* src/pgtkterm.c (x_set_offset, x_set_parent_frame)
(syms_of_pgtkterm): Clean up doc strings and remove meaningless
variables.

3 years ago* doc/emacs/xresources.texi (Table of Resources): Improve wording.
Po Lu [Mon, 7 Feb 2022 01:56:55 +0000 (09:56 +0800)]
* doc/emacs/xresources.texi (Table of Resources): Improve wording.

3 years agoCorrect implementation of extended frame synchronization
Po Lu [Mon, 7 Feb 2022 01:42:08 +0000 (09:42 +0800)]
Correct implementation of extended frame synchronization

* src/xterm.c (handle_one_xevent): Use value provided in the
extended synchronization message as the current counter value.

3 years agoMake dired-directory and dired-subdir-alist buffer-local
Lars Ingebrigtsen [Mon, 7 Feb 2022 00:31:15 +0000 (01:31 +0100)]
Make dired-directory and dired-subdir-alist buffer-local

* lisp/dired.el (dired-directory):
(dired-subdir-alist): Make buffer-local (bug#7118)
(dired-readin):
(dired-mode):
* lisp/dired-x.el (dired-virtual): Adjust usage.
* lisp/locate.el (locate-mode):
* lisp/find-lisp.el (find-lisp-find-dired-internal):
* lisp/find-dired.el (find-dired): Adjust usage.

3 years agoFix eval-tests/backtrace-in-batch-mode test
Stefan Monnier [Mon, 7 Feb 2022 00:20:36 +0000 (19:20 -0500)]
Fix eval-tests/backtrace-in-batch-mode test

* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Fix the
zero-arg case.

3 years agoMake async connect_network_socket failures use Qfailed
Lars Ingebrigtsen [Sun, 6 Feb 2022 23:26:25 +0000 (00:26 +0100)]
Make async connect_network_socket failures use Qfailed

* src/process.c (connect_network_socket): Mark the process as
Qfailed instead of using the error symbol (since this is what's
defined for the status) (bug#53814).

3 years agoRemove outdated comments from ietf-drums.el
Bob Rogers [Sun, 6 Feb 2022 23:08:36 +0000 (00:08 +0100)]
Remove outdated comments from ietf-drums.el

* lisp/mail/ietf-drums.el: Remove outdated comments (bug#53811).

3 years agoansi-color: don't get stuck on \e
Ioannis Kappas [Sun, 6 Feb 2022 22:54:07 +0000 (23:54 +0100)]
ansi-color: don't get stuck on \e

* lisp/ansi-color.el (ansi-color--control-seq-fragment-regexp): New
constant.

* test/lisp/ansi-color-tests.el
(ansi-color-incomplete-sequences-test): Test for \e that doesn't
start a valid ANSI escape sequence (bug#53808).

Code amended (and test code written) by <miha@kamnitnik.top>.  Code by
Ioannis Kappas is small enough to be

Copyright-paperwork-exempt: yes

3 years ago(debug-early-backtrace): Tweak the non-evald output
Stefan Monnier [Sun, 6 Feb 2022 18:06:22 +0000 (13:06 -0500)]
(debug-early-backtrace): Tweak the non-evald output

* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Make the
non-evald output more like what is used in `debug.el`.

3 years ago(debug-early-backtrace): Tweak the non-evald output
Stefan Monnier [Sun, 6 Feb 2022 18:04:35 +0000 (13:04 -0500)]
(debug-early-backtrace): Tweak the non-evald output

* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Make the
non-evald output more like what is used in `debug.el`.

3 years agoUse mode-line-window-selected-p in tab-line-tab-name-format-default.
Juri Linkov [Sun, 6 Feb 2022 17:58:43 +0000 (19:58 +0200)]
Use mode-line-window-selected-p in tab-line-tab-name-format-default.

* lisp/tab-line.el (tab-line-tab-name-format-default):
Use the recently added function 'mode-line-window-selected-p'
for the face 'tab-line-tab-current' (bug#53629).

3 years ago* lisp/tab-bar.el (tab-bar-new-tab-choice): Add const 'window'. Update doc.
Juri Linkov [Sun, 6 Feb 2022 17:55:03 +0000 (19:55 +0200)]
* lisp/tab-bar.el (tab-bar-new-tab-choice): Add const 'window'.  Update doc.

(tab-bar-new-tab-to): Remove window parameters 'window-side' and
'window-atom' from the old window.  Move split-window/delete-window
inside ignore-window-parameters (bug#53662).

3 years agoAdapt em-tramp-tests.el
Michael Albinus [Sun, 6 Feb 2022 17:50:16 +0000 (18:50 +0100)]
Adapt em-tramp-tests.el

* test/lisp/eshell/em-tramp-tests.el (tramp): Require.
(em-tramp-test/su-default, em-tramp-test/su-user)
(em-tramp-test/su-login, em-tramp-test/sudo-basic)
(em-tramp-test/sudo-user): Adapt tests.

3 years agoAvoid deprecation warning in NS-specific code
Mattias Engdegård [Sun, 6 Feb 2022 16:58:54 +0000 (17:58 +0100)]
Avoid deprecation warning in NS-specific code

* src/macfont.m (mac_font_create_preferred_family_for_attributes):
CTGetCoreTextVersion is obsolete and its use elicits a warning
in macOS 11.6; use NSProcessInfo instead.

3 years ago; * src/alloc.c (mark_memory): Fix outdated comment.
Mattias Engdegård [Sun, 6 Feb 2022 16:57:46 +0000 (17:57 +0100)]
; * src/alloc.c (mark_memory): Fix outdated comment.

3 years agoEnsure bar cursors are always visible on Haiku
Po Lu [Sun, 6 Feb 2022 13:08:06 +0000 (13:08 +0000)]
Ensure bar cursors are always visible on Haiku

* src/haikuterm.c (haiku_draw_window_cursor): Adjust bar cursor
colors like X.

3 years agoFix the GTK 2 build
Po Lu [Sun, 6 Feb 2022 12:10:46 +0000 (20:10 +0800)]
Fix the GTK 2 build

* src/gtkutil.c (xg_filter_key): Remove call to GTK3-only
function without GTK 3.
* src/xfns.c (select_visual): Avoid 32-bit visuals on GTK 2.

3 years agoDisable extended frame synchronization by default
Po Lu [Sun, 6 Feb 2022 11:51:05 +0000 (19:51 +0800)]
Disable extended frame synchronization by default

* doc/emacs/xresources.texi (Table of Resources): Document
new possible value of `synchronizeResize'.
* src/xfns.c (Fx_create_frame): Set synchronization protocol
according to `synchronizeResize'.

3 years agoAdd support for EWMH extended frame synchronization
Po Lu [Sun, 6 Feb 2022 10:53:22 +0000 (18:53 +0800)]
Add support for EWMH extended frame synchronization

* src/xfns.c (Fx_create_frame): Populate both counter variables.
* src/xterm.c (XTframe_up_to_date):
(handle_one_xevent): Support extended synchronization.
(x_free_frame_resources): Destroy extended counter.
(x_term_init): Intern new atom _NET_WM_FRAME_DRAWN.

* src/xterm.h (struct x_display_info): New atom
`_NET_WM_FRAME_DRAWN'.
(struct x_output): New fields for extended counter tracking.
(FRAME_X_EXTENDED_COUNTER): New macro.

3 years ago; * etc/NEWS: Fix entry for 'find-library-include-other-files'.
Eli Zaretskii [Sun, 6 Feb 2022 10:34:14 +0000 (12:34 +0200)]
; * etc/NEWS: Fix entry for 'find-library-include-other-files'.

3 years agoFix infloop in 'redisplay_window' when buffer is narrowed
Eli Zaretskii [Sun, 6 Feb 2022 10:26:36 +0000 (12:26 +0200)]
Fix infloop in 'redisplay_window' when buffer is narrowed

* src/xdisp.c (redisplay_window): Ensure window-start point is in
the accessible portion of the buffer when passing it to
'window_start_acceptable_p'.  (Bug#14582)

3 years agoDisplay show-paren-context-when-offscreen in child frame
Tassilo Horn [Sun, 6 Feb 2022 10:10:08 +0000 (11:10 +0100)]
Display show-paren-context-when-offscreen in child frame

* etc/NEWS: Extend section about the new
`show-paren-context-when-offscreen' custom option.
* lisp/paren.el (show-paren-context-when-offscreen): Allow special
value `child-frame'.
(show-paren-function): Handle `child-frame' value of
`show-paren-context-when-offscreen'.
(show-paren--context-child-frame): New defvar.
(show-paren--context-child-frame-redirect-focus): New function.
(show-paren--context-child-frame-buffer): New function.
(show-paren--context-child-frame-parameters): New defvar.
(show-paren--delete-context-child-frame): New function.
(show-paren--show-context-in-child-frame): New function.

3 years agoMake usage of su and sudo consistent in eshell (bug#53783)
Michael Albinus [Sun, 6 Feb 2022 08:43:13 +0000 (09:43 +0100)]
Make usage of su and sudo consistent in eshell (bug#53783)

* lisp/eshell/em-tramp.el (eshell/su, eshell/sudo):
Use `tramp-default-host' instead of "localhost".

3 years agoMerge from origin/emacs-28
Stefan Kangas [Sun, 6 Feb 2022 05:49:39 +0000 (06:49 +0100)]
Merge from origin/emacs-28

821c240075 Fix ietf-drums-get-comment doc string
638247baa4 Fix typo in display.texi

3 years ago* lwlib/xlwmenu.c (pop_up_menu): Work around motion problems on XI2.
Po Lu [Sun, 6 Feb 2022 05:40:21 +0000 (13:40 +0800)]
* lwlib/xlwmenu.c (pop_up_menu): Work around motion problems on XI2.

3 years ago; * src/xfns.c (x_encode_text): Fix comment.
Po Lu [Sun, 6 Feb 2022 03:28:29 +0000 (11:28 +0800)]
; * src/xfns.c (x_encode_text): Fix comment.

3 years agoAdd ietf-drums tests, fix parse-address decoding
Bob Rogers [Sun, 6 Feb 2022 03:07:51 +0000 (04:07 +0100)]
Add ietf-drums tests, fix parse-address decoding

* test/lisp/mail/ietf-drums-tests.el (ietf-drums-tests):  Test most of
lisp/mail/ietf-drums.el functionality.
* lisp/mail/ietf-drums.el: (ietf-drums-parse-address): Bug fix:
Require rfc2047 when needed (bug#53811).

3 years agoAllow disabling frame resize synchronization
Po Lu [Sun, 6 Feb 2022 02:43:38 +0000 (10:43 +0800)]
Allow disabling frame resize synchronization

* doc/emacs/xresources.texi (Table of Resources): Document new
parameter `synchronizeResize'.
* etc/NEWS: Announce frame resize synchronization.
* src/xterm.c (x_term_init): Don't enable XSync if the
X resource `synchronizeResize' is off or false.

3 years agoClean up lots of #ifdef'd out code in PGTK files
Po Lu [Sun, 6 Feb 2022 01:18:59 +0000 (09:18 +0800)]
Clean up lots of #ifdef'd out code in PGTK files

Most of them are either relics from X or from the NS code
pgtkfns.c was copied from whole.

* src/pgtkfns.c (x_icon):
(pgtk_set_scroll_bar_foreground):
(pgtk_set_scroll_bar_background):
(Fx_create_frame):
(pgtk_window_is_ancestor):
(x_create_tip_frame):
* src/pgtkselect.c (syms_of_pgtkselect):
* src/pgtkterm.c (pgtk_iconify_frame):
(x_set_frame_alpha):
(button_event): Remove defined out code that cannot make sense.

* src/pgtkmenu.c (show_help_event): Remove ifdef'd out code and
reword comment.

3 years agoHandle window state changes on PGTK
Po Lu [Sun, 6 Feb 2022 00:58:23 +0000 (08:58 +0800)]
Handle window state changes on PGTK

* src/pgtkterm.c (window_state_event): Set fullscreen, sticky,
and iconification status according to the new window state.
(bug#53793)

3 years agoMinor changes to xsync support
Po Lu [Sun, 6 Feb 2022 00:39:02 +0000 (08:39 +0800)]
Minor changes to xsync support

* src/xfns.c (append_wm_protocols): Don't append
_NET_WM_SYNC_REQUEST unless the display supports our version of
XSync.

* src/xterm.c (handle_one_xevent): Don't handle
_NET_WM_SYNC_REQUEST unless the display supports that.
(x_free_frame_resources): Test basic counter against None.

3 years agoFix ietf-drums-get-comment doc string
Bob Rogers [Sun, 6 Feb 2022 00:07:43 +0000 (01:07 +0100)]
Fix ietf-drums-get-comment doc string

* lisp/mail/ietf-drums.el (ietf-drums-get-comment):  We really return
the last comment (bug#53810).

3 years agoImprove the elp-instrument-package doc string
Lars Ingebrigtsen [Sun, 6 Feb 2022 00:00:04 +0000 (01:00 +0100)]
Improve the elp-instrument-package doc string

* lisp/emacs-lisp/elp.el (elp-instrument-package): Note the effect
of loading further files (bug#13252).

3 years agoFix reverting the default face to standard/themed state in GUIs
Mauro Aranda [Sat, 5 Feb 2022 23:38:40 +0000 (00:38 +0100)]
Fix reverting the default face to standard/themed state in GUIs

* lisp/cus-edit.el (custom-face-set, custom-face-mark-to-save)
(custom-face-save): Record the default (standard or themed) attributes
of the default face in a symbol property.
(custom-face-reset-saved, custom-face-mark-to-reset-standard): When
reverting the default face to the standard or themed state, use the
default attributes we recorded, instead of relying in the defface spec
of the default face, since that doesn't give enough information to
reset all attributes, like foreground, family, etc (bug#14635).

3 years agoAdd new user option 'find-library-include-other-files'
Lars Ingebrigtsen [Sat, 5 Feb 2022 23:29:33 +0000 (00:29 +0100)]
Add new user option 'find-library-include-other-files'

* lisp/emacs-lisp/find-func.el (read-library-name--find-files):
New function (bug#15735).
(read-library-name): Use it.
(find-library-include-other-files): New user option.

3 years agoTweak how eshell/cd works when cd-ing to ".." from "/"
Lars Ingebrigtsen [Sat, 5 Feb 2022 22:57:38 +0000 (23:57 +0100)]
Tweak how eshell/cd works when cd-ing to ".." from "/"

* lisp/eshell/em-dirs.el (eshell/cd): Make "cd .." from "/" less
confusing (bug#16861).

3 years agoAdd a :distant-foreground to the lazy-highlight face
Lars Ingebrigtsen [Sat, 5 Feb 2022 22:46:02 +0000 (23:46 +0100)]
Add a :distant-foreground to the lazy-highlight face

* lisp/isearch.el (lazy-highlight): Add a :distant-foreground
colour so that the text is always legible (bug#16969).

3 years agoAdd new function mode-line-window-selected-p
Lars Ingebrigtsen [Sat, 5 Feb 2022 21:46:08 +0000 (22:46 +0100)]
Add new function mode-line-window-selected-p

* doc/lispref/modes.texi (Mode Line Basics): Mention it (bug#53629).
* lisp/bindings.el (mode-line-window-selected-p): New function
from martin rudalics <rudalics@gmx.at>.

3 years agoFix typo in display.texi
Daniel Martín [Sat, 5 Feb 2022 20:03:21 +0000 (21:03 +0100)]
Fix typo in display.texi

* doc/lispref/display.texi (Making Buttons): Fix typo.  (Bug#53807)

3 years agoAdapt Tramp to changed unload behavior (bug#53632)
Michael Albinus [Sat, 5 Feb 2022 18:17:47 +0000 (19:17 +0100)]
Adapt Tramp to changed unload behavior (bug#53632)

* test/lisp/net/tramp-tests.el (tramp-test47-unload): Check also
for autoloaded macros.  Respect `tramp-autoload' function property.

3 years agoAdd support for basic syncing with the window manager on resize
Po Lu [Sat, 5 Feb 2022 13:43:00 +0000 (21:43 +0800)]
Add support for basic syncing with the window manager on resize

This is handled by GTK 3, so the code is disabled on that
specific build.  On other builds, this eliminates any unexposed
part of a frame from showing up after a resize when
`frame-resize-pixelwise' is t.

* configure.ac: Check for the X Synchronization Extension if
present.
* src/Makefile.in (EMACS_CFLAGS):
(LIBES): Add XSYNC_LIBS and XSYNC_CFLAGS.

* src/xfns.c (append_wm_protocols): Declare
`_NET_WM_SYNC_REQUEST' support if appropriate.
(x_window): Adjust location of call to `append_wm_protocols' on
Xt version to prevent it from being overwritten.
(Fx_create_frame): Create basic counter.
* src/xterm.c (XTframe_up_to_date): Set counter value to the one
asked for by the window manager.
(handle_one_xevent): Handle _NET_WM_SYNC_REQUEST.
(x_free_frame_resources): Free frame counter if present.
(x_term_init): Test for XSync and set fields accordingly.
* src/xterm.h (struct x_display_info): New fields for XSync
support and new atoms.
(struct x_output): New fields for counter status.
(FRAME_X_BASIC_COUNTER): New macro.

3 years ago* lisp/pixel-scroll.el: Update commentary.
Po Lu [Sat, 5 Feb 2022 11:48:23 +0000 (19:48 +0800)]
* lisp/pixel-scroll.el: Update commentary.

3 years agoFix 'current-column' in the presence of display strings
Eli Zaretskii [Sat, 5 Feb 2022 11:01:24 +0000 (13:01 +0200)]
Fix 'current-column' in the presence of display strings

* src/indent.c (check_display_width): Support calculation of width
of 'display' properties whose values are strings.  This fixes the
value returned by 'current-column' when display strings are
present between BOL and point.  (Bug#53795)

3 years ago* lisp/emacs-lisp/debug-early.el: Improve the documentation
Alan Mackenzie [Sat, 5 Feb 2022 10:43:27 +0000 (10:43 +0000)]
* lisp/emacs-lisp/debug-early.el: Improve the documentation

3 years agoRemove superfluous `font-lock-add-keywords' calls in Tramp
Michael Albinus [Sat, 5 Feb 2022 10:30:20 +0000 (11:30 +0100)]
Remove superfluous `font-lock-add-keywords' calls in Tramp

* lisp/net/tramp.el (with-parsed-tramp-file-name)
(with-tramp-progress-reporter, with-tramp-file-property)
(with-tramp-connection-property, with-tramp-locked-connection):
* lisp/net/tramp-gvfs.el (with-tramp-dbus-call-method)
(with-tramp-dbus-get-all-properties): Do not call
`font-lock-add-keywords' for macros, it isn't needed anymore.

3 years agoAdapt Tramp to changed unload behavior (bug#53632)
Michael Albinus [Sat, 5 Feb 2022 10:12:17 +0000 (11:12 +0100)]
Adapt Tramp to changed unload behavior (bug#53632)

* lisp/net/tramp.el (tramp-autoload-file-name-handler)
(tramp-register-autoload-file-name-handlers)
(tramp-unload-file-name-handlers, tramp-unload-tramp):
* lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-regexp)
(tramp-archive-autoload-file-name-handler)
(tramp-register-archive-file-name-handler):
Add `tramp-autoload' function property.

3 years agoFix yank-media utf-16 detection
Lars Ingebrigtsen [Sat, 5 Feb 2022 07:50:05 +0000 (08:50 +0100)]
Fix yank-media utf-16 detection

* lisp/yank-media.el (yank-media--utf-16-p): Factor out into its
own function for easier testing and fix the code.

3 years agoImprove the selected-window doc string
Lars Ingebrigtsen [Sat, 5 Feb 2022 07:07:18 +0000 (08:07 +0100)]
Improve the selected-window doc string

* src/window.c (Fselected_window): Add some pointers to other
functions in this area.

3 years agoEnsure that the CAR of 'eshell-last-async-procs' always points to a process
Jim Porter [Sat, 5 Feb 2022 06:41:39 +0000 (22:41 -0800)]
Ensure that the CAR of 'eshell-last-async-procs' always points to a process

Previously, if a non-process was piped to a process, this could end up
being nil, which isn't correct.  'eshell-last-async-procs' should just
ignore non-process commands in a pipeline.

* lisp/eshell/esh-cmd.el (eshell-do-pipelines): Set 'headproc'
correctly.

* test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc): New test.

3 years agoRemove kerning escapes in woman mode
Brendan O'Dea [Sat, 5 Feb 2022 06:51:03 +0000 (07:51 +0100)]
Remove kerning escapes in woman mode

* lisp/woman.el (woman-decode-region): Remove kerning escapes
(bug#53770).

Copyright-paperwork-exempt: yes

3 years agoImprove the Archive file names tramp documentation
Lars Ingebrigtsen [Sat, 5 Feb 2022 06:26:24 +0000 (07:26 +0100)]
Improve the Archive file names tramp documentation

* doc/misc/tramp.texi (Archive file names): Explicitly say how to
open an archive with Tramp (bug#25076).

3 years agoFix yank-media-types--format decoding
Lars Ingebrigtsen [Sat, 5 Feb 2022 06:00:50 +0000 (07:00 +0100)]
Fix yank-media-types--format decoding

* lisp/yank-media.el (yank-media-types--format): Check that we
really have some nuls.

3 years agoFinish up cursor color merging on Haiku
Po Lu [Sat, 5 Feb 2022 05:08:00 +0000 (05:08 +0000)]
Finish up cursor color merging on Haiku

* src/haikuterm.c (haiku_draw_text_decoration):
(haiku_draw_plain_background):
(haiku_draw_stretch_glyph_string):
(haiku_merge_cursor_foreground): Use merged cursor colors.

3 years agoFix last change to ftcrfont.c
Po Lu [Sat, 5 Feb 2022 03:20:45 +0000 (03:20 +0000)]
Fix last change to ftcrfont.c

* src/ftcrfont.c (ftcrfont_draw): Remove relic `face' variable
and use s->face instead.

3 years agoImplement face cursor color merging on Haiku
Po Lu [Sat, 5 Feb 2022 03:17:58 +0000 (03:17 +0000)]
Implement face cursor color merging on Haiku

* src/ftcrfont.c (ftcrfont_draw):
* src/haikufont.c (haikufont_draw): Use
`haiku_merge_cursor_foreground' to calculate cursor HL colors.
* src/haikuterm.c (haiku_merge_cursor_foreground): New function.
* src/haikuterm.h: Update prototypes.

3 years agoSet WM_TRANSIENT_FOR on tooltip frames
Po Lu [Sat, 5 Feb 2022 02:51:39 +0000 (10:51 +0800)]
Set WM_TRANSIENT_FOR on tooltip frames

Otherwise the decorations get all messed up on GNOME and some
other composited desktops.

* src/xfns.c (Fx_show_tip): Set WM_TRANSIENT_FOR to the window
underneath the tooltip.

3 years agoImplement _NET_WM_PING protocol
Po Lu [Sat, 5 Feb 2022 01:41:01 +0000 (09:41 +0800)]
Implement _NET_WM_PING protocol

* src/xfns.c (append_wm_protocols): New function.
(x_window): Call `append_wm_protocols' after window creation.
* src/xterm.c (handle_one_xevent): Handle _NET_WM_PING client
messages.
(x_term_init): Intern _NET_WM_PING atom.
* src/xterm.h (struct x_display_info): New field
`Xatom_net_wm_ping'.

3 years agoUpdate the MULTIPLE property with conversion outcomes
Vladimir Panteleev [Fri, 4 Feb 2022 02:46:50 +0000 (02:46 +0000)]
Update the MULTIPLE property with conversion outcomes

Per the ICCCM spec:

> If the owner fails to convert the target named by an atom in the
> MULTIPLE property, it should replace that atom in the property with
> None.

* src/xselect.c (x_handle_selection_request): Do it.

3 years agoDo not delete the MULTIPLE property after reading it
Vladimir Panteleev [Fri, 4 Feb 2022 01:54:45 +0000 (01:54 +0000)]
Do not delete the MULTIPLE property after reading it

Per the ICCCM spec:

> The requestor should delete [...] the property specified in the
> MULTIPLE request when it has copied all the data.

We are not the requestor, so we should not be deleting this property
(which is what x_get_window_property_as_lisp_data does).  The property
needs to remain available as the requestor will generally want to read
it back to see which conversions succeeded or not.

* src/xselect.c (x_get_window_property_as_lisp_data): Add flag which
skips deleting the read property, or handling INCR (which does not
make sense for MULTIPLE).
(x_handle_selection_request): Enable the flag.

3 years ago(with-demoted-errors): Warn on missing `format` arg
Stefan Monnier [Sat, 5 Feb 2022 00:39:53 +0000 (19:39 -0500)]
(with-demoted-errors): Warn on missing `format` arg

The `format` arg has been mandatory for a while, but the backward
compatibility code that handled the case of a missing `format` arg
made it hard to notice when using the old calling convention.

* lisp/subr.el (with-demoted-errors): Warn on missing `format` arg.

* lisp/emacs-lisp/smie.el (smie-indent--separator-outdent): Don't abuse
`with-demoted-errors`.
(smie-indent-line, smie-auto-fill):
* test/lisp/emacs-lisp/ert-tests.el (ert-test-with-demoted-errors):
* lisp/vc/vc-hooks.el (vc-refresh-state):
* lisp/vc/vc-annotate.el (vc-annotate-background-mode):
* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk):
* lisp/textmodes/reftex-toc.el (reftex-re-enlarge):
* lisp/progmodes/sh-script.el (sh-smie-sh-rules):
* lisp/progmodes/octave.el (inferior-octave-startup):
* lisp/pcmpl-gnu.el (pcmpl-gnu-make-all-targets):
* lisp/org/org-refile.el (org-refile):
* lisp/org/org-capture.el (org-capture-store-last-position):
* lisp/nxml/nxml-mode.el (nxml-mode):
* lisp/notifications.el (notifications-notify):
* lisp/gnus/mm-view.el (mm-display-inline-fontify):
* lisp/finder.el (finder-unload-function):
* lisp/files.el (safe-local-variable-p, backup-buffer-copy
* lisp/autorevert.el (auto-revert-notify-handler):
Pass `format` arg to `with-demoted-errors`.

3 years agopython.el: Silence left over warning in last commit
Stefan Monnier [Fri, 4 Feb 2022 18:39:19 +0000 (13:39 -0500)]
python.el: Silence left over warning in last commit

* lisp/progmodes/python.el
(python-shell-calculate-process-environment): Declare
tramp-remote-process-environment before using it.

3 years agopython.el: Try and better split the Tramp code
Stefan Monnier [Fri, 4 Feb 2022 18:35:21 +0000 (13:35 -0500)]
python.el: Try and better split the Tramp code

Massage the Python-Tramp code so that the Tramp part and the Python
part are a bit less intertwined.  It's still not quite right, but it's
a bit closer to the point where the Tramp part can be moved to `tramp.el`.

* lisp/progmodes/python.el: Don't require `tramp-sh`.
Do require `subr-x` OTOH.  Remove redundant `:group`s.
(python-shell--calculate-process-environment): New function, that only
return the entries to be added.
(python-shell-calculate-process-environment): Rewrite and declare obsolete.
(python-shell-tramp-refresh-remote-path)
(python-shell-tramp-refresh-process-environment): Silence
compiler warnings.
(python-shell-with-environment): Move the bulk of its code to
a new function `python-shell--with-environment` for easier debugging
and to avoid code duplication.
(python-shell--with-environment): New function.  Split the Tramp case
into its own function.
(python-shell--tramp-with-environment): New function.
(python-eldoc-function-timeout-permanent): Fix doc's first line.

* test/lisp/progmodes/python-tests.el: Adjust accordingly.
(python-shell-calculate-process-environment-1)
(python-shell-calculate-process-environment-2)
(python-shell-calculate-process-environment-3)
(python-shell-calculate-process-environment-4)
(python-shell-calculate-process-environment-5)
(python-shell-calculate-process-environment-6)
(python-shell-calculate-process-environment-7)
(python-shell-calculate-process-environment-8):
Use `python-shell--calculate-process-environment`.
(python--tests-process-env-canonical, python--tests-process-env-eql):
New functions.
(python-shell-with-environment-2, python-shell-with-environment-3):
Use them.

3 years agoImprove Tramp tests backward compatibility
Michael Albinus [Fri, 4 Feb 2022 18:24:43 +0000 (19:24 +0100)]
Improve Tramp tests backward compatibility

* test/lisp/net/tramp-tests.el (tramp-test39-detect-external-change):
Improve backward compatibility.

3 years ago* Have `null' and `not' explicit in LIMPLE so we inline them
Andrea Corallo [Fri, 4 Feb 2022 14:45:42 +0000 (15:45 +0100)]
* Have `null' and `not' explicit in LIMPLE so we inline them

* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Generate explicit
`eq' call in LIMPLE for LAP opcode 'not'.

3 years agoFix infloop in redisplay_window due to fix of bug#14582
Eli Zaretskii [Fri, 4 Feb 2022 13:50:50 +0000 (15:50 +0200)]
Fix infloop in redisplay_window due to fix of bug#14582

* src/xdisp.c (window_start_acceptable_p): New function.
(redisplay_window): Call 'window_start_acceptable_p' to determine
whether a given window-start point is acceptable, including when
the window's force_start flag is set -- this fixes infloop in
redisplay_window in that case.

3 years agoRemove misleading "in current buffer" message from auto-raise-mode
Po Lu [Fri, 4 Feb 2022 13:22:03 +0000 (21:22 +0800)]
Remove misleading "in current buffer" message from auto-raise-mode

* lisp/frame.el (auto-raise-mode): Declare as global to prevent
a misleading message from being displayed.  It's actually
frame-local, but declaring it global doesn't hurt since
`frame-parameter' is a gv.

3 years agoSilence byte-compiler in two tests
Stefan Kangas [Fri, 4 Feb 2022 13:15:33 +0000 (14:15 +0100)]
Silence byte-compiler in two tests

* test/lisp/electric-tests.el (electric-pair-define-test-form):
* test/src/buffer-tests.el (buffer-tests--make-test-name): Silence
byte-compiler by defining defuns also at run time.

3 years ago; * src/haikuterm.c (haiku_end_cr_clip): Fix trivial typo.
Po Lu [Fri, 4 Feb 2022 12:12:56 +0000 (12:12 +0000)]
; * src/haikuterm.c (haiku_end_cr_clip): Fix trivial typo.

3 years agoImplement auto-raise on Haiku
Po Lu [Fri, 4 Feb 2022 12:10:30 +0000 (12:10 +0000)]
Implement auto-raise on Haiku

* src/haikuterm.c (haiku_read_socket): Implement auto-raising
of frames that have that parameter set.

3 years ago* lisp/net/tramp-gvfs.el (tramp-gvfs-send-command): Fix problem with locale.
Michael Albinus [Fri, 4 Feb 2022 10:59:56 +0000 (11:59 +0100)]
* lisp/net/tramp-gvfs.el (tramp-gvfs-send-command): Fix problem with locale.

3 years ago; * src/xterm.c (x_alloc_nearest_color_1): Remove extraneous code.
Po Lu [Fri, 4 Feb 2022 07:39:45 +0000 (15:39 +0800)]
; * src/xterm.c (x_alloc_nearest_color_1): Remove extraneous code.

3 years agoFix bit rot in the color allocation code
Po Lu [Fri, 4 Feb 2022 07:38:07 +0000 (15:38 +0800)]
Fix bit rot in the color allocation code

* src/xterm.c (x_alloc_nearest_color_1): Reintroduce an older
version of the code that would try to allocate a "compromise
delta".

3 years ago* src/xwidget.c (xwidget_button): Always let button events through.
Po Lu [Fri, 4 Feb 2022 07:17:40 +0000 (15:17 +0800)]
* src/xwidget.c (xwidget_button): Always let button events through.

Filtering out emulated events is done in handle_one_xevent, so
all this accomplishes is to filter out legitimate button events.

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

0591aa6cd3 Revert an erroneous change in tramp-cache.el

3 years agoFix toggling `x-gtk-use-native-input'.
Po Lu [Fri, 4 Feb 2022 05:13:06 +0000 (13:13 +0800)]
Fix toggling `x-gtk-use-native-input'.

* lisp/term/x-win.el (x-internal-focus-input-context):
(x-gtk-use-native-input-watcher): Update for changes to
`x-internal-focus-input-context'.

* src/xfns.c (Fx_internal_focus_input_context): New parameter
`focus'.

3 years agoMake Emacs build with some other XLib implementations
Po Lu [Fri, 4 Feb 2022 03:28:05 +0000 (03:28 +0000)]
Make Emacs build with some other XLib implementations

* configure.ac (HAVE_XKB): Check for functions that aren't
always implemented by various XLib implementations.

* src/xfns.c (select_visual): Handle NULL values of vinfo.
(XkbRefreshKeyboardMapping):
(XkbFreeNames):
(XDisplayCells):
(XDestroySubwindows): Define replacement functions where they
aren't available.

* src/xterm.c (x_find_modifier_meanings): Handle NULL values of
various fields.

3 years ago* src/xfns.c (Fx_internal_focus_input_context): Fix typo.
Po Lu [Fri, 4 Feb 2022 02:16:14 +0000 (10:16 +0800)]
* src/xfns.c (Fx_internal_focus_input_context): Fix typo.

3 years agoMake `x-gtk-use-native-input' take effect immediately
Po Lu [Fri, 4 Feb 2022 02:11:31 +0000 (10:11 +0800)]
Make `x-gtk-use-native-input' take effect immediately

* lisp/term/x-win.el (x-internal-focus-input-context): New
declaration.
(x-gtk-use-native-input-watcher): New variable watcher.
* src/xfns.c (Fx_internal_focus_input_context): New function.
(syms_of_xfns): Define new subr.

3 years agoTry to fix input method flicker on GTK builds
Po Lu [Fri, 4 Feb 2022 01:04:06 +0000 (09:04 +0800)]
Try to fix input method flicker on GTK builds

* src/xterm.c (x_focus_changed): Only focus GTK context if
native input is on.  (bug#53698)