summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* checkdoc: Allow Lisp symbols to start a messageStefan Kangas2021-09-281-7/+30
| | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): Allow Lisp symbols to start a message. (checkdoc--error-bad-format-p): New helper function. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-test-error-format-is-good) (checkdoc-test-error-format-is-bad): New helper functions. (checkdoc-tests-error-message-bad-format-p) (checkdoc-tests-error-message-bad-format-p/defined-symbols) (checkdoc-tests-error-message-bad-format-p/not-capitalized): New tests.
* Fix automatic filling of docstring in cl-defstructStefan Kangas2021-09-271-4/+4
| | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix bug where a paragraph was filled as if it were a single line, which led to garbled output in the docstring. (Bug#50839) * test/lisp/subr-tests.el (subr-test-internal--format-docstring-line): New test.
* checkdoc: Don't add "Commentary" header to test filesStefan Kangas2021-09-261-2/+7
| | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Don't add "Commentary:" header if it looks like a test file.
* Add fast-path to ert--explain-string-equalStefan Kangas2021-09-261-3/+5
| | | | | | * lisp/emacs-lisp/ert.el (ert--explain-string-equal): Add fast-path to avoid doing extra work. Problem reported by Mattias Engdegård <mattiase@acm.org>.
* Rename "Homepage" field to "Website" in package descriptionStefan Kangas2021-09-261-12/+12
| | | | | | | | | | | * lisp/emacs-lisp/package.el (describe-package-1): Rename "Homepage" field to "Website". * test/lisp/emacs-lisp/package-tests.el (package-test-describe-package) (package-test-describe-installed-multi-file-package) (package-test-describe-non-installed-package) (package-test-describe-non-installed-multi-file-package): Update tests.
* Prefer https for other domains than gnu.org in package URLStefan Kangas2021-09-261-6/+11
| | | | | * lisp/emacs-lisp/package.el (describe-package-1): Prefer https for some other common domains in the package URL.
* Add test for lm-websiteStefan Kangas2021-09-261-3/+3
| | | | | | * lisp/emacs-lisp/lisp-mnt.el (lm-website): Use rx. * test/lisp/emacs-lisp/lisp-mnt-tests.el (lm--tests-lm-website): New test.
* Warn about overly long docstring in lambdaStefan Kangas2021-09-261-14/+8
| | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-length-warn): Warn about overly long docstring in lambda. (Bug#44858) (byte-compile--wide-docstring-p): Improve comment. * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-wide-docstring-defun.el"): Update to test for the above new warning.
* Fill some auto-generated docstring linesStefan Kangas2021-09-263-12/+16
| | | | | | | | | * lisp/cedet/mode-local.el (define-mode-local-override): * lisp/cedet/semantic/decorate/mode.el (define-semantic-decoration-style): * lisp/cedet/semantic/idle.el (define-semantic-idle-service): * lisp/emacs-lisp/derived.el (derived-mode-make-docstring): * lisp/emacs-lisp/eieio.el (defclass): Fill auto-generated docstring lines.
* Avoid false positives in bytecomp docstring width warningStefan Kangas2021-09-261-2/+10
| | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Ignore more function argument lists. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests-byte-compile--wide-docstring-p): New test.
* ; Adjust overly long docstrings to fit 80 charactersStefan Kangas2021-09-262-3/+3
|
* ert: Add basic explainer for string-equalStefan Kangas2021-09-261-0/+8
| | | | | * lisp/emacs-lisp/ert.el (ert--explain-string-equal): Add basic explainer for 'string-equal' based on 'ert--explain-equal'.
* checkdoc: Library footer must match package.el requirementStefan Kangas2021-09-261-4/+3
| | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Don't accept footer format unless it matches the requirement in package.el.
* Expand the ` doc string slightlyLars Ingebrigtsen2021-09-261-1/+4
| | | | | * lisp/emacs-lisp/backquote.el (backquote): Note that ` is used for other things in some macros (bug#25462).
* ; Bump seq version to 2.23Stefan Kangas2021-09-251-1/+1
|
* Revert part of previous doc fixStefan Kangas2021-09-251-4/+4
| | | | | * lisp/emacs-lisp/derived.el (define-derived-mode): Revert part of previous doc fix. This change made the text confusing. (Bug#17567)
* Fix byte-compiler crash for legal dynamic-binding codeMattias Engdegård2021-09-251-5/+12
| | | | | | | | | | This should really be taken care of by a syntax normalisation step in the frontend, but there is no such step for non-lexbind code yet. * lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Tolerate bindingsa without initialising expressions. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* Constant-propagate variables bound outside loopsMattias Engdegård2021-09-251-18/+34
| | | | | | | | | | | | | | Previously, variables bound outside `while` loops were not substituted inside even in the absense of mutation. Add the necessary mutation checking inside loops to allow propagation of values and aliased variables. * lisp/emacs-lisp/byte-opt.el (byte-optimize--inhibit-outside-loop-constprop): New variable. (byte-optimize-form-code-walker): First traverse each loop without substitution to discover mutation, then without restrictions. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-loop): New. (bytecomp-tests--test-cases): Add test cases.
* Use ambient lexical-binding value in ert-deftest body (bug#50738)Mattias Engdegård2021-09-251-1/+5
| | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-deftest): Evaluate the body of `ert-deftest` with the `lexical-binding` value of the source file (or more precisely the value in force when the definition is evaluated), which is what everyone expected, instead of always using dynamic binding which is what they got until now. * test/lisp/emacs-lisp/ert-tests.el (ert-test-deftest-lexical-binding-t): New test.
* Renege on anonymous &rest (bug#50268, bug#50720)Mattias Engdegård2021-09-251-0/+2
| | | | | | | | | | | | | | | | Allowing &rest without a variable name following turned out not to be very useful, and it never worked properly. Disallow it. * lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list): * src/eval.c (funcall_lambda): Signal error for &rest without variable name. * doc/lispref/functions.texi (Argument List): Adjust manual. * etc/NEWS (file): Announce. * test/src/eval-tests.el (eval-tests--bugs-24912-and-24913): Extend test, also checking with and without lexical binding. (eval-tests-accept-empty-optional-rest): Reduce to... (eval-tests-accept-empty-optional): ...this, again checking with and without lexical binding.
* Clarify define-derived-mode docstringStefan Kangas2021-09-251-11/+11
| | | | | | | | | | * lisp/emacs-lisp/derived.el (define-derived-mode): Doc fixes; correctly mention that the mode name is used in the mode line, clarify argument types, and how the mode hook is named. (Bug17567) (derived-mode-hook-name, derived-mode-map-name) (derived-mode-syntax-table-name, derived-mode-abbrev-table-name): Clarify that argument is a symbol.
* Minor clarification of define-minor-mode :keymap argumentStefan Kangas2021-09-251-2/+2
| | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Minor doc fix; clarify by saying that ":keymap" should be an "unquoted variable name". (Bug#25505)
* Indent bodies of local function definitions properly in elisp-modeakater2021-09-251-10/+35
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Check for local defforms (`cl-flet' and `cl-labels'). (lisp--local-defform-body): New auxiliary function (bug#9622).
* Fix alignment on font size change in tabulated-list-modeStefan Kangas2021-09-251-1/+2
| | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col): Fix bug where the columns didn't align correctly when using 'text-scale-mode' to decrease the font size. (Bug#48639)
* Doc fix; cl-random is only pseudo-randomStefan Kangas2021-09-251-1/+1
| | | | | * lisp/emacs-lisp/cl-extra.el (cl-random): Doc fix; say it's only pseudo-random.
* checkdoc: Don't ask to disambiguate mode namesStefan Kangas2021-09-241-1/+4
| | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Don't ask to disambiguate mode names. (Bug#4110)
* Fix recently introduced bug in checkdocStefan Kangas2021-09-241-2/+3
| | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Fix recently introduced bug where some abbreviations weren't recognized. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-in-abbrevation-p/basic-case): Extend test.
* checkdoc: Improve wide line warning to decrease false positivesStefan Kangas2021-09-241-6/+14
| | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Respect 'byte-compile-docstring-max-column' if it is set. Allow the first line to be three characters longer than the others to account for indentation and the opening string character.
* Use command substitution instead of raw keys in more placesStefan Kangas2021-09-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * admin/authors.el (authors): * lisp/abbrev.el (abbrev-suggest-show-report): * lisp/calc/calc.el (calc-display-trail, calc): * lisp/completion.el (completion-locate-db-error): * lisp/dired-x.el (dired-extra-startup): * lisp/emacs-lisp/package.el (package-install-selected-packages): * lisp/emulation/viper.el (viper-mode): * lisp/facemenu.el (list-colors-display): * lisp/mail/emacsbug.el (report-emacs-bug-hook): * lisp/mail/sendmail.el (mail): * lisp/menu-bar.el (menu-bar-mode): * lisp/org/org.el (org-revert-all-org-buffers): * lisp/progmodes/antlr-mode.el (antlr-help-rules-intro) (antlr-insert-makefile-rules): * lisp/progmodes/gdb-mi.el (gdb--check-interpreter): * lisp/progmodes/xscheme.el (xscheme-process-sentinel): * lisp/ps-print.el (ps-font-info-database): * lisp/recentf.el (recentf-edit-list, recentf-open-files): * lisp/vc/ediff-util.el (ediff-suspend): * lisp/vc/pcvs.el (cvs-mode): * lisp/vc/vc-bzr.el (vc-bzr-dir-extra-headers): Use command substitution.
* Prefer seq-random-elt to nth+randomStefan Kangas2021-09-241-0/+1
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-random-elt): Autoload. * lisp/avoid.el (mouse-avoidance-random-shape): * lisp/epa-ks.el (epa-ks--query-url): * lisp/erc/erc-networks.el (erc-server-select): * lisp/gnus/gnus-fun.el (gnus--random-face-with-type) (gnus-fun-ppm-change-string): * lisp/net/soap-inspect.el (soap-sample-value-for-xs-simple-type): * lisp/obsolete/landmark.el (landmark-random-move): * lisp/play/mpuz.el (mpuz-build-random-perm): * lisp/play/zone.el (zone-pgm-stress): * lisp/vc/add-log.el (add-change-log-entry): * test/lisp/net/tramp-tests.el (tramp-test44-asynchronous-requests): Prefer seq-random-elt to nth+random.
* ; * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Doc fix.Stefan Kangas2021-09-241-2/+2
|
* checkdoc: Add abbreviation and simplifyStefan Kangas2021-09-231-5/+6
| | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Add abbreviation "a.k.a.". Simplify.
* Avoid jumping too far in checkdoc-in-abbreviation-pStefan Kangas2021-09-231-19/+23
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Use 'forward-ward' instead of 'forward-sexp' to avoid jumping too far in some situations. (Bug#50731) * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests--abbrev-test): New helper function. (checkdoc-tests-in-abbrevation-p/basic-case): Rename from 'checkdoc-tests-in-abbrevation-p'. (checkdoc-tests-in-abbrevation-p/with-parens) (checkdoc-tests-in-abbrevation-p/with-escaped-parens): Use above new helper function. (checkdoc-tests-in-abbrevation-p/single-char) (checkdoc-tests-in-abbrevation-p/with-em-dash) (checkdoc-tests-in-abbrevation-p/incorrect-abbreviation): New tests.
* Improve error messaging from byte-compiling dotted listsLars Ingebrigtsen2021-09-221-0/+2
| | | | | | | | | | | | | * lisp/emacs-lisp/cconv.el (cconv-analyze-form): Improve error messaging when byte-compiling dotted lists (bug#35186). Test case -- byte-compile the following file: ;;; -*- lexical-binding: t -*- (defun foo () (+ 1 2) (a . b))
* Change how thread-first/thread-last indent the first argumentLars Ingebrigtsen2021-09-221-3/+3
| | | | | | | | | | | | | | * lisp/doc-view.el (doc-view--current-cache-dir): Reindent. * lisp/emacs-lisp/subr-x.el (thread-first): (thread-last): Change indentation to match examples. (internal--build-binding): Reindent. * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-thread-first-function-names-are-threaded): (subr-x-test-thread-first-examples): (subr-x-test-thread-last-function-names-are-threaded): (subr-x-test-thread-last-examples): Reindent.
* ; * etc/NEWS: Improve wording of an item.Stefan Kangas2021-09-211-2/+3
| | | | * lisp/emacs-lisp/hierarchy.el: Improve wording of package description.
* Don't quote nil and t in doc strings and commentsLars Ingebrigtsen2021-09-217-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/minibuf-tests.el (test-try-completion-ignore-case): * test/lisp/url/url-auth-tests.el (url-auth-test-digest-auth-retrieve-cache): * test/lisp/subr-tests.el (subr-tests-add-hook-depth): * test/lisp/so-long-tests/so-long-tests.el (so-long-tests-invisible-buffer-function): * test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-sort): * src/xfaces.c: * src/process.c (Finterrupt_process): (syms_of_process): * src/minibuf.c (Fread_from_minibuffer): (Fcompleting_read): (syms_of_minibuf): * src/dispnew.c (syms_of_display): * src/data.c: * lisp/so-long.el (so-long--hack-local-variables): * lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions): (elisp--xref-find-definitions): * lisp/org/ox-html.el (org-html-htmlize-output-type): * lisp/org/org-agenda.el (org-agenda-do-in-region): * lisp/net/tramp.el: * lisp/minibuffer.el (set-minibuffer-message): * lisp/isearch.el (isearch-wrap-pause): (isearch-repeat-on-direction-change): * lisp/emacs-lisp/timer.el (timer): * lisp/emacs-lisp/package.el (package-read-archive-contents): * lisp/emacs-lisp/faceup.el (faceup-next-property-change): * lisp/emacs-lisp/comp.el (comp-func): * lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p): * lisp/emacs-lisp/cl-macs.el (cl-do): (cl-do*): (cl--self-tco): * lisp/emacs-lisp/bytecomp.el (byte-compile-unresolved-functions): (byte-compile-cond-jump-table): Don't quote t and nil.
* Add new function `ensure-list'Lars Ingebrigtsen2021-09-211-0/+3
| | | | | | | | * doc/lispref/lists.texi (Building Lists): Document it. * lisp/subr.el (ensure-list): New function. * lisp/emacs-lisp/shortdoc.el (list): Mention it.
* ; * lisp/emacs-lisp/checkdoc.el: Fix warnings.Stefan Kangas2021-09-211-4/+5
|
* Minor clean-up and fixes in checkdocStefan Kangas2021-09-211-44/+44
| | | | | | | | * lisp/emacs-lisp/checkdoc.el: Minor doc fixes. Remove unnecessary space at the end of 'y-or-n-p' prompts. Move obsolete definitions to the end of the file. (checkdoc-symbol-words, checkdoc-common-verbs-wrong-voice): Add some more common words.
* checkdoc: New defvars to disable some warningsStefan Kangas2021-09-211-10/+42
| | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc--argument-missing-flag) (checkdoc--disambiguate-symbol-flag) (checkdoc--interactive-docstring-flag): New defvars to disable some warnings. These are intended for use with Emacs itself rather than with third-party libraries. (checkdoc-this-string-valid, checkdoc-this-string-valid-engine): Respect above new variables.
* Add new command 'checkdoc-dired'Stefan Kangas2021-09-211-0/+33
| | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-dired): New command. (checkdoc--dired-skip-lines-re): New constant.
* Consistently test alist keys with equal in map.elBasil L. Contovounesios2021-09-211-7/+11
| | | | | | | | | | | | | | | | | * etc/NEWS: Announce new default behavior of map-elt and map-delete on alists. * lisp/emacs-lisp/map.el: Bump to version 3.2. (map-elt): Test alist keys with equal by default. Betray a little bit more information in the docstring on which functions are used for which map types. (Bug#47368) (map-put): Update docstring accordingly. (map--plist-delete): Consistently test plist keys with eq. (map-delete): Consistently test alist keys with equal. * test/lisp/emacs-lisp/map-tests.el (test-map-elt-testfn): Update for new map-elt behavior. (test-map-put!-alist, test-map-delete-alist): New tests.
* Revert "Flag checkdoc-symbol-words as a :safe variable"Stefan Kangas2021-09-191-1/+0
| | | | | | | There was no need for this change, as this variable was already marked as :safe. This reverts commit 222a7a1a8afdf6921e5981133c605c2d695e9281.
* ; Fix typo in package.el doc string王滋涵 Zephyr Wang2021-09-191-1/+1
| | | | | | | * lisp/emacs-lisp/package.el (package-archive-column-width): Fix copy-paste in doc string (bug#50678). Copyright-paperwork-exempt: yes
* Clarify docstring of pcase-exhaustiveStefan Kangas2021-09-191-1/+5
| | | | | * lisp/emacs-lisp/pcase.el (pcase-exhaustive): Clarify docstring by contrasting with pcase. (Bug#44166)
* checkdoc: Verify format of yes-or-no-p and format-messageStefan Kangas2021-09-191-5/+13
| | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-next-string): Check also for "yes-or-no-p" and "format-message". Convert regexps to use rx.
* Flag checkdoc-symbol-words as a :safe variableStefan Kangas2021-09-191-0/+1
| | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-symbol-words): Flag as a safe file local variable.
* Use command substitution in checkdoc-recursive-editStefan Kangas2021-09-181-18/+21
| | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-recursive-edit): Use command substitution. (checkdoc--help-buffer): New variable. Use it instead of hard-coded string.
* Use command substitution for exit-recursive-editStefan Kangas2021-09-181-1/+2
| | | | | | * lisp/bindings.el (mode-line-modes): * lisp/emacs-lisp/checkdoc.el (checkdoc-recursive-edit): Use command substitution for 'exit-recursive-edit'.