Commit graph

8560 commits

Author SHA1 Message Date
Stefan Kangas
89f5167379 Don't show status message in Helper-describe-bindings
* lisp/emacs-lisp/helper.el (Helper-describe-bindings): Don't show
status message.
2022-08-11 14:35:23 +02:00
Mattias Engdegård
d8d582dc3c ; * lisp/emacs-lisp/subr-x.el (string-pad): Optimise. 2022-08-10 13:06:12 +02:00
Mattias Engdegård
9d35afed49 Extend LAP optimisations to more operations
Extend the set of eligible opcodes for certain peephole
transformations, which then provide further optimisation
opportunities.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Optimise empty save-current-buffer in the same way as we already
do for save-excursion and save-restriction.  This is safe
because (save-current-buffer) is a no-op.
(byte-compile-side-effect-and-error-free-ops): Add list3, list4 and
listN.  These were all apparent oversights as list1 and list2 were
already included.
(byte-after-unbind-ops): Add stack-ref, stack-set, discard, list3,
list4 and listN.  Stack manipulation is safe because unbind cannot
read or modify stack entries.
2022-08-10 12:51:40 +02:00
Stefan Kangas
f002fa8bfc Delete dead code in checkdoc.el
* lisp/emacs-lisp/checkdoc.el: Delete code commented out since
1997.
2022-08-10 11:28:17 +02:00
Stefan Kangas
581fa3d958 Autoload string-blank-p
* lisp/eshell/em-hist.el (subr-x):
* lisp/net/eudc.el (subr-x): Don't require.
* lisp/emacs-lisp/subr-x.el (string-blank-p): Autoload.
2022-08-09 21:58:00 +02:00
Lars Ingebrigtsen
b2bf91003d Further lisp-current-defun-name tweaks
* lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Tweak so
that cl-defmethod and friends work again.
2022-08-09 19:21:36 +02:00
Lars Ingebrigtsen
5269842833 Add a faster seq-uniq for lists
* lisp/emacs-lisp/seq.el (seq-uniq): Add a faster method for lists
(bug#57079).
2022-08-09 19:21:36 +02:00
Lars Ingebrigtsen
ee201bc77b Make the loaddefs.el file slightly shorter
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--shorten-autoload): New function.
(loaddefs-generate--make-autoload): Use it to drop optional nil
values from the `autoloads' forms.  This makes the loaddefs.el
file about 12K shorter.
2022-08-09 16:36:41 +02:00
Michael Heerdegen
fe4fd160a2 Another lisp-current-defun-name tweak
* lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Avoid error
when edebug spec is the symbol t.
2022-08-09 04:01:29 +02:00
Lars Ingebrigtsen
909931cb9a Further lisp-current-defun-name tweaks
* lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Further
tweaks to finding the symbol being defined (defalias).
2022-08-08 15:53:41 +02:00
Lars Ingebrigtsen
ffc81ebc4b Allow specifying how args are to be stored in `command-history'
* doc/lispref/functions.texi (Declare Form): Document
`interactive-args'
* lisp/replace.el (replace-string): Store the correct interactive
arguments (bug#45607).

* lisp/emacs-lisp/byte-run.el (byte-run--set-interactive-args):
New function.
(defun-declarations-alist): Use it.

* src/callint.c (fix_command): Remove the old hack (which now
longer works since interactive specs are byte-compiled) and
instead rely on `interactive-args'.
2022-08-08 15:53:41 +02:00
Lars Ingebrigtsen
55cc8b040b Make which-func-mode output less junk
* lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Use
edebug specs to find the name (if they exist), and default to
returning the top-level symbol if there isn't a define-like form
(bug#49592).
2022-08-08 14:32:33 +02:00
Stefan Kangas
3d7d8ddc5a ; Fix typos 2022-08-08 14:23:29 +02:00
Mattias Engdegård
c3e99a870a ; * lisp/emacs-lisp/bytecomp.el: indentation fix 2022-08-07 17:36:45 +02:00
Mattias Engdegård
08a74ab05a Cease emitting negative file offsets for user variables
'User variables' were made obsolete in Emacs 24 along with
user-variable-p; the sign of the position in (#$ . POS) hasn't
mattered since.

* lisp/emacs-lisp/bytecomp.el (byte-compile-output-docform):
Don't emit negative position when doc string starts with `*`.
* src/lread.c (get_lazy_string): Explain.
2022-08-07 10:52:16 +02:00
Eli Zaretskii
564571f712 ; * lisp/emacs-lisp/lisp.el (end-of-defun-moves-to-eol): Doc fix. 2022-08-06 09:40:07 +03:00
Stefan Monnier
b70369c557 time-convert): Deprecate calls without an explicit FORM arg
* lisp/subr.el (time-convert): Deprecate calls without an explicit FORM arg.

* doc/lispref/os.texi (Time Conversion): Adjust doc accordingly.

* lisp/calendar/time-date.el (days-to-time):
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
* lisp/gnus/nnrss.el (nnrss-normalize-date):
* lisp/epa-ks.el (epa-ks--parse-buffer): Silence corresponding warnings.
2022-08-05 18:46:31 -04:00
Stefan Kangas
ea6c2e9295 Allow newline after def*-form for definition-prefix
* lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions):
Add another semantic function.
(loaddefs-generate--compute-prefixes): Allow newline after the "(def*"
form.  (Bug#57000)
2022-08-05 20:17:23 +02:00
Filipp Gunbin
50730a8b04 Add variable end-of-defun-moves-to-eol
* lisp/emacs-lisp/lisp.el (end-of-defun-moves-to-eol): New variable.
(end-of-defun): Use it.
2022-08-05 21:03:03 +03:00
Stefan Monnier
eb7fe81e6d timer.el: Avoid repeated timers
https://mail.gnu.org/archive/html/emacs-devel/2022-07/msg01127.html
points out that end-users can get bitten by this, accidentally
calling `timer-activate` on an already activated timer.

* lisp/emacs-lisp/timer.el (timer--activate): Signal an error if we try
to re-add a timer that's already on the timer-list.
2022-08-05 10:38:59 -04:00
Stefan Monnier
df263dd758 bytecomp.el: Update comments referring to make-docfile 2022-08-05 09:41:03 -04:00
Stefan Monnier
900b09c023 bytecomp.el: Further simplifications enabled by commit 59732a83c8
* lisp/emacs-lisp/bytecomp.el (byte-compile-output-docform): Don't
insert a \n before the #@ docstrings since make-docfile doesn't scan
.elc files any more.
2022-08-05 08:18:04 -04:00
Stefan Kangas
d73a104dd3 Be more lax when picking up prefixes for loaddefs
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--compute-prefixes): Allow tabs and spaces before
symbol name, so that "(defvar\tfoo-bar nil)" is properly picked up.
Before this change, such a definition would be wrongly picked up as
the symbol "nil".
2022-08-04 23:21:03 +02:00
Lars Ingebrigtsen
aa9eaac68e Move autoload.el to lisp/obsolete/ 2022-08-04 17:03:59 +02:00
Lars Ingebrigtsen
f038695085 Minor cleanups in autoload.el/loaddefs-gen.el
* lisp/subr.el (package--builtin-versions): Adjust comments.

