]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoImprove isearch in auto-narrow-mode.
Gregory Heytings [Wed, 6 Jul 2022 12:32:51 +0000 (12:32 +0000)]
Improve isearch in auto-narrow-mode.

* lisp/isearch.el (isearch-search): Set isearch-lazy-highlight to nil before
widening in auto-narrow-mode.

* lisp/files.el (auto-narrow--isearch-lazy-highlight): New internal variable.
(auto-narrow-pre-command-function, auto-narrow-post-command-function): Use it.

2 years agoVarious improvements to auto-narrow mode.
Gregory Heytings [Wed, 6 Jul 2022 10:04:38 +0000 (10:04 +0000)]
Various improvements to auto-narrow mode.

* lisp/files.el (auto-narrow-display-length): Improve docstring.
(auto-narrow-widen-automatically): Add 'undo' to the command list.
(auto-narrow-hook): New defcustom.
(auto-narrow-pre-command-function, auto-narrow-post-command-function):
Move initialization code.
(auto-narrow-mode): Do not make the 'auto-narrow-mode' permanent local
anymore.

* lisp/font-lock.el (turn-off-font-lock-mode): New convenience function.

* src/xdisp.c (set_vertical_scroll_bar): Fix typo.
(redisplay_window): Use the new convenience function.

* src/buffer.h (BUFFER_NEEDS_AUTO_NARROWING_P,
BUFFER_AUTO_NARROWED_NON_NARROWED_P): Two new convenience functions.

* src/window.c (Frecenter): Do not recenter auto-narrowed buffers that
are not actually narrowed.

* etc/NEWS: Improvement.

* doc/emacs/display.texi (Auto-Narrowing): Improvement.

