Commit graph

8293 commits

Author SHA1 Message Date
Stefan Kangas
09674074b5 ; Fix typos 2022-05-15 11:15:06 +02:00
Stefan Kangas
a0af789d06 Remove some XEmacs compat code for display-graphic-p
* lisp/dframe.el (dframe-have-timer-flag):
* lisp/emacs-lisp/chart.el (chart-face-pixmap-list):
* lisp/speedbar.el (speedbar-easymenu-definition-base): Remove
XEmacs compat code; assume display-graphic-p is fboundp.

* lisp/progmodes/cperl-mode.el (cperl-tags-hier-init): Remove XEmacs
compat code.
2022-05-15 01:10:11 +02:00
Eli Zaretskii
3d2cd8b779 Make 'check-declare-directory' more portable
* lisp/emacs-lisp/check-declare.el (check-declare-directory): Use
'directory-files-recursively' instead of running Find and Grep in
a subprocess.  (Bug#55386)
2022-05-14 19:08:55 +03:00
Eli Zaretskii
640e52d8fa ; Fix mistakes in 'declare function' forms
* lisp/progmodes/gdb-mi.el (tooltip-show):
* lisp/vc/vc-git.el (grep-expand-template):
* lisp/cedet/semantic/imenu.el (pulse-momentary-highlight-one-line):
* lisp/mail/feedmail.el (smtpmail-via-smtp):
* lisp/mail/rmail.el (rmail-mime-entity-truncated):
* lisp/mail/rmailsum.el (rmail-cease-edit):
* lisp/progmodes/gud.el (speedbar-toggle-line-expansion)
(speedbar-edit-line):
* lisp/autoinsert.el (sgml-tag):
* lisp/comint.el (url-host, url-type, url-filename):
* lisp/progmodes/elisp-mode.el (xref-make, xref-item-location):
* lisp/vc/vc-hooks.el (vc-responsible-backend):
* lisp/cedet/semantic/complete.el (tooltip-show):
* lisp/doc-view.el (tooltip-show):
* lisp/follow.el (mwheel-scroll):
* lisp/term/pgtk-win.el (pgtk-set-resource):
* lisp/progmodes/cperl-mode.el (Info-find-node):
* lisp/lpr.el (print-region-function):
* lisp/w32-fns.el (w32-version, w32-read-registry):
* lisp/emacs-lisp/checkdoc.el (ispell-correct-p, checkdoc-dired):
* lisp/progmodes/xref.el (apropos-parse-pattern):
* lisp/cus-edit.el (apropos-parse-pattern):
* lisp/obsolete/gs.el (x-change-window-property):
* lisp/x-dnd.el (x-change-window-property):
* lisp/xwidget.el (make-xwidget):
* lisp/transient.el (info, Man-find-section, Man-next-section)
(Man-getpage-in-background):
* lisp/frame.el (x-device-class, pgtk-device-class):
* lisp/textmodes/texinfo.el (flymake--log-1):
* lisp/term/x-win.el (x-internal-focus-input-context): Fix
'declare function' errors uncovered by 'check-declare'.
2022-05-14 16:19:12 +03:00
Eli Zaretskii
9a67e83bd6 Fix undigest-tests on MS-Windows
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Accept a new
keyword argument :coding CODING to use as the encoding when
writing initial text to the temporary file.

* test/lisp/mail/undigest-tests.el (rmail-undigest-test-rfc934-digest)
(rmail-undigest-test-rfc1153-digest-strict)
(rmail-undigest-test-rfc1153-less-strict-digest)
(rmail-undigest-test-rfc1153-sloppy-digest)
(rmail-undigest-test-rfc1521-mime-digest)
(rmail-undigest-test-multipart-mixed-digest): Force the temporary
mbox files to have Unix-style EOL format.
2022-05-14 11:30:54 +03:00
Lars Ingebrigtsen
221031b4ff Tweak querying in package-update-all
* lisp/emacs-lisp/package.el (package-update-all): Reverse the
QUERY logic to make calling more regular.
2022-05-14 03:10:46 +02:00
Lars Ingebrigtsen
dea41d4c24 Add new minor mode `header-line-indent-mode'
This is mostly factored out from tabulated-list.el (with bugs fixed).

* doc/lispref/modes.texi (Header Lines): Document it.
* lisp/display-line-numbers.el (header-line-indent): New variable.
(header-line-indent--line-number-width)
(header-line-indent--watch-line-number-width)
(header-line-indent--window-scroll-function): New helper functions.
(header-line-indent-mode): New minor mode.

* lisp/display-line-numbers.el (header-line-indent-width): New
variable.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width)
(tabulated-list-watch-line-number-width)
(tabulated-list-window-scroll-function): Make into obsolete aliases.
(tabulated-list-mode): Use 'header-line-indent-mode'.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
Adjust the header line format and computation.

* src/buffer.c (syms_of_buffer): Mention header-line-indent-mode.
2022-05-13 21:24:12 +02:00
Lars Ingebrigtsen
2ec9f025d2 Include the number of dependencies in the install prompt
* lisp/emacs-lisp/package.el (package-menu--list-to-prompt): Add
the info to the prompt (bug#23346).
(package--dependencies): New function.
2022-05-13 15:31:13 +02:00
Lars Ingebrigtsen
dce5642e86 Allow calling package-update-all from the command line
* lisp/emacs-lisp/package.el (package-update-all): Allow calling from
  the command line with -f package-update-all without any queries.
2022-05-13 15:05:14 +02:00
Lars Ingebrigtsen
42001f843b New command 'package-update-all'
* lisp/emacs-lisp/package.el (package-update-all): New function
(bug#19146).
(package--updateable-packages): Factored out...
(package-update): ... from here.
2022-05-12 03:59:39 +02:00
Stefan Monnier
ed0b589480 (byte-compile-eval): Avoid some false positive "noruntime" warnings
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Loosen the check
before refraining from adding a function to noruntime.
2022-05-11 17:17:10 -04:00
Lars Ingebrigtsen
ed1a24b4b2 Don't signal errors in check-declare-directory
* lisp/emacs-lisp/check-declare.el (check-declare-directory): Don't
bug out if we don't find any files with declare-function:(bug#55354)
because this is a predicate function, and that's inconvenient.
2022-05-11 14:18:27 +02:00
Lars Ingebrigtsen
231cf5ee2b Warn about quoted symbols in defcustom choice/other forms
* lisp/emacs-lisp/bytecomp.el
(byte-compile--suspicious-defcustom-choice): New function (bug#16271).
(byte-compile-nogroup-warn): Use it to warn about forms like
(choice (const :tag "foo" 'bar)).
2022-05-11 12:51:11 +02:00
Lars Ingebrigtsen
4c4eda4c31 Make imenu find defalias entries
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
Also find defalias (bug#7855).
2022-05-10 04:41:43 +02:00
João Távora
d377b39643 Allow non-interactive use of eldoc-doc-buffer
* lisp/emacs-lisp/eldoc.el (eldoc-doc-buffer): Allow
non-interactive use.
(Version): Bump minor.
2022-05-09 12:51:24 +01:00
Stefan Monnier
b03d6265cd * lisp/emacs-lisp/oclosure.el (oclosure-define): Fix empty case 2022-05-08 10:33:49 -04:00
Lars Ingebrigtsen
c56070beb6 Make `x' in package-menu-mode more DWIM
* lisp/emacs-lisp/package.el (package-menu-mode): Make the doc
string more helpful.
(package-menu-execute): Make `x' when no files are installed DWIM.
2022-05-07 14:31:42 +02:00
Lars Ingebrigtsen
0b3b295776 Make down-list signal an error if called inside a string
* lisp/emacs-lisp/lisp.el (down-list): Signal an error inside a
string (bug#5588).
2022-05-06 21:13:54 +02:00
Stefan Monnier
7deaa2e36b * lisp/emacs-lisp/smie.el (smie-auto-fill): Fix bug#19342 2022-05-06 11:09:58 -04:00
Lars Ingebrigtsen
1cda7cfb39 Respect help-window-keep-selected in shortdoc buttons
* lisp/help-fns.el (help-fns--mention-shortdoc-groups): Respect
help-window-keep-selected.

* lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Allow
reusing the window.
2022-05-06 16:21:07 +02:00
Lars Ingebrigtsen
afc14e4f66 Move buffer-local-set-state to subr because it's used at runtime
* lisp/subr.el (buffer-local-set-state)
(buffer-local-set-state--get, buffer-local-restore-state): Moved
from easy-mmode.el because they have to be available run-time.
2022-05-06 16:09:38 +02:00
Eli Zaretskii
92bbe911e9 ; Improve documentation of 'buffer-local-set-state'
* lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state)
(buffer-local-restore-state): Doc fixes.

* doc/lispref/modes.texi (Defining Minor Modes): Fix a typo and
improve wording and indexing.
2022-05-06 15:15:27 +03:00
Lars Ingebrigtsen
b6bced1a66 Autoload the buffer-local-set* things
* lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state--get)
(buffer-local-restore-state): Autoload.  Perhaps it would be
better to move these functions to subr.el or something...
2022-05-06 13:20:47 +02:00
Lars Ingebrigtsen
b13356487f Add new helper macros for minor modes to restore variables
* doc/lispref/modes.texi (Defining Minor Modes): Document it.

* lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state): New macro.
(buffer-local-set-state--get): Helper function.
(buffer-local-restore-state): New function.

* lisp/textmodes/word-wrap-mode.el (word-wrap-whitespace-mode):
Use it to simplify code.
2022-05-06 13:10:45 +02:00
James N. V. Cash
7e9d364b66 * lisp/emacs-lisp/crm.el: Set completion-list-insert-choice-function.
* lisp/emacs-lisp/crm.el (completing-read-multiple): Set buffer-local
completion-list-insert-choice-function that handles string values of args.
https://lists.gnu.org/archive/html/emacs-devel/2022-05/msg00017.html
2022-05-05 21:15:51 +03:00
Robert Pluim
eaa198cd75 ; Re-fix last change in doc of 'with-buffer-unmodified-if-unchanged'. 2022-05-04 14:53:34 +02:00
Eli Zaretskii
1a72248901 ; Fix last change in doc string of 'with-buffer-unmodified-if-unchanged'. 2022-05-04 13:08:53 +03:00
Eli Zaretskii
69521ffcb0 Clarify the doc string of 'with-buffer-unmodified-if-unchanged'
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Describe better what is meant by "buffer changes".  (Bug#4587)
2022-05-04 11:46:01 +03:00
Lars Ingebrigtsen
0a2f0e7f8c Make with-buffer-unmodified-if-unchanged more efficient
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Make more efficient.
2022-05-03 22:06:31 +02:00
Lars Ingebrigtsen
b7ddd0f2fd Make with-buffer-unmodified-if-unchanged more resilient
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Make more resilient.
2022-05-03 22:04:39 +02:00
Stefan Monnier
b5db5a6443 with-buffer-unmodified-if-unchanged: Tweak the implementation
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
Skip the hash if the buffer was not modified at all.
Use `restore-buffer-modified-p`.
Also mention that it's imperative that the current buffer is preserved.
2022-05-03 15:35:47 -04:00
Lars Ingebrigtsen
59353ec7b5 Add new macro with-buffer-unmodified-if-unchanged
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
New macro.
* lisp/textmodes/fill.el (fill-paragraph): Macro code copied from
here.  Adjust and use the macro.
2022-05-03 21:22:53 +02:00
Lars Ingebrigtsen
0916fd3aaa Add new command 'package-update'
* doc/emacs/package.texi (Package Installation): Mention it.
* lisp/emacs-lisp/package.el (package-update): New command
(bug#18790).
2022-05-03 18:00:32 +02:00
Lars Ingebrigtsen
bcdcaf0219 Make the eval-in-debug error message prettier in non-recursive errors
* lisp/emacs-lisp/debug.el (debugger-eval-expression): Make the
error message (when recursive debugging is off) prettier.
2022-05-02 13:59:11 +02:00
Lars Ingebrigtsen
f639fa9f9e Make non-recursive error messages in edebug prettier
* lisp/emacs-lisp/edebug.el (edebug-eval-expression): Make the
error message (when recursive debugging is off) prettier.
2022-05-02 13:55:56 +02:00
Lars Ingebrigtsen
7c8bec9e1f Don't enter the debugger from *Backtrace* or edebug on eval errors
* doc/lispref/debugging.texi (Error Debugging): Document it.

* doc/lispref/edebug.texi (Edebug Eval): Mention it.
* lisp/emacs-lisp/debug.el (debug-allow-recursive-debug): New user
option (bug#36145).
(debugger-eval-expression): Use it.

* lisp/emacs-lisp/edebug.el (edebug-eval-expression): Ditto.

This patch is based on a patch by Noam Postavsky.
2022-05-01 13:40:13 +02:00
Lars Ingebrigtsen
95dbe4b6ae Make load-path-shadows-mode a special mode
* lisp/emacs-lisp/shadow.el (load-path-shadows-mode): Make the
mode inherit from special-mode so that the `q' command works.
2022-04-30 20:34:35 +02:00
Lars Ingebrigtsen
b05a103ea7 Move the when-let family of macros to subr.el
* lisp/subr.el (internal--build-binding)
(internal--build-bindings): Moved from subr-x.el and rewritten to
not use the threading macro.
(if-let*, when-let*, and-let*, if-let, when-let): Moved from
subr-x.el.  This avoids breaking the build every time somebody
uses these macros in functions that end up being called during
bootstrap.
2022-04-30 16:42:44 +02:00
Stefan Monnier
08108a856a debug-early: Print bytecode in a more manageable way
* lisp/emacs-lisp/debug-early.el (debug-early-backtrace):
Escape newlines to and bytecodes to make backtraces slightly more
readable.  Use `cl-prin1` when available.
2022-04-29 22:18:09 -04:00
Stefan Monnier
73088b30cf * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add symbol-with-pos 2022-04-29 22:13:20 -04:00
Stefan Monnier
acc985ae7c CL types: Accept both byte-code-function and compiled-function
`type-of` returns `compiled-function` for bytecode functions, but the
predicate for those objects is called `byte-code-function-p`,
So accept both `compiled-function` and `byte-code-function` as type
names for those objects.

* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types):
Add `byte-code-function`.
* lisp/emacs-lisp/cl-macs.el (byte-code-function, compiled-function, subr):
New types.
2022-04-29 15:29:35 -04:00
Stefan Monnier
799c7e277f * lisp/emacs-lisp/nadvice.el: Fix bug#55149 2022-04-28 09:38:58 -04:00
Stefan Monnier
92e49944a3 nadvice.el: Auto-generate the doc describing the "how" arg
* lisp/emacs-lisp/nadvice.el (advice--make-how-alist): New macro.
(advice--how-alist): Use it.
(nadvice--make-docstring): New function.
(add-function, advice-add): Use it to auto-generate the table
describing the accepted values for `how`.
2022-04-26 17:36:13 -04:00
Stefan Monnier
f30625943e nadvice.el: Use OClosures
* lisp/emacs-lisp/nadvice.el (advice): New OClosure type.
(advice--how-alist): Make it hold prototype OClosures rather
than bytecode strings.
(advice--bytecodes): Delete var.
(advice--where): Make it an obsolete alias of new `advice--how`.
(oclosure-interactive-form, cl-print-object) <advice>: New methods.
(advice--make-1): Delete function.
(advice--make): Use `advice-copy` and `advice-cons`.
(advice--tweak): Use `advice-cons`.
(add-function, advice-add): Rename `where` arg to `how`.