* lisp/emacs-lisp/loaddefs-gen.el (no-update-autoloads): Moved
here from autoload.el.
* lisp/emacs-lisp/loaddefs-gen.el: Removed now that it's no longer
used.

* lisp/emacs-lisp/package.el
(package-autoload-ensure-default-file): Don't warn about
soon-to-be obsolete functon.
2022-08-04 16:41:39 +02:00
Lars Ingebrigtsen
d15b67b108 Minor checkdoc.el clean up
* lisp/emacs-lisp/checkdoc.el (generate-autoload-cookie): This is
no longer used, so remove reference.
2022-08-04 16:29:47 +02:00
Lars Ingebrigtsen
9129808496 Add define-keymap to autoload-ignored-definitions
* lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions):
Ignore `define-keymap', too (bug#56973).
2022-08-04 15:27:47 +02:00
Stefan Kangas
385511f1a2 Add define-key-after to autoload-ignored-definitions
* lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions):
Add define-key-after and define-ibuffer-sorter.
2022-08-04 15:03:42 +02:00
Stefan Kangas
e2eee46247 Add more autoload-ignored-definitions
* lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions):
Add define-ibuffer-column.
2022-08-04 14:36:34 +02:00
Lars Ingebrigtsen
459b1b8fbc Add more autoload-ignored-definitions defs
* lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions):
Add more definition forms that shouldn't trigger prefix
registration (bug#56970).
2022-08-04 11:27:03 +02:00
Lars Ingebrigtsen
4c1bc8315d Fix up some prefix registration problems in doc strings
* lisp/uniquify.el (uniquify-buffer-name-style):
* lisp/org/ob-core.el (org-src-sha):
* lisp/emacs-lisp/cl-macs.el (cl--optimize):
* lisp/battery.el (battery-update-functions): Avoid triggering the
`register-definition-prefixes' in doc strings (bug#56968).
2022-08-04 11:03:10 +02:00
Lars Ingebrigtsen
4ebdc558f6 Adjust loaddefs-generate--print-form comments
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form):
Adjust doc string and comments now that make-docfile doesn't scan
this.
2022-08-04 07:44:53 +02:00
Lars Ingebrigtsen
261d6afd6e Byte-compile the in-tree loaddefs.el files
* lisp/Makefile.in (all): Add "autoloads", which now otherwise
won't be done.
($(lisp)/loaddefs.el): Remove this target, since it's always done,
and would then trigger a re-compilation of loaddefs.elc.