2 years agoActually fix the long lines display bug (bug#56393).
Gregory Heytings [Tue, 5 Jul 2022 22:43:56 +0000 (00:43 +0200)]
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.

2 years ago* make-dist: Fix after recent configure.ac quoting changes.
Glenn Morris [Tue, 5 Jul 2022 21:50:17 +0000 (14:50 -0700)]
* make-dist: Fix after recent configure.ac quoting changes.

2 years agoFix custom-initialize-reset bootstrap error
Lars Ingebrigtsen [Tue, 5 Jul 2022 20:42:25 +0000 (22:42 +0200)]
Fix custom-initialize-reset bootstrap error

* lisp/custom.el (custom-initialize-reset): Fix bootstrap problem
by avoiding when-let.

2 years agoFix rcirc buffer name collisions
Lars Ingebrigtsen [Tue, 5 Jul 2022 19:06:36 +0000 (21:06 +0200)]
Fix rcirc buffer name collisions

* lisp/net/rcirc.el (rcirc-handler-NICK): Avoid naming collisions
when renaming buffers (bug#45872).

2 years agoMention remote-file-name-inhibit-auto-save-visited in Tramp manual
Michael Albinus [Tue, 5 Jul 2022 19:19:51 +0000 (21:19 +0200)]
Mention remote-file-name-inhibit-auto-save-visited in Tramp manual

* doc/misc/tramp.texi (Auto-save File Lock and Backup):
Explain remote-file-name-inhibit-auto-save-visited.

2 years agoRename new option to remote-file-name-inhibit-auto-save-visited
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>.

2 years agoRegenerate ldefs-boot.el
Lars Ingebrigtsen [Tue, 5 Jul 2022 17:37:52 +0000 (19:37 +0200)]
Regenerate ldefs-boot.el

2 years agoGive a warning if setopt has been used with an invalid value
Lars Ingebrigtsen [Tue, 5 Jul 2022 17:32:37 +0000 (19:32 +0200)]
Give a warning if setopt has been used with an invalid value

* lisp/cus-edit.el (setopt--set): Mark the variable for checking.

* lisp/custom.el (custom-initialize-reset): Give a warning if the
type is wrong (bug#56400).

* lisp/wid-edit.el (widget-convert): Autoload.

2 years ago; * lisp/emacs-lisp/subr-x.el (string-limit): Clarify doc string.
Eli Zaretskii [Tue, 5 Jul 2022 16:45:35 +0000 (19:45 +0300)]
; * lisp/emacs-lisp/subr-x.el (string-limit): Clarify doc string.

2 years ago; * etc/NEWS: Clarify entry.
Stefan Kangas [Tue, 5 Jul 2022 15:54:43 +0000 (17:54 +0200)]
; * etc/NEWS: Clarify entry.

2 years agoRe-fix narrowing problem in tramp-debug-buffer-command-completion-p
Stefan Kangas [Tue, 5 Jul 2022 15:53:06 +0000 (17:53 +0200)]
Re-fix narrowing problem in tramp-debug-buffer-command-completion-p

* lisp/net/tramp.el (tramp-debug-buffer-command-completion-p):
Respect narrowing also for end of substring.  (Bug#56225)

2 years agoMake some defcustom types more restrictive
Stefan Kangas [Tue, 5 Jul 2022 14:26:45 +0000 (16:26 +0200)]
Make some defcustom types more restrictive

* lisp/abbrev.el (abbrev-suggest-hint-threshold):
* lisp/bookmark.el (bookmark-bmenu-file-column)
(bookmark-menu-length):
* lisp/buff-menu.el (Buffer-menu-size-width)
(Buffer-menu-mode-width):
* lisp/calendar/calendar.el (calendar-week-start-day)
(calendar-intermonth-spacing, calendar-column-width)
(calendar-day-digit-width):
* lisp/calc/calc.el (calc-undo-length):
* lisp/calendar/timeclock.el (timeclock-workday):
* lisp/comint.el (comint-buffer-maximum-size)
(comint-input-ring-size):
* lisp/doc-view.el (doc-view-resolution, doc-view-image-width):
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-max-column):
* lisp/emacs-lisp/comp.el (native-comp-debug)
(native-comp-verbose, native-comp-async-jobs-number):
* lisp/emacs-lisp/package.el (package-name-column-width)
(package-version-column-width, package-status-column-width)
(package-archive-column-width):
* lisp/eshell/esh-mode.el (eshell-buffer-maximum-lines):
* lisp/frame.el (blink-cursor-blinks):
* lisp/info.el (Info-breadcrumbs-depth):
* lisp/jit-lock.el (jit-lock-chunk-size):
* lisp/kmacro.el (kmacro-ring-max):
* lisp/menu-bar.el (yank-menu-length, yank-menu-max-items):
* lisp/midnight.el (clean-buffer-list-delay-general)
(clean-buffer-list-delay-special):
* lisp/net/dictionary.el (dictionary-port)
(dictionary-proxy-port):
* lisp/net/ldap.el (ldap-default-port):
* lisp/net/pop3.el (pop3-port, pop3-stream-length):
* lisp/net/rcirc.el (rcirc-default-port):
* lisp/net/sieve-manage.el (sieve-manage-default-port):
* lisp/play/spook.el (spook-phrase-default-count):
* lisp/play/tetris.el (tetris-buffer-width)
(tetris-buffer-height, tetris-width, tetris-height)
(tetris-top-left-x, tetris-top-left-y):
* lisp/profiler.el (profiler-sampling-interval):
* lisp/progmodes/sql.el (sql-port):
* lisp/recentf.el (recentf-max-menu-items):
* lisp/strokes.el (strokes-grid-resolution):
* lisp/tab-bar.el (tab-bar-tab-name-truncated-max):
* lisp/term/xterm.el (xterm-max-cut-length):
* lisp/time.el (display-time-interval, world-clock-timer-second):
* lisp/url/url-cache.el (url-cache-expire-time):
* lisp/url/url-cookie.el (url-cookie-save-interval):
* lisp/url/url-history.el (url-history-save-interval):
* lisp/url/url-queue.el (url-queue-parallel-processes)
(url-queue-timeout):
* lisp/url/url-vars.el (url-max-password-attempts)
(url-max-redirections):
* lisp/vc/emerge.el (emerge-min-visible-lines):
* lisp/vc/vc.el (vc-log-show-limit):
* lisp/window.el (window-min-height, window-min-width):
* lisp/winner.el (winner-ring-size): Use :type natnum.

* lisp/savehist.el (savehist-file-modes): Fix setting to nil value and
use :type natnum.

2 years agoDon't hard-code `M-c' in `read-regexp'
Lars Ingebrigtsen [Tue, 5 Jul 2022 16:26:52 +0000 (18:26 +0200)]
Don't hard-code `M-c' in `read-regexp'

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

2 years agoDocumnt left/right mwheel events
Lars Ingebrigtsen [Tue, 5 Jul 2022 11:44:45 +0000 (13:44 +0200)]
Documnt left/right mwheel events

* doc/lispref/commands.texi (Misc Events): Document left/right
mwheel events (bug#41722).

2 years agoMention byte order marks in string-limit doc string
Lars Ingebrigtsen [Tue, 5 Jul 2022 11:07:56 +0000 (13:07 +0200)]
Mention byte order marks in string-limit doc string

* lisp/emacs-lisp/subr-x.el (string-limit): Mention byte order
marks (bug#48324).

2 years ago; * lisp/files.el (auto-save-visited-predicate): Doc fix.
Eli Zaretskii [Tue, 5 Jul 2022 13:12:13 +0000 (16:12 +0300)]
; * lisp/files.el (auto-save-visited-predicate): Doc fix.

2 years ago; Fix documentation of 'auto-save-visited-remote-files'
Eli Zaretskii [Tue, 5 Jul 2022 13:07:03 +0000 (16:07 +0300)]
; Fix documentation of 'auto-save-visited-remote-files'

* etc/NEWS:
* lisp/files.el (auto-save-visited-remote-files): Doc fix.

2 years agoNew user option auto-save-visited-remote-files
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)

2 years agoNew user option auto-save-visited-mode-predicate
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.

2 years agoShorten name of recently added command to emacs-news-open-line
Stefan Kangas [Tue, 5 Jul 2022 11:37:32 +0000 (13:37 +0200)]
Shorten name of recently added command to emacs-news-open-line

* lisp/textmodes/emacs-news-mode.el (emacs-news-open-line): Rename
from 'emacs-news-mode-open-line'.

2 years agoFix manually disowning Emacs drag atoms
Po Lu [Tue, 5 Jul 2022 11:17:03 +0000 (19:17 +0800)]
Fix manually disowning Emacs drag atoms

* src/xterm.c (handle_one_xevent): Disown Motif drag atom if
eventp->time is CurrentTime as well.  This can happen with some
synthetic events.

2 years agoRemove the interactive prefix from emoji-insert
Lars Ingebrigtsen [Tue, 5 Jul 2022 11:03:36 +0000 (13:03 +0200)]
Remove the interactive prefix from emoji-insert

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

2 years agoAllow immediately saving XDS drops
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.

2 years agoQuote configure.ac arguments more consistently
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.

2 years agoDon’t mishandle preset emacs_cv_lesstif
Paul Eggert [Tue, 5 Jul 2022 04:23:59 +0000 (23:23 -0500)]
Don’t mishandle preset emacs_cv_lesstif

* configure.ac: Restore CFLAGS etc. correctly even when
emacs_cv_lesstif is already set on the command line.

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

d5e1424174 Expand docstrings related to auto-saving

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Tue, 5 Jul 2022 04:30:40 +0000 (06:30 +0200)]
; Merge from origin/emacs-28

The following commits were skipped:

28c5c27162 Don't bug out in manual-html-fix-index-2 on newer makeinfo...
724f712ef1 Preserve <title> in the Emacs manuals

2 years agoDon't take XCB socket every time we want the no of the next request
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.

2 years agoNew command emacs-news-mode-open-line
Stefan Kangas [Tue, 5 Jul 2022 02:57:51 +0000 (04:57 +0200)]
New command emacs-news-mode-open-line

* lisp/textmodes/emacs-news-mode.el
(emacs-news-mode-open-line): New command.
(emacs-news-mode-map): Remap 'open-line' to above new command.

2 years agoImprove support for remote files in XDS
Po Lu [Tue, 5 Jul 2022 02:40:32 +0000 (10:40 +0800)]
Improve support for remote files in XDS

* lisp/x-dnd.el (x-dnd-direct-save-function): Remove "local file
name" from documentation.
(x-dnd-save-direct): Handle remote file names normally.
(x-dnd-handle-xds-drop): Handle remote file names in URI.

2 years agoDon't overestimate supported input extension version on GTK 3
Po Lu [Tue, 5 Jul 2022 02:12:19 +0000 (10:12 +0800)]
Don't overestimate supported input extension version on GTK 3

* src/xterm.c (x_term_init): If minor > original_minor (the
maximum version supported by libXi), set it back to
original_minor.

2 years agoAdd reverse mapping for EUDC attribute names
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

2 years ago(gnus-inverse-list-range-intersection): Update alias
Stefan Monnier [Mon, 4 Jul 2022 22:44:03 +0000 (18:44 -0400)]
(gnus-inverse-list-range-intersection): Update alias

* lisp/gnus/gnus-range.el (gnus-inverse-list-range-intersection):
Don't alias to an obsolete alias.

2 years agoExpand docstrings related to auto-saving
Stefan Kangas [Mon, 4 Jul 2022 21:54:07 +0000 (23:54 +0200)]
Expand docstrings related to auto-saving

* lisp/files.el (auto-save-visited-mode):
* lisp/simple.el (auto-save-mode): Expand docstring.

2 years agoFix core dump with x-get-local-selection
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.

2 years agoAdd quit-window entry to list-timers menu
Stefan Kangas [Mon, 4 Jul 2022 16:44:24 +0000 (18:44 +0200)]
Add quit-window entry to list-timers menu

* lisp/emacs-lisp/timer-list.el (timer-list-mode-map): Add
quit-window entry to menu.

2 years agoPrefer defvar-keymap in emacs-lisp/*.el
Stefan Kangas [Mon, 4 Jul 2022 16:42:26 +0000 (18:42 +0200)]
Prefer defvar-keymap in emacs-lisp/*.el

* lisp/emacs-lisp/backtrace.el (backtrace-mode-map):
* lisp/emacs-lisp/bytecomp.el (emacs-lisp-compilation-mode-map):
* lisp/emacs-lisp/checkdoc.el (checkdoc-minor-mode-map):
* lisp/emacs-lisp/crm.el (crm-local-completion-map)
(crm-local-must-match-map):
* lisp/emacs-lisp/debug.el (debugger-mode-map):
* lisp/emacs-lisp/edebug.el (edebug-mode-map, edebug-global-map)
(edebug-eval-mode-map):
* lisp/emacs-lisp/eieio-custom.el (eieio-custom-mode-map):
* lisp/emacs-lisp/elp.el (elp-results-symname-map):
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-shared-map):
* lisp/emacs-lisp/re-builder.el (reb-mode-map)
(reb-lisp-mode-map, reb-subexp-mode-map):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode-map)
(tabulated-list-sort-button-map):
* lisp/emacs-lisp/timer-list.el (timer-list-mode-map):

2 years agoDocument using make-composed-keymap with defvar-keymap
Stefan Kangas [Mon, 4 Jul 2022 16:19:20 +0000 (18:19 +0200)]
Document using make-composed-keymap with defvar-keymap

* doc/lispref/keymaps.texi (Inheritance and Keymaps): Document
using 'make-composed-keymap' with 'defvar-keymap'.

* lisp/help-mode.el (help-mode-map): Use defvar-keymap to make this
code match the above documentation change.

2 years ago; Fix warning in mwheel.el
Stefan Kangas [Mon, 4 Jul 2022 14:58:53 +0000 (16:58 +0200)]
; Fix warning in mwheel.el

* lisp/mwheel.el (global-text-scale-adjust): Declare function.

2 years agoDoc fix; quote keys in face-remap.el
Stefan Kangas [Mon, 4 Jul 2022 14:54:38 +0000 (16:54 +0200)]
Doc fix; quote keys in face-remap.el

* lisp/face-remap.el (text-scale-adjust, global-text-scale-adjust):
Doc fix; quote keys.

2 years agoInherit instead of copying keymap in bookmark.el
Stefan Kangas [Mon, 4 Jul 2022 14:18:54 +0000 (16:18 +0200)]
Inherit instead of copying keymap in bookmark.el

* lisp/bookmark.el (bookmark-rename): Inherit instead of copying
keymap.

2 years ago* src/keymap.c (Fcopy_keymap): Document using defvar-keymap.
Stefan Kangas [Mon, 4 Jul 2022 14:02:26 +0000 (16:02 +0200)]
* src/keymap.c (Fcopy_keymap): Document using defvar-keymap.

2 years ago; remove regexp ambiguity
Mattias Engdegård [Mon, 4 Jul 2022 13:54:14 +0000 (15:54 +0200)]
; remove regexp ambiguity

2 years agoUse substitute-command-keys in Helper-help
Stefan Kangas [Mon, 4 Jul 2022 13:45:18 +0000 (15:45 +0200)]
Use substitute-command-keys in Helper-help

* lisp/emacs-lisp/helper.el (Helper-help-scroller)
(Helper-help-options, Helper-help): Use substitute-command-keys.
(Helper-help-map): Prefer defvar-keymap.

2 years agoAvoid code duplication converting XI event state in toolkit menu code
Po Lu [Mon, 4 Jul 2022 13:03:02 +0000 (21:03 +0800)]
Avoid code duplication converting XI event state in toolkit menu code

* src/xmenu.c (x_menu_translate_generic_event):
(popup_get_selection): Use `xi_convert_event_state' instead.
* src/xterm.c (xi_convert_event_state): Export on non-GTK
builds.
* src/xterm.h: Update prototypes.

2 years agoFix scrolling backwards in Helper-help
Stefan Kangas [Mon, 4 Jul 2022 13:06:52 +0000 (15:06 +0200)]
Fix scrolling backwards in Helper-help

* lisp/emacs-lisp/helper.el (Helper-help-scroller): Fix scrolling
backwards.

2 years agoRemove some useless `eval-when-compile`
Mattias Engdegård [Mon, 4 Jul 2022 12:52:50 +0000 (14:52 +0200)]
Remove some useless `eval-when-compile`

* lisp/cedet/semantic/java.el (semantic-java-number-regexp):
* lisp/cedet/semantic/lex.el (semantic-lex-number-expression):
* lisp/emacs-lisp/cl-indent.el (common-lisp-indent-function-1):
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression)
(lisp--el-match-keyword, lisp-string-in-doc-position-p):
* lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands):
* lisp/net/socks.el (socks-send-command):
* lisp/progmodes/meta-mode.el (meta-font-lock-keywords):
* lisp/shell.el (shell--parse-pcomplete-arguments):
* lisp/textmodes/sgml-mode.el (sgml-mode):
* lisp/textmodes/tex-mode.el (tex--guess-mode)
(tex-common-initialization, tex-input-files-re):
* lisp/textmodes/tildify.el (tildify-mode):
* lisp/xdg.el (xdg-line-regexp):
Eliminate `eval-when-compile` when the argument would be evaluated by
the compiler anyway.

2 years agoReplace lisp-mode-symbol-regexp with (rx lisp-mode-symbol)
Mattias Engdegård [Mon, 4 Jul 2022 12:12:24 +0000 (14:12 +0200)]
Replace lisp-mode-symbol-regexp with (rx lisp-mode-symbol)

This is shorter, simplifies use inside rx expressions, and removes
need for eval-when-compile elsewhere (for later exploitation).

* lisp/emacs-lisp/lisp-mode.el (lisp-mode-symbol): New rx-define.
(lisp-mode-symbol-regexp): Redefine using lisp-mode-symbol.
(lisp-imenu-generic-expression, lisp--el-match-keyword)
(lisp-fdefs, lisp-string-in-doc-position-p):
* lisp/emacs-lisp/checkdoc.el (checkdoc--error-bad-format-p):
* lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands):
Use lisp-mode-symbol instead of lisp-mode-symbol-regexp.

2 years ago* lisp/progmodes/ebrowse.el (ebrowse-tree-mode): Fix typo.
Stefan Kangas [Mon, 4 Jul 2022 12:53:16 +0000 (14:53 +0200)]
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode): Fix typo.

2 years agoRemove remaining Helper-help support from view-mode
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.

2 years ago; Fix doc strings in help-fns.el
Eli Zaretskii [Mon, 4 Jul 2022 12:13:12 +0000 (15:13 +0300)]
; Fix doc strings in help-fns.el

* lisp/help-fns.el (help-fns-edit-mode-done)
(help-fns-edit-mode-cancel): Doc fixes.

2 years agoDon't bug out in manual-html-fix-index-2 on newer makeinfo versions
Lars Ingebrigtsen [Mon, 4 Jul 2022 10:37:17 +0000 (12:37 +0200)]
Don't bug out in manual-html-fix-index-2 on newer makeinfo versions

Backport from master.

* admin/admin.el (manual-html-fix-index-2): Don't bug out if the
makeinfo version doesn't include <ul>.

(cherry picked from commit e0e3f2b672bc42da52ac9c7596c7560a88684651)

2 years agoPreserve <title> in the Emacs manuals
Lars Ingebrigtsen [Mon, 4 Jul 2022 10:47:16 +0000 (12:47 +0200)]
Preserve <title> in the Emacs manuals

Backport from master.

* admin/admin.el (manual-html-fix-headers): Preserve the <title>
element (bug#48334).

(cherry picked from commit b778e71af7ca8c59917334b4bb1b34cdb52faca9)

2 years ago; Fix documentation of 'file-parent-directory'
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)

2 years agoAdd file-parent-directory function
Daanturo [Mon, 4 Jul 2022 11:07:51 +0000 (13:07 +0200)]
Add file-parent-directory function

* doc/lispref/files.texi: Document the function.
* etc/NEWS: Add its entry.
* lisp/emacs-lisp/shortdoc.el: Add it to 'file-name' group.
* lisp/files.el: implementation (bug#56355).

2 years agolisp/thumbs.el: Fix calling the "convert" command
Benjamin Riefenstahl [Mon, 4 Jul 2022 10:57:34 +0000 (12:57 +0200)]
lisp/thumbs.el: Fix calling the "convert" command

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

2 years agoPreserve <title> in the Emacs manuals
Lars Ingebrigtsen [Mon, 4 Jul 2022 10:47:16 +0000 (12:47 +0200)]
Preserve <title> in the Emacs manuals

* admin/admin.el (manual-html-fix-headers): Preserve the <title>
element (bug#48334).

2 years agoDon't bug out in manual-html-fix-index-2 on newer makeinfo versions
Lars Ingebrigtsen [Mon, 4 Jul 2022 10:37:17 +0000 (12:37 +0200)]
Don't bug out in manual-html-fix-index-2 on newer makeinfo versions

* admin/admin.el (manual-html-fix-index-2): Don't bug out if the
makeinfo version doesn't include <ul>.

2 years agoExclude radio buttons when suggesting URI in eww
Visuwesh [Sun, 3 Jul 2022 13:29:44 +0000 (15:29 +0200)]
Exclude radio buttons when suggesting URI in eww

* lisp/net/eww.el (eww-links-at-point): Exclude radio links.
(bug#56366).

2 years agoNew command help-fns-edit-mode-cancel
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.

2 years agoHandle errors caused by ignoring errors with GDK's trap installed
Po Lu [Mon, 4 Jul 2022 06:02:42 +0000 (14:02 +0800)]
Handle errors caused by ignoring errors with GDK's trap installed

* src/xterm.c (x_ignore_errors_for_next_request)
(x_stop_ignoring_errors): Also tell GDK to ignore errors from
the following requests.  (bug#56372)

2 years agoAlways wait for XdndStatus before sending XdndDrop
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.

2 years agoFix accessing dpyinfo after it is deallocated
Po Lu [Mon, 4 Jul 2022 04:56:24 +0000 (12:56 +0800)]
Fix accessing dpyinfo after it is deallocated

* src/xterm.c (x_connection_closed): Print disconnect error for
the last terminal before freeing it.

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

41472f3b6c Document 'jit-lock-debug-mode'

2 years agoDisplay list of traps and handlers when crashing due to an X error
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.

2 years agoAdd support for fullscreen values fullheight and fullwidth on PGTK
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

2 years agoAdd some more error checking code to `x_stop_ignoring_errors'
Po Lu [Mon, 4 Jul 2022 01:33:19 +0000 (09:33 +0800)]
Add some more error checking code to `x_stop_ignoring_errors'

* src/xterm.c (x_stop_ignoring_errors): Abort if no request was
actually made, making the state inconsistent.

2 years agoSimplify lisp-el-font-lock-keywords-2 definition slightly
Stefan Kangas [Sun, 3 Jul 2022 21:05:50 +0000 (23:05 +0200)]
Simplify lisp-el-font-lock-keywords-2 definition slightly

* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
Simplify slightly.

2 years agoQuote some literal keys to get help-key-binding face
Stefan Kangas [Sun, 3 Jul 2022 15:35:53 +0000 (17:35 +0200)]
Quote some literal keys to get help-key-binding face

* lisp/align.el (align):
* lisp/bindings.el (undo-repeat-map):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-prog.el (calc-user-define-invocation):
* lisp/calc/calc-yank.el (calc--edit-mode):
* lisp/comint.el (comint-history-isearch)
* lisp/dired.el (dired-mode):
* lisp/emulation/viper.el (viper-mode):
* lisp/erc/erc-button.el (erc-button-face):
* lisp/erc/erc-track.el (erc-track-enable-keybindings):
* lisp/gnus/gnus-art.el (gnus-article-button-face):
* lisp/gnus/gnus-eform.el (gnus-edit-form):
* lisp/gnus/gnus-sum.el (gnus-summary-stop-at-end-of-message)
(gnus-summary-goto-unread):
* lisp/icomplete.el (icomplete-show-matches-on-no-input):
* lisp/image-mode.el (image-scroll-up):
* lisp/international/iso-transl.el (iso-transl-set-language):
* lisp/isearch.el (isearch-forward-regexp):
* lisp/misc.el (butterfly):
* lisp/outline.el (outline-minor-mode-cycle-filter)
(outline-minor-mode-cycle):
* lisp/progmodes/grep.el (rgrep):
* lisp/progmodes/gud.el (gud-gdb-repeat-map, gud-sdb-repeat-map)
(gud-dbx-repeat-map, gud-xdb-repeat-map, gud-perldb-repeat-map)
(gud-pdb-repeat-map, gud-guiler-repeat-map, gud-jdb-repeat-map):
* lisp/progmodes/idlw-shell.el (idlwave-shell-graphics-window-size)
(idlwave-shell-mode):
* lisp/progmodes/idlwave.el (idlwave-shell-debug-modifiers)
(idlwave-list-shell-load-path-shadows):
* lisp/progmodes/python.el (python-shell-get-process-or-error):
* lisp/repeat.el (repeat-check-key):
* lisp/replace.el (query-replace, query-replace-regexp)
(read-regexp):
* lisp/simple.el (read-extended-command-predicate):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/term.el (ansi-term):
* lisp/textmodes/reftex-index.el (reftex-index-phrases-set-macro-key):
* lisp/vc/emerge.el (emerge-scroll-left, emerge-scroll-right):
* lisp/windmove.el:
* lisp/winner.el (winner-mode): Quote literal keys to get
'help-key-binding' face.
* lisp/comint.el (comint-insert-previous-argument): Use regular
quotes.

2 years agoUse command substitutions instead of literal keys in some places
Stefan Kangas [Sun, 3 Jul 2022 19:00:16 +0000 (21:00 +0200)]
Use command substitutions instead of literal keys in some places

* lisp/emulation/viper-macs.el (ex-map, viper-set-register-macro):
* lisp/minibuffer.el (minibuffer-beginning-of-buffer-movement):
* lisp/speedbar.el (speedbar-frame-mode):
* lisp/subr.el (kbd):
* lisp/textmodes/page-ext.el (pages-directory)
(pages-directory-for-addresses):
* lisp/textmodes/reftex-toc.el: Use command substitutions instead of
literal keys.

2 years agoNormalize definition of erc-track-minor-mode-map
Stefan Kangas [Sun, 3 Jul 2022 20:42:13 +0000 (22:42 +0200)]
Normalize definition of erc-track-minor-mode-map

* lisp/erc/erc-track.el (erc-track-minor-mode-map): Normalize keymap
definition.

2 years agoUse substitute-command-keys in reftex-toc-show-help
Stefan Kangas [Sun, 3 Jul 2022 20:32:47 +0000 (22:32 +0200)]
Use substitute-command-keys in reftex-toc-show-help

* lisp/textmodes/reftex-toc.el (reftex-toc-help)
(reftex-toc-show-help): Use substitute-command-keys.

2 years agoFont lock \\<> and \\{} command substitutions in docstrings
Stefan Kangas [Sun, 3 Jul 2022 18:59:00 +0000 (20:59 +0200)]
Font lock \\<> and \\{} command substitutions in docstrings

* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
Support \\<> and \\{} command substitutions.

2 years agoFix warning in last commit
Stefan Kangas [Sun, 3 Jul 2022 21:28:50 +0000 (23:28 +0200)]
Fix warning in last commit

* lisp/calc/calc-misc.el (calc-dispatch-help): Fix warning.

2 years ago; * lisp/mwheel.el (mouse-wheel-scroll-amount): Doc fix.
Eli Zaretskii [Sun, 3 Jul 2022 17:57:22 +0000 (20:57 +0300)]
; * lisp/mwheel.el (mouse-wheel-scroll-amount): Doc fix.

2 years agoUse more help-key-binding faces in repeat-mode message
Juri Linkov [Sun, 3 Jul 2022 17:02:02 +0000 (20:02 +0300)]
Use more help-key-binding faces in repeat-mode message

* lisp/repeat.el (repeat-echo-message-string): Use
substitute-command-keys for repeat-exit-key as well.

2 years ago* lisp/mwheel.el: More fixes for global-text-scale (bug#48307)
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'.

2 years agoImprove calc-dispatch-help docstring
Stefan Kangas [Sun, 3 Jul 2022 15:31:45 +0000 (17:31 +0200)]
Improve calc-dispatch-help docstring

* lisp/calc/calc-misc.el (calc-dispatch-help): Use command
substitutions.

2 years agoTramp code cleanup
Michael Albinus [Sun, 3 Jul 2022 16:23:55 +0000 (18:23 +0200)]
Tramp code cleanup

* lisp/net/tramp-cache.el (tramp-get-file-property)
(tramp-get-connection-property): Make DEFAULT optional.  Adapt callees.

* lisp/net/tramp.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-compat.el:
* lisp/net/tramp-crypt.el:
* lisp/net/tramp-ftp.el:
* lisp/net/tramp-fuse.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sshfs.el:
* lisp/net/trampver.el: Code cleanup.

* test/lisp/net/tramp-tests.el (tramp--test-sh-no-ls--dired-p)
(tramp--test-with-proper-process-name-and-buffer): Code cleanup.

2 years agoabort-redisplay: Add missing unbind_to in 'recenter'
Florian Rommel [Sun, 3 Jul 2022 15:04:32 +0000 (17:04 +0200)]
abort-redisplay: Add missing unbind_to in 'recenter'

* src/window.c (recenter): Add ubind_to before early return.
(Bug#56369)

2 years agolisp/elec-pair.el: Simplify last change
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.

2 years agoFix dired-goto-subdir prompt
Stefan Kangas [Sun, 3 Jul 2022 13:16:23 +0000 (15:16 +0200)]
Fix dired-goto-subdir prompt

* lisp/dired-aux.el (dired-goto-subdir): Fix prompt and improve
docstring.  Add interactive mode tag for dired-mode.

2 years agoFix warnings in my last commit
Stefan Kangas [Sun, 3 Jul 2022 12:47:53 +0000 (14:47 +0200)]
Fix warnings in my last commit

* lisp/textmodes/emacs-news-mode.el (outline): Require.

2 years agoImprove navigation keybindings in emacs-news-mode
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'.

2 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sun, 3 Jul 2022 12:39:05 +0000 (15:39 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

2 years agoFix implementation of 'reset' face values
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)

2 years ago; * etc/NEWS: Tag two items.
Stefan Kangas [Sun, 3 Jul 2022 12:34:44 +0000 (14:34 +0200)]
; * etc/NEWS: Tag two items.

2 years agoMove dired-clean-up-buffers-too to dired.el
Stefan Kangas [Sun, 3 Jul 2022 12:32:44 +0000 (14:32 +0200)]
Move dired-clean-up-buffers-too to dired.el

* lisp/dired-x.el (dired-clean-up-buffers-too)
(dired-clean-confirm-killing-deleted-buffers): Move from here...
* lisp/dired.el (dired-clean-up-buffers-too)
(dired-clean-confirm-killing-deleted-buffers): ...to
here.  (Bug#21981)
(dired-clean-up-after-deletion): Adjust documentation.
* etc/NEWS: Announce the change.

2 years agoFix `python-nav-beginning-of-defun' line continuation using backslash
kobarity [Sun, 3 Jul 2022 12:22:13 +0000 (14:22 +0200)]
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.

2 years ago* lisp/dired-x.el (dired-omit-size-limit): Increase value.
Stefan Kangas [Sun, 3 Jul 2022 12:20:34 +0000 (14:20 +0200)]
* lisp/dired-x.el (dired-omit-size-limit): Increase value.

2 years agoMake string-limit with encoding return complete glyphs
Lars Ingebrigtsen [Sun, 3 Jul 2022 12:05:01 +0000 (14:05 +0200)]
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.

2 years agoImprove performance when rejecting XI touch event
Po Lu [Sun, 3 Jul 2022 11:48:55 +0000 (19:48 +0800)]
Improve performance when rejecting XI touch event

* src/xterm.c (handle_one_xevent): Avoid sync handling simple
error.

2 years agoFix streaming problems in nnimap-retrieve-headers
Lars Ingebrigtsen [Sun, 3 Jul 2022 10:57:29 +0000 (12:57 +0200)]
Fix streaming problems in nnimap-retrieve-headers

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

2 years agoAdd new function `seq-split'
Lars Ingebrigtsen [Sun, 3 Jul 2022 10:55:00 +0000 (12:55 +0200)]
Add new function `seq-split'

* doc/lispref/sequences.texi (Sequence Functions): Document it.

* lisp/emacs-lisp/seq.el (seq-split): New function.

* lisp/emacs-lisp/shortdoc.el (sequence): Mention it.

2 years agoelec-pair: Fix bug incorrectly hiding syntax-propertize-function
Allen Li [Sun, 3 Jul 2022 10:31:15 +0000 (12:31 +0200)]
elec-pair: Fix bug incorrectly hiding syntax-propertize-function

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

2 years ago; * src/xfaces.c (Finternal_set_lisp_face_attribute): Fix last change.
Eli Zaretskii [Sun, 3 Jul 2022 10:22:42 +0000 (13:22 +0300)]
; * src/xfaces.c (Finternal_set_lisp_face_attribute): Fix last change.

2 years agoImprove efficiency of `x_frame_highlight' and `x_frame_unhighlight'
Po Lu [Sun, 3 Jul 2022 09:51:55 +0000 (17:51 +0800)]
Improve efficiency of `x_frame_highlight' and `x_frame_unhighlight'

* src/xterm.c (x_frame_highlight, x_frame_unhighlight): Don't
sync catching errors.

2 years ago* lisp/dired.el (dired-do-eww): New command.
Stefan Kangas [Sun, 3 Jul 2022 09:44:04 +0000 (11:44 +0200)]
* lisp/dired.el (dired-do-eww): New command.