Commit graph

8515 commits

Author SHA1 Message Date
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
Lars Ingebrigtsen
d5fd9e0e5b Fix loaddefs byte-compile warning from package.el
* lisp/emacs-lisp/package.el (package-user-dir): :group has to be
explicit for autoloaded defcustoms.
2022-07-31 11:17:29 +02:00
Stefan Kangas
5b29f8cd98 Delete redisplay-end-trigger-functions and related defuns
This variable and related functions have been obsolete since 23.1.
The last things to depend on this (fast-lock.el and lazy-lock.el) were
recently removed.

* src/dispextern.h (struct it): Delete field
'redisplay_end_trigger_charpos'.
* src/window.c (Fwindow_redisplay_end_trigger)
(Fset_window_redisplay_end_trigger): Delete defuns and corresponding
defsubrs for functions obsolete since 23.1.
* src/window.h (wset_redisplay_end_trigger): Delete function.
(GCALIGNED_STRUCT): Delete 'redisplay_end_trigger'.
* src/xdisp.c (run_redisplay_end_trigger_hook): Delete function.
(syms_of_xdisp) <redisplay_end_trigger_functions>: Delete
variable obsolete since 23.1.
(init_iterator, next_element_from_buffer): Don't run or set above
deleted hook variable.

* lisp/subr.el: Delete obsoletion definitions for above deleted
defuns and variable.
* doc/lispref/hooks.texi (Standard Hooks):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
* lisp/loadhist.el (unload-feature-special-hooks): Don't mention
above deleted variable.
* admin/coccinelle/window.cocci: Adjust for above changes.
2022-07-31 01:44:22 +02:00
Gerd Möllmann
9e6eee36b5 Fix native compiler handling of narrow-to-region
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Use auto for
byte-narrow-to-region.
2022-07-30 17:32:04 +02:00
Lars Ingebrigtsen
250dbaa7dd Tweak icons.el emoji detection
* lisp/emacs-lisp/icons.el (icons--create): Choose another
character that's unlikely to appear in non-Emoji fonts.  (Comment
left in place since this should be fixed in a less breakable way.)
2022-07-30 15:56:49 +02:00
Mattias Engdegård
d92fb1592a ; * lisp/emacs-lisp/icons.el (icon-preference): repair type 2022-07-30 15:07:12 +02:00
Gregory Heytings
a5adcbdf28 Handle the optional argument of 'narrow-to-region' in byte-compiled code.
* lisp/emacs-lisp/bytecomp.el: Adapt the specifications.

* src/bytecode.c (exec_byte_code): Get the optional argument.
2022-07-30 14:03:37 +02:00
Stefan Kangas
9bdcca553f ; * lisp/emacs-lisp/regi.el: Delete incorrect "last modified" comment. 2022-07-30 11:36:36 +02:00
Gerd Möllmann
9ebd0455f3 Adapt native compiler to change in narrow-to-region
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Add third
argument nil for narrow-to-region.
2022-07-29 17:28:25 +02:00
Sam Steingold
eeeb481750 Cleanup `string-equal-ignore-case' declarations.
Also, a minor declaration cleanup for other `compare-strings' thin wrappers.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Remove
  `string-equal-ignore-case', `string-prefix-p', `string-suffix-p'.
(side-effect-and-error-free-fns): Add `proper-list-p' (it already
  was in `pure-fns').