* lisp/loadup.el: Load loaddefs.elc (if it exists).

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't
include no-byte-compile cookies in the Emacs build.

* src/Makefile.in ($(pdmp)): Depend on loaddefs.elc to ensure that
it's built by this point.
($(etc)/DOC): Don't scan loaddefs.el for doc strings, since they
are now picked up from the .elc file (bug#53024).
2022-08-03 14:22:16 +02:00
Lars Ingebrigtsen
0596c69186 Check for mis-quoted #' in doc strings during byte-compile
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-style-warn):
Check for mis-quoted #' in doc strings, too.
2022-08-03 13:14:32 +02:00
Lars Ingebrigtsen
0a6e2b3bfc Fix quoting of #' in some doc strings
* lisp/org/ox.el (org-export-to-file):
* lisp/eshell/esh-arg.el (eshell-concat):
* lisp/emacs-lisp/edebug.el (edebug-read-special):
* lisp/dired-aux.el (dired-split): Fix quoting of #' in doc strings.
2022-08-03 13:14:32 +02:00
Stefan Kangas
984b8f7ed0 Remove some spurious references to XEmacs
* lisp/desktop.el (desktop--emacs-pid-running-p):
* lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words): Don't
mention XEmacs.
2022-08-03 11:41:43 +02:00
Stefan Kangas
72c7ee2e52 Avoid cl-cXXXr compat aliases
* lisp/emacs-lisp/cl-lib.el (cl-third, cl-fourth):
* lisp/emacs-lisp/cl-macs.el (cl--do-&aux, cl--do-arglist)
(cl--parse-loop-clause, cl--loop-let, cl--loop-build-ands)
(cl--do-proclaim, cl-defstruct): Prefer using cXXXr functions
directly, instead of cl-cXXXr prefixed compat aliases.
2022-08-03 02:59:40 +02:00
Matt Armstrong
50a192795a Consider built-in packages to be installed
* lisp/emacs-lisp/package.el (package-installed-p): Check for built-in
packages before initialization. (bug#56877).
2022-08-02 12:14:09 +02:00
Lars Ingebrigtsen
6fd1fb8a68 Don't disable eldoc when doing edebug
* lisp/emacs-lisp/eldoc.el
(eldoc-display-message-no-interference-p): Don't disable eldoc
when edebugging (bug#56459).  There should be no interference in
that case, because edebug messaging is done after stepping, and
eldoc messaging is done after other movements.
2022-08-02 11:56:55 +02:00
Gregory Heytings
9d8a6c8283 Fix the bytecode incompatibility due to the change to 'narrow-to-region'.
* src/editfns.c (narrow_to_region_internal): New function, which
contains the body previously in 'Fnarrow_to_region' but accepts
a third argument.
(Fnarrow_to_region): Use the new function. Update the docstring.
(Fwiden): Update the docstring.

* src/lisp.h: Prototype of the new function.

* src/xdisp.c (handle_fontified_prop): Use the new function instead
of 'Fnarrow_to_region'.

* src/process.c (Finternal_default_process_filter):
* src/lread.c (readevalloop): Remove the third argument to
'Fnarrow_to_region'.

* src/bytecode.c (exec_byte_code):
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst):
* lisp/emacs-lisp/bytecomp.el: Restore the statu quo ante.

* etc/NEWS: Remove the entry about the new optional argument.

* doc/lispref/positions.texi (Narrowing): Update the documentation.
2022-08-01 21:11:49 +02:00
Paul Eggert
d634cb0954 Omit some (current-time) calls
* lisp/emacs-lisp/ert.el (ert-write-junit-test-summary-report):
* lisp/emacs-lisp/shortdoc.el (file):
* lisp/find-lisp.el (find-lisp-find-dired-insert-file):
* lisp/progmodes/hideif.el (hide-ifdefs):
* lisp/tar-mode.el (tar-subfile-save-buffer):
Prefer nil or omitted arg to (current-time) where this is better
or more-efficient.
2022-08-01 01:17:16 -07:00
Lars Ingebrigtsen
6ef058cec2 Allow specifying that loaddefs files shouldn't not be compiled
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric):
Allow specifying that we shouldn't include a no-compile cookie
(bug#53024).
2022-07-31 19:57:55 +02:00
Mattias Engdegård
ac237334c7 Reduce internal rx autoloads
* lisp/emacs-lisp/rx.el (rx--to-expr, rx--pcase-transform):
Don't autoload.
(rx--pcase-macroexpander): Extract body into...
(rx--pcase-expand): ...a separate function, which is autoloaded.
2022-07-31 13:01:26 +02:00
Stefan Kangas
ca2d3ed74c * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read): Simplify. 2022-07-31 12:04:17 +02:00
Lars Ingebrigtsen
18f105bd7d Fix ede byte-compile warnings in loaddefs.el
* lisp/emacs-lisp/eieio.el (make-instance):
* lisp/cedet/ede/auto.el (ede-add-project-autoload): Autoload
functions referred to by ede/loaddefs.el.
2022-07-31 11:39:00 +02:00
Lars Ingebrigtsen
bd7a15ef78 Remove loaddefs debug code
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric):
Remove code inadvertantly checked in.
2022-07-31 11:39:00 +02:00
Lars Ingebrigtsen
5276519255 Fix cl byte-compile warning in cl-loaddefs.el
* lisp/emacs-lisp/cl-macs.el (cl--optimize)
(cl-struct-sequence-type, cl-struct-slot-offset): Autoload since
they are referred to by code in cl-loaddefs.el.
2022-07-31 11:39:00 +02:00
Lars Ingebrigtsen
9c5d8d59cf Fix remaining byte-compile warnings in loaddefs.el
* lisp/progmodes/compile.el (compilation--default-buffer-name):
* lisp/kmacro.el (kmacro-name-last-macro):
* lisp/emacs-lisp/package.el (package--activate-all): Autoload to
avoid byte-compilation warnings when byte-compiling loaddefs.el.
2022-07-31 11:29:52 +02:00
Lars Ingebrigtsen
e8d198a00a Fix rx.el byte-compile warning in loaddefs.el
* lisp/emacs-lisp/rx.el (rx--to-expr, rx--pcase-transform):
Autoload to avoid warning when byte-compiling loaddefs.el.
2022-07-31 11:28:04 +02:00
Lars Ingebrigtsen
c5df73941e Fix further package.el loaddefs byte-compile warnings
* lisp/emacs-lisp/package.el (package-directory-list)
(package-quickstart-file): Specify group to avoid warning when
byte-compiling loaddefs.el.
(package-activated-list): Autoload since we're assigning the
variable from a function completely autoloaded.
2022-07-31 11:21:47 +02:00