1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-29 02:02:50 -07:00
Commit graph

181555 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
261f4a012e (subr-error-API): New test. Also, improve the etc/NEWS
* test/lisp/subr-tests.el (subr-error-API): New test.
2026-03-11 12:39:14 -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
6d8b3d1077 test subdirectory: Use new error-API
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--run-maybe-unsupported-function): Remove dummy branch in
`condition-case`.
* test/lisp/arc-mode-tests.el (define-arc-mode-test-on-type):
Use `error-slot-value`.

* test/src/process-tests.el (process-tests--ignore-EMFILE):
* test/src/filelock-tests.el (filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled):
* test/lisp/vc/vc-git-tests.el (vc-git-test--run):
* test/lisp/proced-tests.el (proced--assert-process-valid-cpu-refinement):
* test/lisp/emacs-lisp/pp-tests.el (pp-tests--sanity):
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env)
(edebug-tests-post-command):
* test/lisp/autorevert-tests.el (auto-revert--deftest-remote):
* test/infra/android/test-controller.el (ats-connect):
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
Sean Whitton
a9432736f7 newcomers-presets: Drop after-save-hook entry
* etc/themes/newcomers-presets-theme.el
(newcomers-presets-mode-enabled-local-modes): Remove
executable-make-buffer-file-executable-if-script-p.
2026-03-09 20:27:10 +00: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
a129354933 newcomers-presets: Always show the tab bar
* etc/themes/newcomers-presets-theme.el (newcomers-presets): Set
tab-bar-show to 0.
2026-03-09 11:41:22 +00: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
Yuan Fu
320e33a85f
Ensure c-ts-mode tests are never stuck (bug#80565)
* test/lisp/progmodes/c-ts-mode-tests.el: Don't prompt for
installing cpp grammar when they're not installed.
2026-03-08 22:53:48 -07: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
618653aed0 ; * doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed): Fix last change. 2026-03-08 14:57:34 +02:00
Eli Zaretskii
468dad2c5a Use images in Emacs Lisp Intro manual (bug#80519)
* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed)
(Symbols as Chest, kill-ring-yank-pointer, lambda): Use @image and
remove ASCII-art diagrams, which are now on separate *.txt files.
(header): Remove print-postscript-figures and its commentary.

* doc/lispintro/Makefile.in (auxfiles): New file list.
(${buildinfodir}/%.txt, ${buildinfodir}/%.png): New targets.
(${buildinfodir}/eintr.info): Depend on ${auxfiles}.
(infoclean): Remove ${auxfiles}.

* doc/lispintro/cons-1.png:
* doc/lispintro/cons-1.txt:
* doc/lispintro/cons-2.png:
* doc/lispintro/cons-2.txt:
* doc/lispintro/cons-2a.png:
* doc/lispintro/cons-2a.txt:
* doc/lispintro/cons-3.png:
* doc/lispintro/cons-3.txt:
* doc/lispintro/cons-4.png:
* doc/lispintro/cons-4.txt:
* doc/lispintro/cons-5.png:
* doc/lispintro/cons-5.txt:
* doc/lispintro/drawers.png:
* doc/lispintro/drawers.txt:
* doc/lispintro/lambda-1.png:
* doc/lispintro/lambda-1.txt:
* doc/lispintro/lambda-2.png:
* doc/lispintro/lambda-2.txt:
* doc/lispintro/lambda-3.png:
* doc/lispintro/lambda-3.txt: New files, from Matto Fransen
<matto@matto.nl>.
2026-03-08 14:51:13 +02: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
Pip Cet
f254b2cc19 Fix infloop when decoding incomplete embedded UTF-8 input
* src/coding.c (decode_coding_iso_2022): Record conversion result for
incomplete data.
2026-03-07 11:36:58 +00: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
cb583c737c ; * admin/authors.el (authors-aliases): Improve one entry. 2026-03-07 13:26:05 +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
Eli Zaretskii
06471a82c8 Fix segfaults in 'kbd_buffer_get_event'
* src/keyboard.c (kbd_buffer_get_event): Ignore selection-request
events when accessing the frame of an event.  Suggested by dick
r. chiang <dick.r.chiang@gmail.com>.  (Bug#80558)
2026-03-07 09:49:22 +02:00
Stéphane Marks
b7aca342e6 ; Move ns_init_colors from Fns_list_colors to emacs.c (bug#80377)
Support calls to ns_lisp_to_color or Fns_list_colors in headless
environments where ns_term_init is not called, and calls before
ns_term_init runs.

* src/emacs.c (main): Call ns_init_colors when not in dump mode.
* src/nsfns.m (ns_init_colors): Make public function.
(Fns_list_colors): Remove ns_init_colors call.
* src/nsterm.h: extern ns_init_colors.
2026-03-07 00:04:21 +00:00
Sean Whitton
64b0389a2c ; newcomers-presets: Fix adding to after-save-hook. 2026-03-06 14:37:18 +00: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
Eli Zaretskii
caca15a42d ; * doc/emacs/vc1-xtra.texi (General VC Options): Fix a typo. 2026-03-05 19:43:16 +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
a54e10baeb ; * doc/lispref/control.texi (Conditionals): Improve explanation. 2026-03-05 13:31:10 +00:00
Sean Whitton
b12190778c ; * doc/emacs/vc1-xtra.texi (General VC Options): Fix last change. 2026-03-05 13:29:31 +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
Eli Zaretskii
f398a4d299 ; Fix indexing in viper.texi.
* doc/misc/viper.texi: Fix weird use of indexing, whereby many
index entries were placed _after_ the table which described the
functions or variables or keys, or even in the end of a @node
describing some subject.  The index entries were moved to _before_
the text to which they pertain.  Also, fix some incorrect
cross-references.
2026-03-05 15:17:50 +02:00
Sean Whitton
bdc4a93535 ; Fix documentation of vc-command-messages. 2026-03-05 12:06:12 +00:00