(pure-fns): Remove `string-prefix-p', `string-suffix-p'
  (`string-equal-ignore-case' was missing here).
* lisp/subr.el (proper-list-p): Remove partially duplicate `put's from here.
(string-equal-ignore-case, string-prefix-p, string-suffix-p): Add
  `pure' and `side-effect-free' declarations.
(string-equal-ignore-case): Make inline.
2022-07-28 12:36:21 -04:00
Lars Ingebrigtsen
5999dc1cd9 Comment fixes for recent icon code
* lisp/cus-edit.el (custom-icon-state): Add comment.

* lisp/emacs-lisp/icons.el: Remove comment.
2022-07-28 17:49:57 +02:00
Eli Zaretskii
41b63f7bed ; Minor fixes to the "icons" feature
* lisp/emacs-lisp/icons.el (icons--create): Use 'display-images-p'
to test for image capability.

* doc/lispref/display.texi (Icons): Improve indexing,
cross-references, and wording.
2022-07-28 17:21:30 +03:00
Stefan Kangas
38e7400a8c ; Delete LCD Archive entries
* lisp/emacs-lisp/advice.el:
* lisp/emacs-lisp/trace.el:
* lisp/mail/feedmail.el:
* lisp/mail/supercite.el: Delete entries for the defunct LCD Archive.
2022-07-28 15:07:34 +02:00
Lars Ingebrigtsen
0db604a914 Use icons in warnings buffers
* lisp/emacs-lisp/warnings.el (warning-suppress-action)
(warning-suppress-log-action): Removed.
New icon.
(warnings-suppress): New helper function.
(display-warning): Use it (bug#46025).
2022-07-28 14:39:38 +02:00
Lars Ingebrigtsen
601737d750 Add support for user-customizable icons
* doc/emacs/custom.texi (Specific Customization): Mention it.

* doc/emacs/display.texi (Icons): New node.

* doc/lispref/display.texi (Icons): New node.

* lisp/button.el (buttonize):
(button--properties, buttonize-region): Allow not overriding faces.

* lisp/cus-edit.el (custom-save-all): Save icons.
(custom-icon): New widget.
(custom-icon-value-create, custom-toggle-hide-icon)
(custom--icons-widget-value, custom-icon-set): Helper functions
for the widget.
(customize-icon): Main command.
(custom-icon-state-set, custom-icon-state): Helper functions.
(custom-theme-set-icons): Function to be used by theme writers.
(custom-set-icons): Function to be used in .emacs.
(custom-save-icons): New function.

* lisp/custom.el (custom-push-theme): Add icons.

* lisp/emacs-lisp/icons.el: New file.

* test/lisp/emacs-lisp/icons-tests.el: Add some tests.
2022-07-28 14:39:38 +02:00
Sam Steingold
70341cab3e string-equal-ignore-case: new function
* lisp/cedet/semantic/complete.el (semantic-collector-calculate-completions):
  Use `string-prefix-p' instead of explicit `compare-strings'.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
  Add `string-equal-ignore-case'.
* lisp/emacs-lisp/cl-extra.el (cl-equalp): Use `string-equal-ignore-case'.
* lisp/emacs-lisp/shadow.el (load-path-shadows-find): Likewise.
* lisp/emacs-lisp/shortdoc.el (string): Add `string-equal-ignore-case'.
* lisp/files.el (file-truename): Use `string-equal-ignore-case'.
(file-relative-name): Likewise.
* lisp/gnus/gnus-art.el (article-hide-boring-headers):
  Use `string-equal-ignore-case' instead of `gnus-string-equal'.
* lisp/gnus/gnus-util.el (gnus-string-equal):
  Remove, use `string-equal-ignore-case' instead.
* lisp/international/mule-cmds.el (describe-language-environment):
  Use `string-equal-ignore-case'.
(locale-charset-match-p): Likewise.
* lisp/man.el (Man-softhyphen-to-minus): Use `string-prefix-p'.
* lisp/minibuffer.el (completion--string-equal-p):
  Remove, use `string-equal-ignore-case' instead.
(completion--twq-all): Use `string-equal-ignore-case'.
(completion--do-completion): Likewise.
* lisp/net/browse-url.el (browse-url-default-windows-browser):
  Use `string-prefix-p' instead of explicit `compare-strings'.
* lisp/org/ob-core.el (org-babel-results-keyword):
  Use `string-equal-ignore-case' instead of explicit `compare-strings'.
(org-babel-insert-result): Likewise.
* lisp/org/org-compat.el (string-equal-ignore-case):
  Define unless defined already.
(org-mode-flyspell-verify): Use `string-equal-ignore-case'.
* lisp/org/org-lint.el (org-lint-duplicate-custom-id): Likewise.
* lisp/org/ox.el (org-export-resolve-radio-link): Use
  `string-equal-ignore-case' and `string-clean-whitespace'.
* lisp/progmodes/flymake-proc.el
  (flymake-proc--check-patch-master-file-buffer):
  Use `string-prefix-p' instead of explicit `compare-strings'.
* lisp/progmodes/idlwave.el (idlwave-class-or-superclass-with-tag):
  Use `string-equal-ignore-case' instead of explicit `compare-strings'.
* lisp/subr.el (member-ignore-case): Use `string-equal-ignore-case'.
(string-equal-ignore-case): Compare strings ignoring case.
* lisp/textmodes/bibtex.el (bibtex-string=): Remove.
(bibtex-format-entry, bibtex-font-lock-url, bibtex-autofill-entry)
(bibtex-print-help-message, bibtex-validate, bibtex-validate-globally)
(bibtex-clean-entry, bibtex-completion-at-point-function, (bibtex-url):
  Use `string-equal-ignore-case' instead of `bibtex-string='.
* lisp/textmodes/sgml-mode.el (sgml-get-context):
  Use `string-equal-ignore-case' instead of explicit `compare-strings'.
(sgml-calculate-indent): Likewise
* test/lisp/subr-tests.el (string-comparison-test):
  Add tests for `string-equal-ignore-case'.
2022-07-26 13:49:28 -04:00
Robert Pluim
b86569f130 Make package-archives URL treatment slighty laxer
'package-archives' URLs are expected to end in '/', but we can
cater for people typoing that by using 'url-expand-file-name'.

* lisp/emacs-lisp/package.el (package--with-response-buffer-1): Use
'url-expand-file-name' instead of 'concat'.
2022-07-25 15:35:30 +02:00
Paul Pogonyshev
2024136d31 Don't exclude current dir in `package--reload-previously-loaded'
* lisp/emacs-lisp/package.el (package--reload-previously-loaded):
Don't exclude the current directory (bug#56614).
2022-07-24 11:06:57 +02:00
Mattias Engdegård
96926fa6eb Fix lsh warning shortcomings (bug#56641)
Reported by Basil Contovounesios.

* etc/NEWS: Mention how to suppress the warning.
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Amend doc string.
* lisp/subr.el: Use `macroexp-warn-and-return` to delay the warning
until codegen time (which makes it suppressible) and to prevent
repeated warnings.
* test/lisp/international/ccl-tests.el (shift):
* test/src/data-tests.el (data-tests-ash-lsh):
Suppress warning in tests of `lsh` itself.
2022-07-23 18:42:11 +02:00
Mattias Engdegård
3d6cfdf1c5 ; * lisp/emacs-lisp/bytecomp.el: comment cleanup 2022-07-23 11:05:37 +02:00
Lars Ingebrigtsen
97abe8511a Use special-mode in eldoc--doc-buffer
* lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buffer): Use
`special-mode' to allow normal customizations of the buffer
(bug#56659).
2022-07-23 09:14:04 +02:00
Lars Ingebrigtsen
51f5c4b773 Fix off-by-one error in string-truncate-left
* lisp/emacs-lisp/subr-x.el (string-truncate-left): Fix off-by-one
error (bug#56685).
2022-07-23 08:58:53 +02:00
Lars Ingebrigtsen
f268cdc185 Fix typo in error message in native-compile-prune-cache
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Fix typo
(bug#56713).
2022-07-23 00:01:00 +02:00
Lars Ingebrigtsen
963c8c35c3 Give a better error message in native-compile-prune-cache
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Give a
better error message in non-nativecomp builds.
2022-07-22 21:55:23 +02:00
Mattias Engdegård
0069085be2 ; * lisp/emacs-lisp/byte-opt.el (byte-optimize--fixnump): Optimise. 2022-07-21 15:26:00 +02:00
Stefan Kangas
329ec11b0f ; Normalize some "Author" headers 2022-07-20 22:38:01 +02:00
Mattias Engdegård
b70a00d9bf Gently discourage use of lsh (bug#56641)
* lisp/subr.el (lsh): Note the general preference for `ash`.
* lisp/emacs-lisp/shortdoc.el (number): Remove entry for `lsh`.
It was identical to that for `ash` which is misleading.
Shortdoc is very helpful for finding the right function to use,
and `lsh` is just for compatibility at this point.
2022-07-20 13:51:55 +02:00
Stefan Kangas
32db168290 Prefer defvar-keymap in some trivial cases
* lisp/calendar/diary-lib.el (diary-fancy-overriding-map):
* lisp/emacs-lisp/chart.el (chart-mode-map):
* lisp/emulation/cua-base.el (cua-global-keymap)
(cua--cua-keys-keymap, cua--prefix-override-keymap)
(cua--prefix-repeat-keymap, cua--global-mark-keymap)
(cua--rectangle-keymap, cua--region-keymap):
* lisp/emulation/viper-keym.el (viper-vi-intercept-map)
(viper-insert-intercept-map, viper-emacs-intercept-map)
(viper-vi-global-user-map, viper-vi-basic-map, viper-vi-kbd-map)
(viper-vi-diehard-map, viper-insert-global-user-map)
(viper-insert-basic-map, viper-insert-diehard-map)
(viper-insert-kbd-map, viper-replace-map)
(viper-emacs-global-user-map, viper-emacs-kbd-map)
(viper-empty-keymap, viper-mode-map, viper-minibuffer-map)
(viper-ex-cmd-map, ex-read-filename-map)
(viper-slash-and-colon-map, viper-comint-mode-modifier-map)
(viper-dired-modifier-map, viper-gnus-modifier-map):
* lisp/gnus/gnus-sum.el (gnus-summary-generic-mark-map):
* lisp/menu-bar.el (global-buffers-menu-map)
(menu-bar-preferences-menu):
* lisp/mh-e/mh-e.el (mh-folder-mode-map, mh-inc-spool-map)
(mh-search-mode-map, mh-show-mode-map):
* lisp/play/dunnet.el (dungeon-batch-map):
* lisp/progmodes/autoconf.el (autoconf-mode-map):
* lisp/tool-bar.el (tool-bar-map):
* lisp/vc/ediff-help.el (ediff-help-region-map):
* lisp/vc/ediff-hook.el (menu-bar-epatch-menu)
(menu-bar-ediff-merge-menu, menu-bar-ediff-menu):
* lisp/windmove.el (windmove-mode-map):
* lisp/xwidget.el (xwidget-webkit-isearch-mode-map)
(xwidget-webkit-edit-mode-map): Prefer defvar-keymap.
2022-07-20 09:27:30 +02:00
João Távora
3c539cb5b3 Make eldoc-echo-area-prefer-doc-buffer consider all frames
Previously, it considered only windows on 'visible' frames (according
to get-buffer-window).  This seemed correct at first, but it's not
much use for multiple TTY frames and not particularly reliable on GUI
frames either.  There's no reliable way to tell what is actually
visible, so it's best to assume that users setup frames that are
indeed visible when using this parameter.

* lisp/emacs-lisp/eldoc.el (eldoc--echo-area-prefer-doc-buffer-p):
Consider all frames.
2022-07-20 00:35:18 +01:00
João Távora
5f64ba0efb Ensure Eldoc buffer displays on interactive M-x eldoc
* lisp/emacs-lisp/eldoc.el (eldoc-display-in-buffer): Call
eldoc-doc-buffer with interactive set to t.
(Version): Bump to 1.13.0.
2022-07-20 00:27:56 +01:00
Mattias Engdegård
6f7941272b Speed up seq-subseq for lists (bug#56521)
* lisp/emacs-lisp/seq.el (seq-subseq):
Make faster by using `take` instead of a lisp loop,
and more importantly by not front-loading the error text formatting.
* test/lisp/emacs-lisp/seq-tests.el (seq-tests--list-subseq-ref)
(test-seq-subseq): Test `seq-subseq` for lists more thoroughly.
2022-07-18 12:49:29 +02:00
Mattias Engdegård
5ad8f3e570 Use take where clearly safe to do so (bug#56521)
* lisp/emacs-lisp/seq.el (seq-take):
* lisp/auth-source.el (auth-source-secrets-search)
(auth-source-plstore-search):
* lisp/gnus/message.el (message-insert-formatted-citation-line):
* lisp/net/dbus.el (dbus-unregister-object):
* lisp/replace.el (occur-context-lines):
* test/src/print-tests.el (print-circular): Replace hand-written loop
or `butlast` call with `take` for clarity, performance and validation.
We have the equivalence
(take N LIST) = (butlast LIST (- (length LIST) N)).
2022-07-18 12:49:29 +02:00
Mattias Engdegård
d62766305a Add take and ntake (bug#56521)
These are useful list primitives, complementary to `nthcdr`.

* src/fns.c (Ftake, Fntake): New.
(syms_of_fns): Defsubr them.
* doc/lispref/lists.texi (List Elements):
* lisp/emacs-lisp/shortdoc.el (list): Document.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns):
Declare `take` pure and side-effect-free.
* test/src/fns-tests.el (fns-tests--take-ref, fns--take-ntake):
New test.
* etc/NEWS: Announce.
2022-07-17 17:35:49 +02:00
Lars Ingebrigtsen
49e41991b2 Allow ;;;###autoloading transient-define-prefix
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Allow ;;;###autoloading
transient-define-prefix (bug#48694).

* lisp/transient.el (transient-define-prefix): Autoload.
2022-07-16 12:40:12 +02:00
Mattias Engdegård
7feb5b2da7 Optimise append calls
Add the transforms

  (append) -> nil
  (append X) -> X
  (append '(X) Y) -> (cons 'X Y)
  (append (list X) Y) -> (cons X Y)
  (append (list X...) nil) -> (list X...)

and the argument transforms:

  (list X...) (list Y...) -> (list X... Y...)
  nil -> ;nothing
  CONST1 CONST2 -> CONST1++CONST2
  (list CONSTANTS...) -> '(CONSTANTS...)

(the last three for non-tail arguments only)

* lisp/emacs-lisp/byte-opt.el: New.
2022-07-16 12:18:48 +02:00
Mattias Engdegård
d1ac1b2108 Improved cons optimisation
* lisp/emacs-lisp/byte-opt.el (byte-optimize-cons):
Add the transform

 (cons X (list Y...)) -> (list X Y...)
2022-07-16 12:18:41 +02:00
Mattias Engdegård
eb0e93478e Transform (list) -> nil in source optimiser
This optimisation is already done in the code generator but performing
it at this earlier stage is a useful normalising step that uncovers
more opportunities.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-list): New.
2022-07-16 12:17:32 +02:00
Stefan Kangas
41e612cfd6 ; Fix typos 2022-07-14 12:52:32 +02:00
Stefan Kangas
2a05479c22 ; Fix typos: prefer American spelling 2022-07-14 12:13:31 +02:00
Stefan Kangas
c516b49daa Merge from origin/emacs-28
9db6817d63 Remove uneffective test
7af88de410 Mark async worker tmp file as utf-8-emacs-unix (bug#48029)

# Conflicts:
#	test/src/comp-resources/comp-test-45603.el
#	test/src/comp-tests.el
2022-07-14 11:56:56 +02:00
Stefan Kangas
4e79f77635 Merge from origin/emacs-28
5e47ec9511 ; * lisp/url/url-http.el (url-http-parse-headers): Fix typo.
ba0871bef1 ; Fix typos: prefer American spelling
e3e7f31faa Adapt Tramp doc

# Conflicts:
#	etc/NEWS
#	etc/themes/modus-themes.el
#	lisp/emacs-lisp/byte-opt.el
#	test/lisp/so-long-tests/spelling-tests.el
2022-07-14 11:37:42 +02:00
Andrea Corallo
7af88de410 Mark async worker tmp file as utf-8-emacs-unix (bug#48029)
* lisp/emacs-lisp/comp.el (comp-final): Mark async worker tmp file
as utf-8.
* test/src/comp-tests.el (48029-1): New test.
* test/src/comp-resources/comp-test-funcs.el
(comp-test-48029-nonascii-žžž-f): New function.
2022-07-13 15:19:27 +02:00
Stefan Kangas
ba0871bef1 ; Fix typos: prefer American spelling 2022-07-13 13:04:22 +02:00
Stefan Kangas
a837c59d9e Merge from origin/emacs-28
9183d1672c ; * etc/PROBLEMS: Give a URL for bug#50666.
1f508a8b6f etc/PROBLEMS: Describe issues with native compilation on C...
84a5d47125 ; Fix last change
0461021893 ; * lisp/emacs-lisp/comp.el (native-comp-speed): Explain t...
876317271b * lisp/find-dired.el (find-dired): Doc fix; add crossrefer...
2022-07-12 06:30:35 +02:00
Eli Zaretskii
0461021893 ; * lisp/emacs-lisp/comp.el (native-comp-speed): Explain the -1 value. 2022-07-11 16:48:24 +03:00
Stefan Kangas
4c41cef353 Move EIEIO autoloads to the common loaddefs.el
* lisp/emacs-lisp/eieio-core.el:
* lisp/emacs-lisp/eieio-custom.el:
* lisp/emacs-lisp/eieio-opt.el:
* lisp/obsolete/eieio-compat.el: Remove generated-autoload-file
setting and don't require eieio-loaddefs.el.
2022-07-11 14:29:33 +02:00