Actually fix the long lines display bug (bug#56393).
* lisp/files.el (auto-narrow-mode): New minor mode.
(auto-narrow-pre-command-function, auto-narrow-post-command-function):
New auxiliary functions for the minor mode.
(auto-narrow-display-length, auto-narrow-widen-automatically): New
defcustoms for the minor mode.
(auto-narrow--widen-automatically, auto-narrow--isearch-widen-automatically,
auto-narrow--initialized): New internal variables for the minor mode.
* src/buffer.h (struct buffer): New internal variable for the minor mode.
(bset_auto_narrow__narrowing_state, BUFFER_AUTO_NARROWED_P): New
auxiliary functions.
* src/buffer.c (init_buffer_once, syms_of_buffer): New internal variable
for the minor mode. Update the docstring of mode-line-format.
* src/fileio.c (Finsert_file_contents): Detect whether the minor mode should
be entered when the buffer is displayed.
(syms_of_fileio): New defcustom for the minor mode.
* src/keyboard.c (syms_of_keyboard): New hook functions for the minor mode.
(command_loop_1): Execute the hook functions.
* src/xdisp.c (redisplay_window): Enter the minor mode when the buffer is
displayed.
(decode_mode_spec): Indicate when the minor mode is active
in the modeline. Indicate the buffer position relative to the whole buffer.
(set_vertical_scroll_bar): Indicate the buffer position relative to the
whole buffer.
(syms_of_xdisp): Two new symbols.
* lisp/isearch.el (isearch-widen-automatically): New defcustom.
(isearch-search): Use the new defcustom.
* lisp/bindings.el (mode-line-modes): Do not propertize the indication
in the modeline when the new minor mode is active.
* etc/NEWS: Announce the new minor mode, and remove the unobsoletion
indication for 'longlines-mode'.
* lisp/longlines.el: Reobsolete longlines-mode.
* doc/emacs/display.texi (Auto-Narrowing): New section, describing the new
minor mode.
(Display): Entry for the new section.
* doc/emacs/trouble.texi (Long Lines): Remove the section.
(Lossage): Remove the entry for the Long Lines section.
* doc/emacs/emacs.texi (Top): Remove the entry for the Long Lines section.
Stefan Kangas [Tue, 5 Jul 2022 17:37:55 +0000 (19:37 +0200)]
Rename new option to remote-file-name-inhibit-auto-save-visited
* lisp/files.el (remote-file-name-inhibit-auto-save-visited):
Rename from 'auto-save-visited-remote-files' and invert logic.
(auto-save-visited-mode): Adjust accordingly. (Bug#41333)
Suggested by Michael Albinus <michael.albinus@gmx.de>.
* lisp/replace.el (read-regexp-map): New map.
(read-regexp--case-fold, read-regexp-toggle-case-folding)
(read-regexp): Factor out to avoid hard-coding `M-c'.
Stefan Kangas [Tue, 5 Jul 2022 12:16:08 +0000 (14:16 +0200)]
New user option auto-save-visited-remote-files
* lisp/files.el (auto-save-visited-remote-files): New user option.
(auto-save-visited-mode): Use above new variable to decide whether
or not to save remote files. (Bug#41333)
Stefan Kangas [Tue, 5 Jul 2022 11:34:24 +0000 (13:34 +0200)]
New user option auto-save-visited-mode-predicate
* lisp/files.el (auto-save-visited-mode-predicate): New defcustom.
(auto-save-visited-mode): Use above new variable as a predicate to
decide whether or not to save a buffer.
* lisp/international/emoji.el (emoji-insert): Remove the prefix
action from this command, since the same is already available on
`C-x 8 e s', and we're considering using the prefix to copy to the
kill ring.
Po Lu [Tue, 5 Jul 2022 06:55:24 +0000 (14:55 +0800)]
Allow immediately saving XDS drops
This fixes things with programs that have a very timeout, such
as Chromium, within which it isn't practical for the user to
confirm the default file name.
* lisp/x-dnd.el (x-dnd-direct-save-function): Add new choices to
defcustom.
(x-dnd-init-frame): Use fast protocol requests.
(x-dnd-save-direct-immediately): New function.
(x-dnd-handle-xds-drop): Fix nil values of selected file name.
Paul Eggert [Tue, 5 Jul 2022 04:12:45 +0000 (23:12 -0500)]
Quote configure.ac arguments more consistently
This should help avoid further Autoconf portability gotchas such as
the one recently fixed in 2022-06-27T04:26:01Z!meyering@fb.com.
* autogen.sh (autoconf_min): Adjust pattern to match
updated configure.ac.
* configure.ac: Quote arguments more consistently,
as per the Autoconf manual.
Po Lu [Tue, 5 Jul 2022 03:03:11 +0000 (11:03 +0800)]
Don't take XCB socket every time we want the no of the next request
* src/xterm.c (x_ignore_errors_for_next_request, x_uncatch_errors)
(x_check_errors, x_had_errors_p): Don't call XNextRequest
redundantly. Use NextRequest if it was immediately preceded by
XNextRequest, which updates dpy->request.
Alexander Adolf [Sat, 2 Jul 2022 15:27:55 +0000 (17:27 +0200)]
Add reverse mapping for EUDC attribute names
* lisp/net/eudc.el (eudc-translate-query): new optional parameter to
reverse the mapping direction
(eudc-translate-attribute-list): new optional parameter to
reverse the mapping direction
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)