Commit graph

8327 commits

Author SHA1 Message Date
Visuwesh
5d8b6ba89e pp--insert-lisp: Don't bug out on certain forms at beginning of buffer
* pp.el (pp--insert): Check if point is in beginning of buffer before
calling `looking-back' (bug#55677).
2022-05-28 18:39:43 +02:00
Lars Ingebrigtsen
9707613ddb Fix native-comp of trampolines after previous change
* lisp/emacs-lisp/comp.el (comp--native-compile): Don't delete the
explicitly specified output file, just temp files.
2022-05-28 12:32:01 +02:00
Lars Ingebrigtsen
fd4a0c022b Make package-update-all also refresh the list
* lisp/emacs-lisp/package.el (package-update-all): Also refresh
package list.
2022-05-27 12:17:28 +02:00
Stefan Kangas
7da754015f Merge from origin/emacs-28
9283508fb2 Fix format specifiers in tramp-adb.el
a9f17ccce3 ; Fix some doc typos and minor language issues
2022-05-27 06:30:20 +02:00
Stefan Monnier
14cbb75455 Merge remote-tracking branch 'origin/scratch/bug-55156' 2022-05-26 16:46:11 -04:00
Stefan Monnier
fbe0d7361f package-activate-all: Use the quickstart more conservatively
* lisp/emacs-lisp/package.el (package-activate-all): Don't use the
quickstart file if some packages have already been activated.
2022-05-26 16:40:52 -04:00
Sam Steingold
3d567a5517 Avoid duplicates in `package-activated-list'
* lisp/emacs-lisp/package.el (package-quickstart-refresh): Calling
`package-activate-all' twice leads to duplicates in
`package-activated-list' - avoid that.
2022-05-26 16:18:47 -04:00
Stefan Monnier
80ba4c1707 eval.c: New functions defvar-1 and defconst-1 (bug#55156)
The bytecode interpreter can't directly call special forms, so
the byte-compiler usually converts special forms into some sequence of
byte codes (basically, providing a duplicate definition of the special
form).  There are still two exceptions to this: `defconst` and `defvar`,
where the compiler instead generates a convoluted chunk of code like:

    (funcall '(lambda (x) (defvar <sym> x <doc>)) <value>)

where the quote makes sure we keep the function non-compiled, so as
to end up running the special form at run time.

Get rid of this workaround by introducing `defvar-1` and `defconst-1`
which provide a *functional* interface to the functionality of the
corresponding special form.

* src/eval.c (defvar, Fdefvar_1, Fdefconst_1): New functions, extracted from
`Fdefvar` and `Fdefconst`.
(Fdefvar, Fdefconst): Use them.
(syms_of_eval): `defsubr` the new functions.

* lisp/emacs-lisp/bytecomp.el (byte-compile-tmp-var): Delete const.
(byte-compile-defvar): Simplify using the new functions.

* doc/lispref/variables.texi (Defining Variables): Adjust the doc of
`defvar` to reflect the actual semantics implemented.
2022-05-26 12:21:32 -04:00
Mattias Engdegård
e05acb07d3 Faster and less recursive byte-compile--first-symbol-with-pos
* lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos)
(byte-compile--warning-source-offset):
Remove recursion for cdr-traversal of lists, and optimise (bug#55414).
2022-05-26 17:28:13 +02:00
Lars Ingebrigtsen
ef6059cb83 Make comp--native-compile delete the temp file it creates
* lisp/emacs-lisp/comp.el (comp--native-compile): Delete the
temporary files we create (bug#55611).
2022-05-26 14:47:16 +02:00
Lars Ingebrigtsen
06c79dcfcb Make memory-report not bug out with symbols with positions
* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1):
Don't bug out when there are symbols with positions.
2022-05-26 13:04:50 +02:00
Štěpán Němec
a9f17ccce3 ; Fix some doc typos and minor language issues 2022-05-26 10:29:10 +02:00
Lars Ingebrigtsen
abd3411827 Don't have edebug bug out if C-x is rebound
* lisp/emacs-lisp/edebug.el (edebug-global-prefix): Don't bug out
if C-x has been rebound (bug#55607).
2022-05-25 03:52:16 +02:00
Lars Ingebrigtsen
9f1cae8cb0 Update edebug comments
* lisp/emacs-lisp/edebug.el: Update function name in comments
(bug#55607).
2022-05-25 03:35:20 +02:00
Lars Ingebrigtsen
7c4cad3230 Fix ert-run-tests-batch-and-exit doc string typo
* lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Fix doc
string typo.
2022-05-25 03:25:30 +02:00
Lars Ingebrigtsen
f474ad4ed1 Autoload package-update-all
* lisp/emacs-lisp/package.el (package-update-all): Autoload and
tweak querying so that -f works.
2022-05-25 03:25:30 +02:00
Lars Ingebrigtsen
c00ffe263d Fix comp-mvar doc string quoting
* lisp/emacs-lisp/comp.el (comp-mvar): Fix quoting of symbol in
doc string.
2022-05-24 21:13:59 +02:00
Lars Ingebrigtsen
2701cd59b5 Make byte compilation warn about wrong quoting in doc strings
* lisp/emacs-lisp/bytecomp.el
(byte-compile-docstring-length-warn): Made into obsolete alias.
(byte-compile-docstring-style-warn): Also warn about other
stylistic issues.
(byte-compile-file-form-autoload, byte-compile-file-form-defvar)
(byte-compile-file-form-defvar-function, byte-compile-lambda)
(byte-compile-defvar, byte-compile-file-form-defalias): Adjust callers.
2022-05-24 18:48:50 +02:00
Stefan Monnier
5c1c614940 Make yank-transform-functions a proper hook
* lisp/subr.el (insert-for-yank): Use `run-hook-wrapped` to run
`yank-transform-functions`.
* lisp/simple.el (yank-transform-functions): Adjust accordingly.
2022-05-24 12:29:54 -04:00
Lars Ingebrigtsen
388e0c18f4 Make the nativecomp test eln directory more reliably be removed
* lisp/startup.el (startup-redirect-eln-cache, normal-top-level):
Don't create the nativecomp directory here, because this led to
brittle deletions of the directory -- there would be several
instances of the directory left over after a test run.

* lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Create
the nativecomp directory.
2022-05-24 14:06:38 +02:00
Lars Ingebrigtsen
b2bce107b1 Further audits of single quotes in Lisp doc strings
* test/manual/etags/el-src/emacs/lisp/progmodes/etags.el
(tags-apropos-additional-actions):
* lisp/window.el (delete-window-choose-selected):
* lisp/vc/ediff-merg.el (ediff-combination-pattern):
* lisp/vc/diff.el (diff-no-select):
* lisp/tab-bar.el (tab-bar-new-tab-choice):
* lisp/simple.el (next-error-message-highlight):
(backward-delete-char-untabify):
* lisp/ses.el (ses-jump-cell-name-function):
* lisp/org/org.el (org-latex-to-html-convert-command):
* lisp/org/org-agenda.el (org-agenda-sorting-strategy):
* lisp/net/tramp.el (tramp-default-file-modes):
* lisp/net/newst-treeview.el
(newsticker-treeview-use-feed-name-from-url-list-in-treeview):
* lisp/net/eww.el (eww-auto-rename-buffer):
* lisp/mwheel.el (mouse-wheel-scroll-amount):
* lisp/mail/rmail.el (rmail-re-abbrevs):
* lisp/info.el (Info-history-forward-menu):
* lisp/gnus/nnselect.el (nnselect-retrieve-headers-override-function):
* lisp/gnus/gnus-start.el (gnus-subscribe-hierarchical-interactive):
* lisp/fringe.el (fboundp):
* lisp/eshell/esh-var.el (eshell-variable-aliases-list):
* lisp/emacs-lisp/checkdoc.el (checkdoc-column-zero-backslash-before-paren):
* lisp/dired-aux.el (dired-confirm-shell-command):
* lisp/calendar/calendar.el (calendar-time-zone-style):
* lisp/ansi-color.el (ansi-color-faces-vector):
(ansi-color-names-vector): Audit use of various single quotes in
Lisp doc strings.
2022-05-24 13:17:53 +02:00
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