1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-30 17:22:17 -07:00
Commit graph

99956 commits

Author SHA1 Message Date
Basil L. Contovounesios
8d356c55ad Tweak recent error descriptor changes
* etc/NEWS: Fix capitalization and markup.
* lisp/emacs-lisp/ert.el (ert--should-error-handle-error): Prefer
any over cl-some where either will do.
* lisp/epa-file.el (epa-file--find-file-not-found-function):
Reindent.
(epa-file--error-add-context): Use correct variables.  Add
docstring.
* lisp/ffap.el (ffap-machine-p):
* lisp/gnus/nnmaildir.el (nnmaildir--emlink-p): Prefer
string-equal-ignore-case over case fiddling.
* lisp/gnus/gnus-search.el (gnus-search-run-query): Fix typo in
error re-signaling.
* lisp/ibuffer.el (ibuffer-confirm-operation-on): Prefer string
search over regexp matching where either will do.
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--run-maybe-unsupported-function): Pacify unused
condition-case error variable warnings (bug#72212).
2026-03-11 16:05:04 -04:00
Stefan Monnier
fa6f2cb63c (error-data): Delete function
Remove `error-data` from the new error API: it is not really
compatible with a more abstract view of error descriptors, and
in practice it seems to be used only in two ways (both of them rare):

- To add some contextual info to an error.  We should maybe add
  a dedicated support for that, but it's not clear what shape it
  should take, ideally (there was a discussion about with Alan
  and myself in emacs-devel a few years ago).
- To do some other massaging whose correctness is dubious anyway.

* doc/lispref/control.texi (Handling Errors): Remove `error-data`.

* lisp/epa-file.el (epa-file--find-file-not-found-function): Don't use
`error-data`.
(epa-file--error-add-context): New function, extracted from
`epa-file-insert-file-contents`.
(epa-file-insert-file-contents): Use it instead of `error-data`.

* lisp/subr.el (error-data): Delete function.
2026-03-10 10:48:22 -04:00
Stefan Monnier
9348c19b82 Use single-arg form of signal to re-throw an error
* lisp/vc/smerge-mode.el (smerge-extend):
* lisp/vc/diff-mode.el (diff-beginning-of-file-and-junk):
* lisp/transient.el (transient--with-emergency-exit):
* lisp/textmodes/tex-mode.el (latex-forward-sexp):
* lisp/tar-mode.el (tar-mode):
* lisp/savehist.el (savehist--reload):
* lisp/progmodes/octave.el (inferior-octave-resync-dirs):
* lisp/progmodes/js.el (js--re-search-forward):
* lisp/plstore.el (plstore--decrypt):
* lisp/net/dbus.el (dbus-ignore-errors, dbus-register-signal)
(dbus-handle-event):
* lisp/mouse.el (mouse-drag-track, mouse-drag-region-rectangle):
* lisp/minibuffer.el (completion-pcm--find-all-completions):
* lisp/mail/rfc2231.el (rfc2231-parse-string):
* lisp/mail/rfc2047.el (rfc2047-encode-region):
* lisp/jit-lock.el (jit-lock-fontify-now):
* lisp/international/ja-dic-utl.el (skkdic-lookup-key):
* lisp/gnus/nnselect.el (nnselect-generate-artlist):
* lisp/gnus/mml-sec.el (mml-secure-epg-encrypt, mml-secure-epg-sign):
* lisp/gnus/mail-source.el (mail-source-fetch-pop)
(mail-source-check-pop):
* lisp/gnus/gnus-art.el (gnus-article-read-summary-keys):
* lisp/files.el (basic-save-buffer-2, files--ensure-directory)
(files--force, copy-directory):
* lisp/eshell/esh-io.el (eshell-output-object-to-target):
* lisp/epa.el (epa-decrypt-file, epa-verify-file, epa-sign-file)
(epa-encrypt-file, epa-decrypt-region, epa-verify-region)
(epa-sign-region, epa-encrypt-region, epa-delete-keys)
(epa-export-keys, epa-insert-keys):
* lisp/emacs-lisp/package.el (package--unless-error):
* lisp/emacs-lisp/multisession.el (multisession--read-file-value):
* lisp/emacs-lisp/lisp.el (up-list-default-function):
* lisp/desktop.el (desktop-kill):
* lisp/calendar/time-date.el (date-to-time):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calc/calc.el (calc-do):
* lisp/bookmark.el (bookmark-handle-bookmark):
* src/fileio.c (report_file_errno):
* lisp/vc/vc.el (vc-checkout, vc-pull): Use `(signal err)` instead
of `(signal (car err) (cdr err))`.
2026-03-10 10:48:22 -04:00
Stefan Monnier
08e109d45a Use the new error API functions
* lisp/epa-file.el (epa-file--find-file-not-found-function):
Use `error-slot-value` and `error-data`.
(epa-file-insert-file-contents): Use `error-has-type-p`,
`error-slot-value`, and `error-data`.

* lisp/jka-compr.el (jka-compr-insert-file-contents):
Use `error-has-type-p` and `error-slot-value` as well as new
re-signaling form of `signal`.

* lisp/simple.el (minibuffer-error-function): Use `error-has-type-p`.

* lisp/startup.el (startup--load-user-init-file):
Use `error-message-string`.
(command-line): Use `error-has-type-p` and `error-message-string`.

* lisp/type-break.el (type-break-demo-life):
Use `error-message-string`.

* lisp/emacs-lisp/bytecomp.el (batch-byte-compile-file):
Use `error-message-string` and `error-has-type-p`.

* lisp/emacs-lisp/edebug.el (edebug-safe-eval, edebug-report-error)
(edebug-eval-expression):
* lisp/emacs-lisp/debug.el (debugger-eval-expression):
Use `error-message-string`.

* lisp/emacs-lisp/ert.el (ert--should-error-handle-error):
Use `error-has-type-p` and `error-type`.

* lisp/net/sasl.el (sasl-error): Use `define-error`.

* lisp/net/tramp-compat.el (tramp-error-type-p): New function.
(tramp-permission-denied, tramp-compat-permission-denied): Use it.

* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Use `error-type-p`.

* lisp/xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal): Use `error-slot-value`.

