Commit graph

8356 commits

Author SHA1 Message Date
Lars Ingebrigtsen
ed34cbeae7 Audit symbol quoting in Lisp doc strings
* lisp/vc/vc-svn.el (vc-svn-dir-status-files):
* lisp/so-long.el (so-long-mode-maintain-preserved-variables):
* lisp/help-fns.el (help-fns--most-relevant-active-keymap):
* lisp/gnus/nnselect.el (nnselect-get-artlist):
(nnselect-store-artlist):
* lisp/forms.el (forms-enumerate):
* lisp/ffap.el (ffap-string-at-point):
* lisp/emacs-lisp/byte-run.el (define-obsolete-variable-alias):
Audit symbol quoting in Lisp doc strings.
2022-05-24 12:36:51 +02:00
Lars Ingebrigtsen
f14f6180b7 Fix previous warning suppression change
* lisp/emacs-lisp/bytecomp.el (byte-compile-emit-callargs-warn)
(byte-compile-subr-wrong-args):
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings):
* lisp/cedet/semantic/fw.el (semantic-install-function-overrides):
The `wrong-args' warning is really called `callargs'.
2022-05-22 20:14:03 +02:00
Lars Ingebrigtsen
a0524584e9 Allow suppressing messages about the wrong number of arguments
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Add
`wrong-args'.
* lisp/emacs-lisp/bytecomp.el (byte-compile-emit-callargs-warn)
(byte-compile-subr-wrong-args): Allow suppressing wrong number of
arguments.
2022-05-22 20:07:22 +02:00
Stefan Monnier
42076e6986 comp.el: Cosmetic changes
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Tweak code.
(comp-run-async-workers): Don't set `buffer-read-only` directly.
(native--compile-async): Fix misuse of "path".
2022-05-22 10:48:58 -04:00
Lars Ingebrigtsen
9d557d4d4a Rename compare-window-configurations and update doc
* doc/lispref/windows.texi (Window Configurations): Update name.
* lisp/strokes.el (strokes-window-configuration-changed-p):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Update
callers and references.

* lisp/subr.el (compare-window-configurations): Make into obsolete
alias.

* src/window.c (Fwindow_configuration_equal_p): Rename (bug#14964).
2022-05-20 04:23:32 +02:00
Lars Ingebrigtsen
de9dfb1939 Fix font-locking of (defun foo (function ...))
* lisp/emacs-lisp/lisp-mode.el (lisp--el-funcall-position-p):
Don't colorize the `function' in (defun foo (function ...)) as a
special form (bug#37074).
2022-05-20 03:46:35 +02:00
Alan Mackenzie
7969e41654 Fix M-x compile-defun when an interactive form is (list ...)
This is for when lexical-binding is nil.  The problem fixed was M-x
compile-defun leaving symbols with position in the compiled function's arglist
and interactive form.  This fixes bug #55323.  Also ensure the doc string is
correctly stripped when lexical-binding is t.

* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): For a (list ...)
interactive form when lexical-binding is nil, strip the positions from the
symbols in the form.  Also strip the position from the symbols in the arglist.
(byte-compile-make-closure): (Twice) strip symbols from positions in the doc
string expression.  Add comments.
2022-05-18 09:18:15 +00:00
Lars Ingebrigtsen
6e61f9ec8a Fix pp-emacs-lisp-code printing of cons cells
* lisp/emacs-lisp/pp.el (pp--insert-lisp): Fix printing of cons
cells (bug#55478).
2022-05-17 19:45:20 +02:00
Lars Ingebrigtsen
dc239872cc Fix package-quickstart breakage
* lisp/emacs-lisp/package.el (package-quickstart-refresh): Work
around syntax-ppss now clobbering match data (but it's not clear
whether that's supposed to be allowed) (bug#55447).
2022-05-17 11:48:12 +02:00
Lars Ingebrigtsen
90dccb0f00 Fix edebug-tests test failure after prin1 change
* lisp/emacs-lisp/ert-x.el (ert--make-print-advice): Fix test
failures in edebug-tests.
2022-05-17 10:09:58 +02:00
Andrea Corallo
2ba42e596a ; Fix two mail addresses
;* lisp/emacs-lisp/comp.el: Fix author's mail address.
;* lisp/emacs-lisp/comp-cstr.el: Likewise.
2022-05-16 09:54:15 +02:00
Stefan Kangas
cd5fcf10c6 Minor clarification of package-update-all docstring
* lisp/emacs-lisp/package.el (package-update-all): Clarify
docstring slightly.  (Bug#55408)
2022-05-15 21:38:48 +02:00
Lars Ingebrigtsen
cfedc2872e Fix native-comp type of prin1-to-string
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix type
of prin1-to-string.
2022-05-15 15:41:46 +02:00
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