Paul Eggert [Mon, 4 Jul 2022 21:21:35 +0000 (16:21 -0500)]
Fix core dump with x-get-local-selection
* src/xselect.c (Fx_get_local_selection): Check that VALUE has 4
elements, since x_get_local_selection can dump core otherwise.
This pacifies gcc -Wanalyzer-null-dereference, which found the
problem.
Stefan Kangas [Mon, 4 Jul 2022 12:10:04 +0000 (14:10 +0200)]
Remove remaining Helper-help support from view-mode
* lisp/view.el (view-old-Helper-return-blurb): Make obsolete.
(view--enable, view--disable): Delete remaining Helper-help support
code; view-mode stopped using it in 1995.
Eli Zaretskii [Mon, 4 Jul 2022 11:59:58 +0000 (14:59 +0300)]
; Fix documentation of 'file-parent-directory'
* doc/lispref/files.texi (Directory Names):
* lisp/files.el (file-parent-directory): Improve wording of the
documentation of 'file-parent-directory'. (Bug#56355)
* lisp/thumbs.el (thumbs-call-convert): Pass 'action-prefix' and
'action' as a combined parameter. Do not pass 'arg' if it is nil.
(thumbs-modify-image): Do not pass "" as 'arg' to
'thumbs-call-convert' (bug#56375).
Some time in the past this was converted from using the shell to
passing the parameters directly, but the fallout was not handled
correctly.
Stefan Kangas [Mon, 4 Jul 2022 10:12:45 +0000 (12:12 +0200)]
New command help-fns-edit-mode-cancel
* lisp/help-fns.el (help-fns-edit-mode-cancel): New command.
(help-fns--edit-value-mode-map): Bind it to 'C-c C-k'.
(help-fns-edit-variable): Advertise it in help text.
Po Lu [Mon, 4 Jul 2022 05:41:20 +0000 (13:41 +0800)]
Always wait for XdndStatus before sending XdndDrop
* src/xterm.c (x_dnd_do_drop): New function.
(x_dnd_begin_drag_and_drop): Clear new flag.
(handle_one_xevent): Use that function; send drops upon receipt
of pending XdndStatus, to avoid race conditions where we don't
yet know the selected action.
Po Lu [Mon, 4 Jul 2022 03:32:05 +0000 (11:32 +0800)]
Display list of traps and handlers when crashing due to an X error
* src/xterm.c (x_connection_closed): Print list of installed
error handlers if not crashing due to an IO error.
(NO_INLINE): Include error serial in error message.
Florian Rommel [Fri, 3 Jun 2022 01:03:03 +0000 (03:03 +0200)]
Add support for fullscreen values fullheight and fullwidth on PGTK
* src/pgtkterm.c (window_state_event): Support values fullheight and
fullwidth for the fullscreen frame-parameter
* doc/lispref/frames.texi (Size Parameters): Document inability to
actively set hullheight/fullwidth for PGTK frames
* configure.ac: Bump GTK version for PGTK
* etc/NEWS: Change GTK version in PGTK announcement
Juri Linkov [Sun, 3 Jul 2022 17:00:11 +0000 (20:00 +0300)]
* lisp/mwheel.el: More fixes for global-text-scale (bug#48307)
(mouse-wheel-global-text-scale): Move down closer to mouse-wheel-text-scale.
(mouse-wheel-scroll-amount): Add :value global-text-scale and mention it
in the docstring.
(mouse-wheel-global-text-scale, mouse-wheel--setup-bindings):
Add mouse-wheel-down-alternate-event and mouse-wheel-up-alternate-event.
Allow a list of modifiers for 'text-scale'.
Stefan Monnier [Sun, 3 Jul 2022 15:12:45 +0000 (11:12 -0400)]
lisp/elec-pair.el: Simplify last change
* lisp/elec-pair.el (electric-pair--with-syntax):
Rename from `electric-pair--with-text-syntax`.
Make `start` mandatory. Run `body` in the normal syntax if `start` is nil.
(electric-pair--with-syntax-1): New function, extracted from
`electric-pair--with-text-syntax`.
(electric-pair-syntax-info, electric-pair--balance-info):
Adjust calls accordingly.
Stefan Kangas [Sun, 3 Jul 2022 12:40:21 +0000 (14:40 +0200)]
Improve navigation keybindings in emacs-news-mode
* lisp/textmodes/emacs-news-mode.el (emacs-news-common-map): New
defvar-keymap. Bind navigation commands as in 'org-mode' and
'outline-minor-mode'.
(emacs-news-mode-map): Inherit from 'emacs-news-common-map'.
(emacs-news-view-mode-map): New defvar-keymap; inherit from
'emacs-news-common-map'.
Eli Zaretskii [Sun, 3 Jul 2022 12:37:50 +0000 (15:37 +0300)]
Fix implementation of 'reset' face values
* src/xfaces.c (Finternal_merge_in_global_face)
(gui_supports_face_attributes_p): Only modify local copy of face
attributes when replacing 'reset' pseudo-values with real values.
(Bug#38771)
Fix `python-nav-beginning-of-defun' line continuation using backslash
* lisp/progmodes/python.el (python-nav--beginning-of-defun): Allow
line continuation using backslash in defuns (bug#55702).
(python-info-looking-at-beginning-of-defun): Add CHECK-STATEMENT
argument.
Make string-limit with encoding return complete glyphs
* lisp/emacs-lisp/subr-x.el (string-limit): Return more correct
results in the CODING-SYSTEM case for coding systems with BOM and
charset designations (bug#48324). Also amend the algorithm to
return complete glyphs, not just complete code points.
* lisp/gnus/nnimap.el (nnimap-retrieve-headers): Don't stream the
UID FETCH commands, since the server may return the results
out-of-order (bug#56332).
* lisp/elec-pair.el (electric-pair--with-text-syntax): New macro.
(electric-pair-syntax-info):
(electric-pair--balance-info):
(electric-pair--syntax-ppss, electric-pair--balance-info): Use it.
(electric-pair--with-uncached-syntax): Remove (bug#49629).
The main bug that this is fixing is `syntax-propertize-function' being
hidden in `electric-pair--balance-info' when the original syntax table
is to be used, not `electric-pair-text-syntax-table'.
Notably, this causes `electric-pair-mode' to often misbehave in HTML
files when pairing angle brackets.
This commit also flushes the cache before installing
`electric-pair-text-syntax-table', to prevent cached syntax for the
original table from affecting things.
Eli Zaretskii [Sun, 3 Jul 2022 09:30:24 +0000 (12:30 +0300)]
Implement pseudo-value 'reset' of face attrributes
* doc/lispref/display.texi (Face Attributes):
* etc/NEWS: Document the new pseudo-value 'reset'.
* src/xfaces.c (realize_named_face, lookup_derived_face)
(gui_supports_face_attributes_p, lookup_named_face)
(Finternal_merge_in_global_face, merge_named_face, merge_faces):
Handle the 'reset' pseudo-value of a face's attribute.
(syms_of_xfaces): New symbol 'reset'.
(RESET_P): New macro.
(check_lface_attrs, Finternal_set_lisp_face_attribute): Allow
'reset' as a value of any attribute except ':inherit'.
(Bug#38771)
Po Lu [Sun, 3 Jul 2022 06:33:02 +0000 (14:33 +0800)]
Fix deadlocks with very old versions of libXi
* src/xfns.c (setup_xi_event_mask, Fx_create_frame): Set
`xi_mask' ourselves if the version of libXi is too old to have
working XIGetSelectedEvents.
* src/xterm.c (x_destroy_window): Free `xi_mask' with xfree in
that case.
Stefan Kangas [Sun, 3 Jul 2022 04:30:38 +0000 (06:30 +0200)]
Merge from origin/emacs-28
dc3d01a5af CC Mode: Fix a c-backward-token-2 call wrongly jumping bac... e390396e68 Doc fixes; don't use obsolete names c85f7c2e8a Don't refer to obsolete alias for insert-char 60ad45c5d2 Don't use obsolete face name in manoj-dark-theme
Po Lu [Sun, 3 Jul 2022 01:41:32 +0000 (09:41 +0800)]
Speed up receiving drops over slow connections
* lisp/x-dnd.el (x-dnd-debug-errors): New variable.
(x-dnd-handle-drag-n-drop-event): Bind
`x-fast-protocol-requests' to t if that is off.
* src/xfns.c (Fx_change_window_property):
(Fx_delete_window_property):
* src/xselect.c (Fx_send_client_message, x_send_client_event):
Don't sync to check for errors if fast protocol requests are
enabled.
* src/xterm.c (x_catch_errors_for_lisp, x_check_errors_for_lisp)
(x_uncatch_errors_for_lisp): New functions.
(syms_of_xterm): New variable `x-fast-protocol-requests'.
* src/xterm.h: Update prototypes.
Alan Mackenzie [Sat, 2 Jul 2022 16:12:59 +0000 (16:12 +0000)]
CC Mode: Fix a c-backward-token-2 call wrongly jumping back over macros.
This fixes bug #56256.
* lisp/progmodes/cc-fonts.el (c-font-lock-c++-lambda-captures): Replace a
c-backward-token-2, which could jump back too far leading to an infinite
loop, with a save-excursion to remember the point we've got to go back to.
Manuel Giraud [Sat, 2 Jul 2022 15:38:36 +0000 (17:38 +0200)]
Add more separators to longlines-mode
* lisp/obsolete/longlines.el (longlines-breakpoint-chars): New
custom to have multiple breakpoint chars.
(longlines-set-breakpoint): Add a target-column parameter and use
`longlines-breakpoint-chars'.
(longlines-find-break-backward, longlines-find-break-foreward):
Use `longlines-breakpoint-chars'.
(longlines-wrap-line): Do not insert space upon merging, just
remove the soft newline. Fix "space before tab" in indent.
(longlines-merge-lines-p): Use the new target-column parameter to
find out if the next line could be merged with the current one.
(longlines-encode-region): Do not replace a soft newline with a
space, just remove it.
* etc/NEWS: New user option 'longlines-breakpoint-chars'
Stefan Kangas [Sat, 2 Jul 2022 13:41:43 +0000 (15:41 +0200)]
Move dired-info and dired-man from dired-x to dired
* lisp/dired-x.el (dired-bind-man, dired-bind-info): Change into
defvars and make obsolete.
(dired-extra-startup): Doc fix.
(dired-info, dired-man): Move from here...
* lisp/dired.el (dired-do-info, dired-do-man): ...to here and
rename. (Bug#21981)
* lisp/dired.el (dired-mode-map): Bind 'I' and 'N' to 'dired-do-info'
and 'dired-do-man'.
* doc/misc/dired-x.texi (Miscellaneous Commands): Remove documentation
of 'dired-info' and 'dired-man'.
* doc/emacs/dired.texi (Dired Enter): Document 'dired-do-info' and
'dired-do-man'.
* etc/NEWS: Announce the above changes.
Po Lu [Sat, 2 Jul 2022 13:55:22 +0000 (21:55 +0800)]
Fix error handling for XCB Xlib
* src/xterm.c (xm_send_drop_message)
(xm_send_top_level_enter_message, xm_send_drag_motion_message)
(xm_send_top_level_leave_message, x_dnd_compute_toplevels)
(x_dnd_send_enter, x_dnd_send_position, x_dnd_send_leave)
(x_dnd_send_drop, handle_one_xevent, x_catch_errors_with_handler)
(x_request_can_fail, x_clean_failable_requests)
(x_ignore_errors_for_next_request, x_stop_ignoring_errors)
(x_uncatch_errors, x_check_errors, x_had_errors_p, x_error_handler)
(frame_set_mouse_pixel_position, x_focus_frame): Record serial
sequences instead of simply the next request when ignoring a
single request. Use XNextRequest instead of NextRequest, since
the latter is unreliable when using Xlib built with XCB.
* src/xterm.h (struct x_failable_request): New struct..
(struct x_display_info): Make failable request variables the
right type.
Command for global adjustments to the default face
* lisp/face-remap.el (global-text-scale-adjust): New command.
(text-scale-adjust): Refer to the new related command.
(global-text-scale-adjust-resizes-frames): New user option.
* lisp/mwheel.el (mouse-wheel-scroll-amount): Add the new command
to the mouse wheel scrolling events.
(mouse-wheel-global-text-scale): New function.
(mouse-wheel-mode): Use the new function with mouse-wheel-mode.
* doc/emacs/display.texi (Text Scale): Document the new command and
the new user option.
* etc/NEWS: Mention the new command and its bindings, and the new
user option.
Make comint-watch-for-password-prompt more resilient
* lisp/comint.el (comint-watch-for-password-prompt): Don't try to
send commands to the process after it's exited (bug#56336). (This
commonly happens when invoked via `M-&'.)