* lisp/simple.el (next-line, previous-line): Remove useless
`condition-case` handler, and hence the whole `condition-case`, and
then simplify.

* lisp/gnus/nnrss.el (nnrss-insert): Use `with-demoted-errors`.

* lisp/gnus/nnmaildir.el (nnmaildir--emlink-p, nnmaildir--enoent-p)
(nnmaildir--eexist-p): Use `error-has-type-p`.
(nnmaildir--new-number, nnmaildir-request-set-mark): Use single-arg
`signal`.

* lisp/ffap.el (ffap-machine-p): Use `error-slot-value`.

* lisp/emacs-lisp/comp.el (comp--native-compile):
Use `error-has-type-p` as well as single-arg `signal`.

* lisp/net/ange-ftp.el (ange-ftp-hook-function): Use single-arg
`signal`.

* lisp/ebuff-menu.el (electric-buffer-menu-looper): Use `error-has-type-p`.
* lisp/progmodes/ebrowse.el (ebrowse-electric-list-looper):
Use `error-has-type-p`.
(ebrowse-electric-position-looper): Make it an alias of
`ebrowse-electric-list-looper`.

* lisp/ibuffer.el (ibuffer-confirm-operation-on):
* lisp/ls-lisp.el (ls-lisp--insert-directory):
* lisp/gnus/gnus-search.el (gnus-search-run-query):
* lisp/mail/mail-extr.el (mail-extr-safe-move-sexp):
* lisp/net/dbus.el (dbus-set-property):
* lisp/net/eudc-export.el (eudc-bbdbify-phone):
* lisp/net/imap.el (imap-fetch-safe):
* lisp/vc/vc.el (vc-root-dir): Use `error-slot-value` and
single-arg `signal` to re-signal.
2026-03-10 10:48:21 -04:00
Stefan Monnier
a1358530f5 Improve the error API
Define new functions to manipulate error descriptors and
add support for `signal` to *re*signal a previous error.

 * src/eval.c (Fsignal): Make the second arg optional and document