* lisp/emacs-lisp/cl-print.el (cl-print-object) <:extra "nadvice">:
Remove now-redundant ad-hoc method.

* test/lisp/emacs-lisp/nadvice-tests.el (advice-test-print): New test.
2022-04-26 17:36:13 -04:00
Stefan Monnier
bc9be5449e nadvice.el: Rename "where" to "how"
* lisp/emacs-lisp/nadvice.el (advice--how-alist): Rename from
`advice--where-alist`.
(advice--how): Rename from `advice--where` and keep obsolete alias.
(add-function, advice-add): Rename `where` arg to `how`.
* lisp/emacs-lisp/cl-print.el (cl-print-object): Use `advice--how` name.
2022-04-26 17:36:13 -04:00
Stefan Monnier
4dba7c31a2 Use advice--cd*r where applicable
* lisp/emacs-lisp/bytecomp.el (byte-compile--function-signature):
* lisp/emacs-lisp/advice.el (ad-get-orig-definition):
* lisp/help.el (help-function-arglist): Use `advice--cd*r`.
2022-04-26 17:36:13 -04:00
Stefan Monnier
21112e3683 Pretty print OClosure slot accessors
* lisp/emacs-lisp/oclosure.el (oclosure--accessor-cl-print): New function.
* lisp/emacs-lisp/cl-print.el (cl-print-object) <accessor>: New method.
* test/lisp/emacs-lisp/nadvice-tests.el (advice-test-call-interactively):
Avoid `defun` within a function.
2022-04-26 17:36:12 -04:00
Lars Ingebrigtsen
756b7cf5d9 Mention caveats in the map-delete doc string
* lisp/emacs-lisp/map.el (map-delete): Mention how this has to be
used for lists (bug#25929).
2022-04-26 15:34:26 +02:00
Stefan Monnier
0a151b7c29 cl-generic.el: Upcase formal args in C-h o
Try and improve the display of methods in `C-h o` by moving
the qualifiers to a separate line and upcasing the formal args.
It still needs love, tho.

* lisp/emacs-lisp/cl-generic.el: Upcase formal args in `C-h o`
(cl--generic-upcase-formal-args): New function.
(cl--generic-describe): Use it.
2022-04-25 15:41:21 -04:00
Lars Ingebrigtsen
2c0a01ee38 Don't make a header if the user hasn't specified columns in vtable
* lisp/emacs-lisp/vtable.el (vtable):
(make-vtable): Store whether the user has specified the columns.
(vtable-insert): Don't insert a header line or a header if the
user hasn't specified the columns (bug#55075).
2022-04-23 14:47:55 +02:00