1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00
Commit Graph

7767 Commits

Author SHA1 Message Date
Mattias Engdegård
c4724add00 Normalise nested progn forms in byte-code optimiser
* lisp/emacs-lisp/byte-opt.el (byte-optimize-body): Flatten body.
This simplifies the source tree and reduces the number of different
cases that other optimisations need to take into account.
2021-09-06 16:47:13 +02:00
Mattias Engdegård
bba48d6ee5 More robust optimisation of ignore
Treat `ignore` as any other function during source-level optimisation,
to avoid having its warning-suppression effects cancelled by repeated
passes.  Instead, define a custom code generation function.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't treat `ignore' specially here.
(side-effect-free-fns): Don't mark `ignore` as side-effect-free
or error-free (although it is), since that would allow the optimiser
to elide calls.
* lisp/emacs-lisp/bytecomp.el (ignore, byte-compile-ignore):
Define and register a code-gen function.
2021-09-06 16:47:13 +02:00
Mattias Engdegård
fab1e220db Optimise member and assoc (etc) with constant empty list
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-assq): New.
(byte-optimize-member, byte-optimize-assoc, byte-optimize-memq):
When the list argument is constant nil, the result is always nil.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
2021-09-06 16:47:13 +02:00
martin rudalics
9680994d3a Restore the debugging window size more reliably
* lisp/emacs-lisp/debug.el (debug): Restore the debugging window
size more reliably (bug#12921).
2021-09-06 12:48:07 +02:00
Lars Ingebrigtsen
c5b654b3f1 Autoload cl-struct-slot-info
* lisp/emacs-lisp/cl-macs.el (cl-struct-slot-info): Autoload
(bug#50301).

* test/lisp/emacs-lisp/memory-report-tests.el: Don't require cl-macs.
2021-09-05 16:52:14 +02:00
Stefan Monnier
c78969d31b * lisp/emacs-lisp/timer.el (timer-create): Don't inline it 2021-09-04 12:52:16 -04:00
Lars Ingebrigtsen
d0eaf7a3cf Fix `describe-function' for autoloaded adviced functions
* lisp/emacs-lisp/nadvice.el (advice--make-single-doc): Factor
out.
(advice--make-docstring): From here (bug#23523).  Also include
advices for autoloads.
2021-09-03 13:48:44 +02:00
Stefan Kangas
0cabf8bc36 ; Fix typos 2021-09-03 13:05:32 +02:00
Lars Ingebrigtsen
d1f3247666 Make recent timer changes more backwards-compatible
* lisp/emacs-lisp/timer.el (timerp, timer-event-handler): Make
backwards-compatible with old .elc files that have their own
versions of `timer-create'd structures.
2021-09-03 10:40:21 +02:00
Lars Ingebrigtsen
d7fb11b6d7 Reformat up-list and backward-up-list doc strings
* lisp/emacs-lisp/lisp.el (backward-up-list): Reformat the doc
string into several paragraphs (bug#31349).
(up-list): Ditto and fix the "start" to be "end".
2021-09-02 10:22:52 +02:00
Yikai Zhao
d8d5dc4565 memory-report: support calculating size for structures
* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Add
support for cl-defstruct types (bug#50301).
2021-09-02 09:37:06 +02:00
Lars Ingebrigtsen
fffcc7ab25 Fix (setf (map-elt map key) (my-func))
* lisp/emacs-lisp/map.el (map-elt): Ensure that the value isn't
referenced more than once (bug#50290).
2021-09-01 10:32:49 +02:00
Lars Ingebrigtsen
50765f3f51 Make run-at-time try harder to run at integral multiples
* lisp/emacs-lisp/timer.el (timer): Add new slot integral-multiple.
(timerp): Adjust.
(timer-event-handler): Recompute the delay if requested
(bug#39099).
(run-at-time): Mark the timer as recomputable if given a t
parameter.

* src/keyboard.c (decode_timer): Adjust.
2021-08-31 03:04:22 +02:00
Lars Ingebrigtsen
e26d628a4e Don't overly truncate tabulated-list headers
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
Don't overly truncate headers that are before a right-aligned
column (bug#44594).
(tabulated-list--available-space): Separated out into own
function...
(tabulated-list-print-col): ... from here.
2021-08-27 18:41:42 +02:00
Lars Ingebrigtsen
61323c6d76 Put advice documentation at the end of the displayed doc string
* lisp/emacs-lisp/nadvice.el (advice--make-docstring): Put the
advice things at the end of the documentation (bug#50222).  It's
important to have the first line of the original documentation
remain the first line, because it's used when doing one-line
summaries of the function.
2021-08-27 17:15:17 +02:00
Andrea Corallo
f7da671493 * Forward `comp-file-preloaded-p' to async workers
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Forward
`comp-file-preloaded-p' to async workers.
2021-08-27 15:30:20 +02:00
Shitikanth Kashyap
f09ee98e68 tabulated-list-print delete excess lines
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Ensure
that we delete remaining lines if the list has gotten shorter
(bug#50194).

Copyright-paperwork-exempt: yes
2021-08-25 13:34:45 +02:00
Mattias Engdegård
4281e5b34d Add example of advanced user-defined Rx form to manual
* doc/lispref/searching.texi (Extending Rx): Add example illustrating
how to define a user-defined Rx form that performs computation,
from a discussion with Michael Herdeegen (bug#50136).
* lisp/emacs-lisp/rx.el (rx): Clarify evaluation time for `eval`.
2021-08-23 19:57:17 +02:00
Lars Ingebrigtsen
4015fb6e69 Improve byte-compile-warnings doc string
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings): Mention
'byte-compile-docstring-max-column'.
2021-08-23 02:04:55 +02:00
Eli Zaretskii
654e096b09 ; * lisp/emacs-lisp/comp.el (native-comp-async-cu-done-functions): Doc fix. 2021-08-22 11:42:05 +03:00
Lars Ingebrigtsen
a0023661a4 Clarify cl-defstruct doc string and manual entry somewhat
* doc/misc/cl.texi (Structures): Rename the slot "name" in the
examples to "first-name", since we're talking about the names of
slots a lot here, and having a slot with the name "name" makes the
examples somewhat confusing.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Clarify certain
things about slots (bug#14278).
2021-08-21 16:50:20 +02:00
Andrea Corallo
7fa5dec86e * Fix `native-compile-target-directory' effectiveness for async compilation.
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Forward to async
workers `native-compile-target-directory'.
2021-08-17 23:47:05 +02:00
Lars Ingebrigtsen
b9243b034b Minor clarification for define-minor-mode :variable
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
* doc/lispref/modes.texi (Defining Minor Modes): Clarify what the
setter function should do (bug#14875).
2021-08-16 14:24:53 +02:00
Lars Ingebrigtsen
751f1707f0 Add new functions to replace strings/regexp in a region
* doc/lispref/searching.texi (Search and Replace): Document them.
* lisp/subr.el (replace-string-in-region)
(replace-regexp-in-region): New functions.

* lisp/emacs-lisp/shortdoc.el (regexp, buffer): Mention them.
2021-08-16 13:20:35 +02:00
Masahiro Nakamura
e2eb58c487 Mark up commands in shortdoc.el for modes
* lisp/emacs-lisp/shortdoc.el: Add command mode tagging
(bug#50064).
2021-08-15 11:55:34 +02:00
Stefan Monnier
bf55b5ac17 * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Fix bug#50051
This corrects the quite confused conversion to closure done in
commit a070bd1c8b.
2021-08-14 12:22:57 -04:00
Lars Ingebrigtsen
22d8e71d04 Make lm-crack-address less strict
* lisp/emacs-lisp/lisp-mnt.el (lm-crack-address): Use
mail-header-parse-address-lax (bug#50049).
2021-08-14 15:23:29 +02:00
Lars Ingebrigtsen
e91b574bf8 Add new functions for lax mail address splitting
* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Autoload.
* lisp/mail/mail-parse.el (mail-header-parse-addresses-lax)
(mail-header-parse-address-lax): New functions.
2021-08-14 15:20:59 +02:00
Earl Hyatt
c58f8dda2b Add macro seq-setq.
* doc/lispref/sequences.texi (seq-setq): Document this macro.

* lisp/emacs-lisp/seq.el (seq-setq): New macro.

* test/lisp/emacs-lisp/seq-tests.el (test-seq-setq):
Test this macro (bug#50053).
2021-08-14 14:17:12 +02:00
Yikai Zhao
adb6c3f1a4 Fix memory-report counting of vector/hash table sizes
* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1):
Count element values in vectors and hash tables.

Copyright-paperwork-exempt: yes
2021-08-14 13:46:37 +02:00
Basil L. Contovounesios
37d48edf6d Fix merging of ambiguous nil maps
* lisp/emacs-lisp/map.el: Bump version to 3.1.
(map--merge): New merging subroutine that uses a hash table in place
of lists, for both efficiency and avoiding ambiguities (bug#49848).
(map-merge): Rewrite in terms of map--merge.
(map-merge-with): Ditto.  This ensures that FUNCTION is called
whenever two keys are merged, even if they are not eql (which could
happen until now).  It also makes map-merge-with consistent with
map-merge, thus achieving greater overall predictability.
* etc/NEWS: Announce this weakening of guarantees.
* test/lisp/emacs-lisp/map-tests.el (test-map-merge)
(test-map-merge-with): Don't depend on specific orderings.  Test
that nil is correctly merged into a plist.
2021-08-14 11:24:54 +01:00
Lars Ingebrigtsen
8fbb870083 Make debug' reset inhibit-read-only' while running
* lisp/emacs-lisp/debug.el (debug): Bind `inhibit-read-only' to
nil in case we're in a context that has bound it to t (bug#26947).
2021-08-13 15:50:14 +02:00
Stefan Monnier
5809728bc5 * lisp/emacs-lisp/lisp-mnt.el (lm-crack-address): Handle multi-addresses
(lm-authors, lm-maintainers): Adjust accordingly.
2021-08-12 13:55:38 -04:00
Stefan Monnier
96d83a8546 * lisp/emacs-lisp/pcase.el (pcase-setq): Align its semantics with pcase-let
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-setq): Rename from
pcase-setq and ajust accordingly.
2021-08-12 11:04:30 -04:00
Lars Ingebrigtsen
368c9f5e84 Clarify smie-indent-forward-token doc string
* lisp/emacs-lisp/smie.el (smie-indent-forward-token): Doc string
clarification (bug#31948).
2021-08-12 15:39:36 +02:00
Stefan Monnier
9445d7bf8c * lisp/emacs-lisp/cl-macs.el (fixnum, bignum): Fix type definitions 2021-08-11 22:42:06 -04:00
Earl Hyatt
2f90fa19b8 Add a `pcase-setq' macro
* doc/lispref/control.texi (Destructuring with pcase Patterns):
Document this macro.

* lisp/emacs-lisp/pcase.el (pcase-setq): New macro.  This macro is
the 'setq' equivalent of 'pcase-let'.

* test/lisp/emacs-lisp/pcase-tests.el (pcase-setq): Test this new
macro. (bug#49809).
2021-08-11 23:54:31 +02:00
Stefan Monnier
75de09b9de * lisp/emacs-lisp/cl-generic.el: Try and fix bug#49866
(cl-generic-generalizers): Remember the specializers that match
a given value.
(cl--generic-eql-generalizer): Adjust accordingly.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-test-01-eql):
Add corresponding test.
2021-08-09 19:03:42 -04:00
Stefan Monnier
0509f3921b * lisp/emacs-lisp/package.el (package-buffer-info): Fix typo 2021-08-09 18:55:25 -04:00
Stefan Monnier
4e6f98cd50 * lisp/emacs-lisp/package.el (package-buffer-info): Use lm-maintainers
Avoid the now obsolete `lm-maintainer`.
2021-08-09 12:05:22 -04:00
Lars Ingebrigtsen
fbd3207bb2 Further fixes for package-quickstart-refresh printing
* lisp/emacs-lisp/package.el (package-quickstart-refresh): Really
ensure that the structures aren't shortened (bug#49924).
2021-08-09 14:47:05 +02:00
Mattias Engdegård
3b7b181bde Use string-search instead of string-match[-p]
`string-search` is easier to understand, less error-prone, much
faster, does not pollute the regexp cache, and does not mutate global
state.  Use it where applicable and obviously safe (erring on the
conservative side).

* admin/authors.el (authors-canonical-file-name)
(authors-scan-change-log):
* lisp/apropos.el (apropos-command)
(apropos-documentation-property, apropos-symbols-internal):
* lisp/arc-mode.el (archive-arc-summarize)
(archive-zoo-summarize):
* lisp/calc/calc-aent.el (math-read-factor):
* lisp/calc/calc-ext.el (math-read-big-expr)
(math-format-nice-expr, math-format-number-fancy):
* lisp/calc/calc-forms.el (math-read-angle-brackets):
* lisp/calc/calc-graph.el (calc-graph-set-range):
* lisp/calc/calc-keypd.el (calc-keypad-press):
* lisp/calc/calc-lang.el (tex, latex, math-read-big-rec):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-user-define-permanent, math-define-exp):
* lisp/calc/calc.el (calc-record, calcDigit-key)
(calc-count-lines):
* lisp/calc/calcalg2.el (calc-solve-for, calc-poly-roots)
(math-do-integral):
* lisp/calc/calcalg3.el (calc-find-root, calc-find-minimum)
(calc-get-fit-variables):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/java.el (semantic-java-expand-tag):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/cedet/semantic/wisent/python.el
(semantic-python-instance-variable-p):
* lisp/cus-edit.el (get):
* lisp/descr-text.el (describe-text-sexp):
* lisp/dired-aux.el (dired-compress-file):
* lisp/dired-x.el (dired-make-relative-symlink):
* lisp/dired.el (dired-glob-regexp):
* lisp/dos-fns.el (dos-convert-standard-filename, dos-8+3-filename):
* lisp/edmacro.el (edmacro-format-keys):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/lisp-mnt.el (lm-keywords-list):
* lisp/emacs-lisp/warnings.el (display-warning):
* lisp/emulation/viper-ex.el (viper-ex-read-file-name)
(ex-print-display-lines):
* lisp/env.el (read-envvar-name, setenv):
* lisp/epa-mail.el (epa-mail-encrypt):
* lisp/epg.el (epg--start):
* lisp/erc/erc-backend.el (erc-parse-server-response):
* lisp/erc/erc-dcc.el (erc-dcc-member):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-server)
(erc-speedbar-expand-channel, erc-speedbar-expand-user):
* lisp/erc/erc.el (erc-send-input):
* lisp/eshell/em-glob.el (eshell-glob-entries):
* lisp/eshell/esh-proc.el (eshell-needs-pipe-p):
* lisp/eshell/esh-util.el (eshell-convert):
* lisp/eshell/esh-var.el (eshell-envvar-names):
* lisp/faces.el (x-resolve-font-name):
* lisp/ffap.el (ffap-file-at-point):
* lisp/files.el (wildcard-to-regexp, shell-quote-wildcard-pattern):
* lisp/forms.el (forms--update):
* lisp/frameset.el (frameset-filter-unshelve-param):
* lisp/gnus/gnus-art.el (article-decode-charset):
* lisp/gnus/gnus-kill.el (gnus-kill-parse-rn-kill-file):
* lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy):
* lisp/gnus/gnus-msg.el (gnus-summary-resend-message-insert-gcc)
(gnus-inews-insert-gcc):
* lisp/gnus/gnus-rfc1843.el (rfc1843-decode-article-body):
* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output)
(gnus-search--complete-key-data):
* lisp/gnus/gnus-spec.el (gnus-parse-simple-format):
* lisp/gnus/gnus-sum.el (gnus-summary-refer-article):
* lisp/gnus/gnus-util.el (gnus-extract-address-components)
(gnus-newsgroup-directory-form):
* lisp/gnus/gnus-uu.el (gnus-uu-grab-view):
* lisp/gnus/gnus.el (gnus-group-native-p, gnus-short-group-name):
* lisp/gnus/message.el (message-check-news-header-syntax)
(message-make-message-id, message-user-mail-address)
(message-make-fqdn, message-get-reply-headers, message-followup):
* lisp/gnus/mm-decode.el (mm-dissect-buffer):
* lisp/gnus/nnheader.el (nnheader-insert):
* lisp/gnus/nnimap.el (nnimap-process-quirk)
(nnimap-imap-ranges-to-gnus-ranges):
* lisp/gnus/nnmaildir.el (nnmaildir--ensure-suffix):
* lisp/gnus/nnmairix.el (nnmairix-determine-original-group-from-path):
* lisp/gnus/nnrss.el (nnrss-match-macro):
* lisp/gnus/nntp.el (nntp-find-group-and-number):
* lisp/help-fns.el (help--symbol-completion-table-affixation):
* lisp/help.el (help-function-arglist):
* lisp/hippie-exp.el (he-concat-directory-file-name):
* lisp/htmlfontify.el (hfy-relstub):
* lisp/ido.el (ido-make-prompt, ido-complete, ido-copy-current-word)
(ido-exhibit):
* lisp/image/image-converter.el (image-convert-p):
* lisp/info-xref.el (info-xref-docstrings):
* lisp/info.el (Info-toc-build, Info-follow-reference)
(Info-backward-node, Info-finder-find-node)
(Info-speedbar-expand-node):
* lisp/international/mule-diag.el (print-fontset-element):
* lisp/language/korea-util.el (default-korean-keyboard):
* lisp/linum.el (linum-after-change):
* lisp/mail/ietf-drums.el (ietf-drums-parse-address):
* lisp/mail/mail-utils.el (mail-dont-reply-to):
* lisp/mail/rfc2047.el (rfc2047-encode-1, rfc2047-decode-string):
* lisp/mail/rfc2231.el (rfc2231-parse-string):
* lisp/mail/rmailkwd.el (rmail-set-label):
* lisp/mail/rmailsum.el (rmail-header-summary):
* lisp/mail/smtpmail.el (smtpmail-maybe-append-domain)
(smtpmail-user-mail-address):
* lisp/mail/uce.el (uce-reply-to-uce):
* lisp/man.el (Man-default-man-entry):
* lisp/mh-e/mh-alias.el (mh-alias-gecos-name)
(mh-alias-minibuffer-confirm-address):
* lisp/mh-e/mh-comp.el (mh-forwarded-letter-subject):
* lisp/mh-e/mh-speed.el (mh-speed-parse-flists-output):
* lisp/mh-e/mh-utils.el (mh-collect-folder-names-filter)
(mh-folder-completion-function):
* lisp/minibuffer.el (completion--make-envvar-table)
(completion-file-name-table, completion-flex-try-completion)
(completion-flex-all-completions):
* lisp/mpc.el (mpc--proc-quote-string, mpc-cmd-special-tag-p)
(mpc-constraints-tag-lookup):
* lisp/net/ange-ftp.el (ange-ftp-send-cmd)
(ange-ftp-allow-child-lookup):
* lisp/net/mailcap.el (mailcap-mime-types):
* lisp/net/mairix.el (mairix-search-thread-this-article):
* lisp/net/pop3.el (pop3-open-server):
* lisp/net/soap-client.el (soap-decode-xs-complex-type):
* lisp/net/socks.el (socks-filter):
* lisp/nxml/nxml-outln.el (nxml-highlighted-qname):
* lisp/nxml/rng-cmpct.el (rng-c-expand-name, rng-c-expand-datatype):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1):
* lisp/obsolete/complete.el (partial-completion-mode)
(PC-do-completion):
* lisp/obsolete/longlines.el (longlines-encode-string):
* lisp/obsolete/nnir.el (nnir-compose-result):
* lisp/obsolete/terminal.el (te-quote-arg-for-sh):
* lisp/obsolete/tpu-edt.el (tpu-check-search-case):
* lisp/obsolete/url-ns.el (isPlainHostName):
* lisp/pcmpl-unix.el (pcomplete/scp):
* lisp/play/dunnet.el (dun-listify-string2, dun-get-path)
(dun-unix-parse, dun-doassign, dun-cat, dun-batch-unix-interface):
* lisp/progmodes/ebnf2ps.el: (ebnf-eps-header-footer-comment):
* lisp/progmodes/gdb-mi.el (gdb-var-delete)
(gdb-speedbar-expand-node, gdbmi-bnf-incomplete-record-result):
* lisp/progmodes/gud.el (gud-find-expr):
* lisp/progmodes/idlw-help.el (idlwave-do-context-help1):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode)
(idlwave-shell-filter-hidden-output, idlwave-shell-filter):
* lisp/progmodes/idlwave.el (idlwave-skip-label-or-case)
(idlwave-routine-info):
* lisp/progmodes/octave.el (inferior-octave-completion-at-point):
* lisp/progmodes/sh-script.el (sh-add-completer):
* lisp/progmodes/sql.el (defun):
* lisp/progmodes/xscheme.el (xscheme-process-filter):
* lisp/replace.el (query-replace-compile-replacement)
(map-query-replace-regexp):
* lisp/shell.el (shell--command-completion-data)
(shell-environment-variable-completion):
* lisp/simple.el (display-message-or-buffer):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/subr.el (split-string-and-unquote):
* lisp/tar-mode.el (tar-extract):
* lisp/term.el (term-command-hook, serial-read-name):
* lisp/textmodes/bibtex.el (bibtex-print-help-message):
* lisp/textmodes/ispell.el (ispell-lookup-words, ispell-filter)
(ispell-parse-output, ispell-buffer-local-parsing):
* lisp/textmodes/reftex-cite.el (reftex-do-citation):
* lisp/textmodes/reftex-parse.el (reftex-notice-new):
* lisp/textmodes/reftex-ref.el (reftex-show-entry):
* lisp/textmodes/reftex.el (reftex-compile-variables):
* lisp/textmodes/tex-mode.el (tex-send-command)
(tex-start-tex, tex-append):
* lisp/thingatpt.el (thing-at-point-url-at-point):
* lisp/tmm.el (tmm-add-one-shortcut):
* lisp/transient.el (transient-format-key):
* lisp/url/url-auth.el (url-basic-auth)
(url-digest-auth-directory-id-assoc):
* lisp/url/url-news.el (url-news):
* lisp/url/url-util.el (url-parse-query-string):
* lisp/vc/vc-cvs.el (vc-cvs-parse-entry):
* lisp/wid-browse.el (widget-browse-sexp):
* lisp/woman.el (woman-parse-colon-path, woman-mini-help)
(WoMan-getpage-in-background, woman-negative-vertical-space):
* lisp/xml.el:
* test/lisp/emacs-lisp/check-declare-tests.el
(check-declare-tests-warn):
* test/lisp/files-tests.el
(files-tests-file-name-non-special-dired-compress-handler):
* test/lisp/net/network-stream-tests.el (server-process-filter):
* test/src/coding-tests.el (ert-test-unibyte-buffer-dos-eol-decode):
Use `string-search` instead of `string-match` and `string-match-p`.
2021-08-09 11:35:56 +02:00
Mattias Engdegård
051434fdef Use string-replace instead of replace-regexp-in-string
`string-replace` is easier to understand, less error-prone, much
faster, and results in shorter Lisp and byte code.  Use it where
applicable and obviously safe (erring on the conservative side).

* admin/authors.el (authors-scan-change-log):
* lisp/autoinsert.el (auto-insert-alist):
* lisp/calc/calc-prog.el (calc-edit-macro-combine-alg-ent)
(calc-edit-macro-combine-ext-command)
(calc-edit-macro-combine-var-name):
* lisp/calc/calc-units.el (math-make-unit-string):
* lisp/calendar/cal-html.el (cal-html-comment):
* lisp/calendar/cal-tex.el (cal-tex-comment):
* lisp/calendar/icalendar.el (icalendar--convert-string-for-export)
(icalendar--convert-string-for-import):
* lisp/calendar/iso8601.el (iso8601--concat-regexps)
(iso8601--full-time-match, iso8601--combined-match):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/todo-mode.el (todo-filter-items-filename):
* lisp/cedet/cedet-files.el (cedet-directory-name-to-file-name)
(cedet-file-name-to-directory-name):
* lisp/comint.el (comint-watch-for-password-prompt):
* lisp/dired-aux.el (dired-do-chmod):
* lisp/dired-x.el (dired-man):
* lisp/dired.el (dired-insert-directory, dired-goto-file-1):
* lisp/emacs-lisp/comp.el (comp-c-func-name):
* lisp/emacs-lisp/re-builder.el (reb-copy):
* lisp/erc/erc-dcc.el (erc-dcc-unquote-filename):
* lisp/erc/erc.el (erc-quit-reason-zippy, erc-part-reason-zippy)
(erc-update-mode-line-buffer, erc-message-english-PART):
* lisp/files.el (make-backup-file-name-1, files--transform-file-name)
(read-file-modes):
* lisp/fringe.el (fringe-mode):
* lisp/gnus/gnus-art.el (gnus-button-handle-info-url):
* lisp/gnus/gnus-group.el (gnus-group-completing-read):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical):
* lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy):
* lisp/gnus/gnus-search.el (gnus-search-query-parse-date)
(gnus-search-transform-expression, gnus-search-run-search):
* lisp/gnus/gnus-start.el (gnus-dribble-enter):
* lisp/gnus/gnus-sum.el (gnus-summary-refer-article):
* lisp/gnus/gnus-util.el (gnus-mode-string-quote):
* lisp/gnus/message.el (message-put-addresses-in-ecomplete)
(message-parse-mailto-url, message-mailto-1):
* lisp/gnus/mml-sec.el (mml-secure-epg-sign):
* lisp/gnus/mml-smime.el (mml-smime-epg-verify):
* lisp/gnus/mml2015.el (mml2015-epg-verify):
* lisp/gnus/nnmaildir.el (nnmaildir--system-name)
(nnmaildir-request-list, nnmaildir-retrieve-groups)
(nnmaildir-request-group, nnmaildir-retrieve-headers):
* lisp/gnus/nnrss.el (nnrss-node-text):
* lisp/gnus/spam-report.el (spam-report-gmane-internal)
(spam-report-user-mail-address):
* lisp/ibuffer.el (name):
* lisp/image-dired.el (image-dired-pngnq-thumb)
(image-dired-pngcrush-thumb, image-dired-optipng-thumb)
(image-dired-create-thumb-1):
* lisp/info.el (Info-set-mode-line):
* lisp/international/mule-cmds.el (describe-language-environment):
* lisp/mail/rfc2231.el (rfc2231-parse-string):
* lisp/mail/rfc2368.el (rfc2368-parse-mailto-url):
* lisp/mail/rmail.el (rmail-insert-inbox-text)
(rmail-simplified-subject-regexp):
* lisp/mail/rmailout.el (rmail-output-body-to-file):
* lisp/mail/undigest.el (rmail-digest-rfc1153):
* lisp/man.el (Man-default-man-entry):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc--debug):
* lisp/net/browse-url.el (browse-url-mail):
* lisp/net/eww.el (eww-update-header-line-format):
* lisp/net/newst-backend.el (newsticker-save-item):
* lisp/net/rcirc.el (rcirc-sentinel):
* lisp/net/soap-client.el (soap-decode-date-time):
* lisp/nxml/rng-cmpct.el (rng-c-literal-2-re):
* lisp/nxml/xmltok.el (let*):
* lisp/obsolete/nnir.el (nnir-run-swish-e, nnir-run-hyrex)
(nnir-run-find-grep):
* lisp/play/dunnet.el (dun-doassign):
* lisp/play/handwrite.el (handwrite):
* lisp/proced.el (proced-format-args):
* lisp/profiler.el (profiler-report-header-line-format):
* lisp/progmodes/gdb-mi.el (gdb-mi-quote):
* lisp/progmodes/make-mode.el (makefile-bsdmake-rule-action-regex)
(makefile-make-font-lock-keywords):
* lisp/progmodes/prolog.el (prolog-guess-fill-prefix):
* lisp/progmodes/ruby-mode.el (ruby-toggle-string-quotes):
* lisp/progmodes/sql.el (sql-remove-tabs-filter, sql-str-literal):
* lisp/progmodes/which-func.el (which-func-current):
* lisp/replace.el (query-replace-read-from)
(occur-engine, replace-quote):
* lisp/select.el (xselect--encode-string):
* lisp/ses.el (ses-export-tab):
* lisp/subr.el (shell-quote-argument):
* lisp/term/pc-win.el (msdos-show-help):
* lisp/term/w32-win.el (w32--set-selection):
* lisp/term/xterm.el (gui-backend-set-selection):
* lisp/textmodes/picture.el (picture-tab-search):
* lisp/thumbs.el (thumbs-call-setroot-command):
* lisp/tooltip.el (tooltip-show-help-non-mode):
* lisp/transient.el (transient-format-key):
* lisp/url/url-mailto.el (url-mailto):
* lisp/vc/log-edit.el (log-edit-changelog-ours-p):
* lisp/vc/vc-bzr.el (vc-bzr-status):
* lisp/vc/vc-hg.el (vc-hg--glob-to-pcre):
* lisp/vc/vc-svn.el (vc-svn-after-dir-status):
* lisp/xdg.el (xdg-desktop-strings):
* test/lisp/electric-tests.el (defun):
* test/lisp/term-tests.el (term-simple-lines):
* test/lisp/time-stamp-tests.el (formatz-mod-del-colons):
* test/lisp/wdired-tests.el (wdired-test-bug32173-01)
(wdired-test-unfinished-edit-01):
* test/src/json-tests.el (json-parse-with-custom-null-and-false-objects):
Use `string-replace` instead of `replace-regexp-in-string`.
2021-08-08 19:25:26 +02:00
Lars Ingebrigtsen
e1ce9904aa Fix prin1 problem in package-quickstart-refresh
* lisp/emacs-lisp/package.el (package-quickstart-refresh): Bind
print-length/print-level before using prin1-to-string (bug#49924).
2021-08-07 13:02:01 +02:00
Lars Ingebrigtsen
bc1ffc5f6e Fix print-length issue in comp-run-async-workers
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Bind
print-length/print-level to ensure there's no truncation (bug#49922).
2021-08-07 12:59:22 +02:00
Mattias Engdegård
2a17925aab Cease attempts to const-propagate through setq
The current method of propagating constants through setq was unsound
because it relied on each setq form only being traversed at most once
during optimisation, which isn't necessarily true in general; it could
be made to miscompile code in rare cases.

Since it was only used in limited circumstances, disabling this
optimisation doesn't cost us much.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't update the known value when traversing `setq`.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
2021-08-05 15:33:05 +02:00
dickmao
1910800f93 Package archive location needs to be absolute filename
* lisp/emacs-lisp/package.el (package--with-response-buffer-1):
Actually check that URL is absolute (bug#49788).
2021-08-04 10:50:38 +02:00
Lars Ingebrigtsen
423a23ef75 Improve `define-globalized-minor-mode' doc strings
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Copy the description from easy-mmode--arg-docstring (bug#49843).
2021-08-04 09:38:45 +02:00
Stefan Monnier
b0d07396e8 * lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Don't emit warning
Also remove "WARNING" annotations after confirming that he code was right.
2021-08-03 19:02:11 -04:00
akater
6535fd1fa9 Evaluate eql specializers
* lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Evaluate
forms that are eql specializers.  Provide backward compatibility
with a warning.

* test/lisp/emacs-lisp/cl-generic-tests.el: Add a test.
* lisp/emacs-lisp/bindat.el (bindat--type): Adhere to the new rule.
* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Adhere to the new rule.
* lisp/emacs-lisp/map.el (map-into): Adhere to the new rule.
* lisp/emacs-lisp/radix-tree.el (map-into): Adhere to the new rule.
* lisp/frame.el (cl-generic-define-context-rewriter): Adhere to the new rule.
* lisp/gnus/gnus-search.el
(gnus-search-transform-expression): Adhere to the new rule.
* lisp/image/image-converter.el
(image-converter--probe image-converter--convert): Adhere to the new rule.
* lisp/mail/smtpmail.el (smtpmail-try-auth-method): Adhere to the new rule.
* lisp/progmodes/elisp-mode.el
(xref-backend-definitions)
(xref-backend-apropos): Adhere to the new rule.
* lisp/progmodes/etags.el (xref-backend-identifier-at-point)
(xref-backend-identifier-completion-table)
(xref-backend-identifier-completion-ignore-case)
(xref-backend-definitions)(xref-backend-apropos): Adhere to the new rule.
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-cl-defmethod-with-types-ok)
(checkdoc-cl-defmethod-qualified-ok)
(checkdoc-cl-defmethod-with-extra-qualifier-ok): Adhere to the new rule.

* etc/NEWS: Describe the change.
2021-08-03 18:26:15 -04:00