the possibility of passing a whole error descriptor to re-signal it.
(signal_or_quit): Fix a few corner case issues when
DATA is `nil` and ERROR_SYMBOL is an error descriptor.

* lisp/subr.el (error-type-p, error--p, error-type, error-data)
(error-has-type-p, error-slot-value): New function.

* doc/lispref/control.texi (Handling Errors): Prefer "error descriptor"
to "error description".  Use the new single-arg call to `signal` to
re-throw an error.
Document `error-type`, `error-data` and `error-slot-value`.
(Error Symbols): Document the new functions `error-type-p` and
`error-has-type-p`.
2026-03-10 10:48:10 -04:00
Stefan Monnier
ea5f15d096 Fix signal calls where the data argument is not a list
* test/src/thread-tests.el (threads-join-error):
* test/src/emacs-module-resources/mod-test.c (Fmod_test_signal):
* src/print.c (print_bind_overrides):
* lisp/url/url-future.el (url-future-finish, url-future-errored)
(url-future-call, url-future-cancel): Make sure signal's data is a list.

* test/src/emacs-module-tests.el (mod-test-non-local-exit-signal-test):
Adjust accordingly.
2026-03-10 00:13:31 -04:00
Stefan Monnier
3118a8c8b1 Error handling clarifications found during error-API
* lisp/simple.el (next-line, previous-line): Remove useless
`condition-case` handler, and hence the whole `condition-case`, and
then simplify.

* lisp/emacs-lisp/comp.el (comp--error-add-context): New function.
(comp--native-compile): Use it.

* lisp/gnus/nnrss.el (nnrss-insert): Use `with-demoted-errors`.
2026-03-10 00:10:36 -04:00
Dmitry Gutov
ab47eadb60 ; Bump flymake's version again, to 1.4.5 2026-03-09 21:09:13 +02:00
Eli Zaretskii
c108a28203 Fix 'emacs-news-find-heading'
* lisp/textmodes/emacs-news-mode.el (emacs-news-find-heading):
HEADING must be a complete line, otherwise we have false positives
and false negatives.  (Bug#80569)
2026-03-09 19:14:51 +02:00
Stephen Gildea
82b5656276 * lisp/time-stamp.el (time-stamp-warn-inactive): Doc string. 2026-03-09 09:20:12 -07:00
Sean Whitton
89dbc92137 Restore use of cl-member-if and cl-plusp to flymake.el
* lisp/progmodes/flymake.el (flymake-goto-next-error): Use
cl-member-if not member-if and cl-plusp not plusp because this
is a `:core' ELPA package (bug#79930).
2026-03-09 11:37:24 +00:00
Dmitry Gutov
cc5ec44118 Fix Non-existent commands in flymake-diagnostics-buffer-mode-map
* lisp/progmodes/flymake.el (flymake-diagnostics-buffer-mode-map):
Only bind 'n' and 'p' when 'next-error-this-buffer-no-select' is
defined.  For releasing on ELPA (bug#79930).
Bump the package version to 1.4.4.
2026-03-09 04:35:04 +02:00
Philip Kaludercic
a3dda7e525
Mention newcomers theme on 'normal-mouse-startup-screen'
* lisp/startup.el (startup-insert-newcomers-theme): Factor out
new function from 'normal-no-mouse-startup-screen'.
(normal-mouse-startup-screen, normal-no-mouse-startup-screen):
Call new function.
2026-03-08 19:35:53 +01:00
Stefan Monnier
d6fa21c1f5 cl-seq.el: Prefer :test to :if
* lisp/emacs-lisp/cl-seq.el (cl-remove-if, cl-remove-if-not)
(cl-delete-if, cl-delete-if-not, cl-substitute-if)
(cl-substitute-if-not, cl-nsubstitute-if, cl-nsubstitute-if-not)
(cl-find-if, cl-find-if-not, cl-position-if, cl-position-if-not)
(cl-count-if, cl-count-if-not, cl-member-if, cl-member-if-not)
(cl-assoc-if, cl-assoc-if-not, cl-rassoc-if, cl-rassoc-if-not)
(cl-subst-if, cl-subst-if-not, cl-nsubst-if, cl-nsubst-if-not):
Prefer the Common Lisp standard `:test` to the cl-lib specific `:if`.
2026-03-08 14:20:44 -04:00
Eli Zaretskii
139fb8423f ; Fix documentation of 'emacs-news-mode' commands
* lisp/textmodes/emacs-news-mode.el (emacs-news-next-untagged-entry)
(emacs-news-previous-untagged-entry, emacs-news-cycle-tag)
(emacs-news-count-untagged-entries, emacs-news-goto-section)
(emacs-news-find-heading, emacs-news-open-line)
(emacs-news-delete-temporary-markers): Doc fixes.  (Bug#80569)
2026-03-08 20:12:17 +02:00
Stefan Monnier
f36b6536b0 iso-transl.el: Revert cosmetic change
* lisp/international/iso-transl.el (iso-transl-char-map):
Re-add ineffective backslashes removed in in previous patch.
2026-03-08 12:02:08 -04:00
Sean Whitton
b27a9d4bbb ; recentf-exclude-file-by-extension-p: Restore and-let*. 2026-03-08 14:55:23 +00:00
Sean Whitton
467069635b * lisp/textmodes/fill.el (unfill-paragraph): Fix for wide chars. 2026-03-08 14:55:10 +00:00
shynur
39cdf4726c * lisp/files.el (auto-mode-alist): Recognize /etc/profile as sh. 2026-03-08 14:54:30 +00:00
Eli Zaretskii
bb7e993734 Fix mpuz under text-scaling
* lisp/play/mpuz.el (mpuz-switch-to-window): Don't unconditionally
turn on 'mpuz-mode', as that kills all local variables.  (Bug#80567)
2026-03-08 12:00:53 +02:00
Stefan Monnier
ba34e44cf3 iso-transl.el: Remove ineffective backslashes in previous patch
* lisp/international/iso-transl.el (iso-transl-char-map):
Remove ineffective backslashes in previous patch.
2026-03-07 11:46:24 -05:00
Eli Zaretskii
1e07e6083c Add "C-x 8" commands for letters with breeve
* lisp/international/iso-transl.el (iso-transl-char-map): Add
Latin letters with breve.  (Bug#80515)
2026-03-07 15:39:51 +02:00
kobarity
b9b59447a1 Improve Python setup codes to avoid leaving global names
* lisp/progmodes/python.el (python-shell-setup-code)
(python-shell-readline-detect): Improve Python code.  (Bug#80551)
2026-03-07 13:32:11 +02:00
Eli Zaretskii
a9eac78e23 Improve documentation of 'define-keymap'
* lisp/emacs-lisp/shortdoc.el (keymaps): Add example for adding
key bindings to an existing keymap.
* lisp/keymap.el (define-keymap): Doc fix.  (Bug#80556)
2026-03-07 10:55:23 +02:00
Michael Albinus
422c3665ad * lisp/recentf.el (recentf-exclude-file-by-extension-p): Fix thinko. 2026-03-06 12:16:49 +01:00
Martin Rudalics
8034e48630 Additional fixes for 'get-mru-frame' (Bug#80397)
* src/frame.c (delete_frame): Call 'get-mru-frame' safely and
with EXCLUDE-FRAME argument set up correctly.
* lisp/frame.el (get-mru-frames, get-mru-frame): Fix doc-strings.
2026-03-06 09:51:21 +01:00
Eli Zaretskii
5c1ef38b5b Fix last change in recentf.el
* lisp/recentf.el (recentf-exclude-ignored-extensions): Doc fix.
(recentf-exclude-file-by-extension-p): Rename from
`recentf-exclude-ignored-extensions'; all references changed.
Doc fix.

* etc/NEWS: Improve wording of the entry which announces the
above.
2026-03-06 09:08:03 +02:00
Philip Kaludercic
c86b60c214
Mention newcomer theme on "no-mouse" splash screen
* lisp/startup.el (normal-no-mouse-startup-screen): Add a button
to toggle the "newcomers-presets" theme.
2026-03-05 22:18:16 +01:00
Stéphane Marks
81d2a7a2f5
New user option and function 'recentf-exclude-ignored-extensions'
* lisp/recentf.el (recentf-exclude-ignored-extensions): New
user option.
(recentf-exclude-ignored-extensions): New function.
* etc/NEWS: Announce the new option and function.

(Bug#80347)
2026-03-05 22:08:44 +01:00
Eli Zaretskii
a7517d6ef8 ; Fix documentation of a recently added user option
* lisp/vc/vc-dispatcher.el (vc-display-failed-async-commands): Doc
fix.  Add a :version tag.
2026-03-05 19:48:46 +02:00
Sean Whitton
d7fda971f1 unfill-paragraph: Reimplement in terms of fill-region
* lisp/textmodes/fill.el (unfill-paragraph): Reimplement in
terms of fill-region.
2026-03-05 16:14:43 +00:00
Sean Whitton
39abb7ec8f ; Move unfill-paragraph to fill.el. Document it in (elisp)Filling. 2026-03-05 15:48:03 +00:00
Sean Whitton
8d16a0557d New user option vc-display-failed-async-commands
* lisp/vc/vc-dispatcher.el (vc-display-failed-async-commands):
New user option.
(vc-do-async-command): Use it.
* doc/emacs/vc1-xtra.texi (General VC Options):
* etc/NEWS: Document it.
* lisp/vc/vc-dispatcher.el (vc-do-command): Adjust message to
begin "Failed" not "Done" when command exits non-zero.
* lisp/vc/vc.el (vc-checkin): Adjust message to end in
"...failed" not "...done" when async command exits non-zero.
2026-03-05 13:24:27 +00:00
Sean Whitton
d0ab336906 vc-do-command: Tidy up some messaging
* lisp/vc/vc-dispatcher.el (vc--inhibit-message): New defvar,
replacing the undeclared vc-inhibit-message.  All uses changed.
(vc--command-message): New function, factored out.
(vc-do-command): Call it.
2026-03-05 12:01:51 +00:00
Stéphane Marks
192d4fc1f7 Make 'frame-use-time' more reliable. (bug#80397)
Walking the window tree is more reliable than using the selected
window.  Implement 'get-mru-frame' on top of 'get-mru-frames'
using 'frame-use-time'.

* lisp/frame.el (frame-use-time): Change to walk the window tree
for the specified frame.
(get-mru-frames): New defun.
(get-mru-frame): Change to call 'get-mru-frames'.
* doc/lispref/frames.texi: Update documentation.
* etc/NEWS: Update announcement.
2026-03-05 09:58:03 +01:00
Stefan Monnier
8f8d28f6dc (flymake-start): Give a bit more info in the log
* lisp/progmodes/flymake.el (flymake-start): Log the reason why
it's disabled when not starting a backend.
2026-03-04 09:44:27 -05:00
Sean Whitton
7d63d267f2 Rename 'any' to 'member-if' and deprecate 'cl-member-if'
* lisp/subr.el (any): Rename from this ...
(member-if): ... to this.  All uses changed.
(any): New function alias.
* lisp/emacs-lisp/cl-seq.el (cl-member-if): Mark obsolete.
* lisp/obsolete/cl.el (member-if): Delete obsolete function
alias.
* doc/lispref/lists.texi (List Elements):
* doc/misc/cl.texi (Lists as Sets):
* etc/NEWS: Document the change.
2026-03-04 14:43:05 +00:00
Sean Whitton
4ce94139ae New command 'unfill-paragraph'
* lisp/simple.el (unfill-paragraph): New command.
* doc/emacs/indent.texi (Indentation Commands):
* etc/NEWS: Document it.
2026-03-04 14:20:47 +00:00
Sean Whitton
9cc95aef58 ; * lisp/vc/vc.el (vc-print-change-log): Fix last change. 2026-03-04 10:35:24 +00:00
Stéphane Marks
8eacee314d In 'frame--purify-parameters' fix frame-inherited-parameters (Bug#80536)
* lisp/frame.el (frame--purify-parameters):
'frame-inherited-parameters' is a parameter list, not an alist.
2026-03-04 09:42:22 +01:00
Mattias Engdegård
7eba545a4e Revert "Rename 'any' to 'member-if' and deprecate 'cl-member-if'"
This reverts commit 2bdf15f6d8.

There is no consensus for this change.
2026-03-03 17:21:35 +01:00
Michael Albinus
72a1bda759 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2026-03-03 16:59:23 +01:00
Filipp Gunbin
8670baf06b ; Fix docstring of vc-print-root-change-log 2026-03-03 18:55:49 +03:00
Stefan Monnier
cdcbb52f50 eglot.el: Avoid %s for composite objects
* lisp/progmodes/eglot.el (eglot--check-object, eglot--check-dspec)
(eglot-shutdown-all, eglot--connect, eglot--lsp-position-to-point)
(eglot--read-server, eglot-handle-notification, eglot-handle-request):
Avoid `%s` for composite objects.
(eglot--connect, eglot--format): Use `fboundp` rather than `functionp`
to check if something is defined.
(eglot--sig-info): Prefer `point-min`.
2026-03-03 10:17:17 -05:00
Manuel Giraud
d272dedf8c Add mirroring for special glyphs (bug#80440)
See initial discussion here:
https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00400.html

* lisp/international/characters.el (pairs): Populate
special-mirror-table.
* src/xdisp.c (produce_special_glyphs): Add two arguments.  One
to identify the paragraph direction and one to identify that the
glyph is produced on the left hand side of a window.  Mirror
glyph defined in the display table according to the new
special-mirror-table.  Bidi mirroring always takes precedence.
(init_iterator, insert_left_trunc_glyphs, display_line)
(display_string): Call 'produce_special_glyphs' with new arguments.
(syms_of_xdisp) <special-mirror-table>: New char-table.
* etc/NEWS: Announce the change.
2026-03-03 16:24:58 +02:00
Alan Mackenzie
b5e2b0bec1 CC Mode: Handle mixed symbols and non-symbols in regexps
This fixes bug#80507.

* lisp/progmodes/cc-defs.el (c-make-keywords-re): When a mixed list
of symbols and non-symbols is presented to this function, put
"\_< .... \_>" brackets around the part which handles the symbols
in the resulting regexp.
2026-03-03 16:19:16 +02:00
Sean Whitton
7059bb160e Fix respecting vc-log-show-limit with new -change-log commands
* lisp/vc/vc.el (vc-print-change-log, vc-print-root-change-log):
Respect vc-log-show-limit when there is no prefix argument (bug#80532).
2026-03-03 14:00:39 +00:00
Sean Whitton
2bdf15f6d8 Rename 'any' to 'member-if' and deprecate 'cl-member-if'
* lisp/subr.el (any): Rename from this ...
(member-if): ... to this.  All uses changed.
Implement '&key KEY-FN' for backwards compatibility.
(any): New function alias.
* lisp/emacs-lisp/cl-seq.el (cl-member-if): Make an alias for
'member-if'.
* lisp/obsolete/cl.el (member-if): Delete obsolete function
alias.
* doc/lispref/lists.texi (List Elements):
* doc/misc/cl.texi (Lists as Sets):
* etc/NEWS: Document the change.
2026-03-03 13:57:07 +00:00
Sean Whitton
d9611a7686 ; Tweak splash screen some more. Fix some punctuation. 2026-03-03 12:06:39 +00:00
Sean Whitton
d84c4e8346 dired-diff: Fix default input in inserted subdirectory
* lisp/dired-aux.el (dired-diff): Use default-directory, not
dired-current-directory, to determine whether the default input
is in another directory (bug#80497).  Use a relative file name
to improve readability.
2026-03-03 11:10:18 +00:00