summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Fix #'fun handling inside `labels' (Bug#31792)Noam Postavsky2018-06-192-7/+17
| | | | | | | | | | | | | * lisp/emacs-lisp/cl.el (labels): Apply the equivalent of the cl-labels change from 2015-01-16 "* lisp/emacs-lisp/cl-macs.el: Fix last change". * test/lisp/emacs-lisp/cl-tests.el (labels-function-quoting): New test. * lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Improve docstring, link to relevant manual page. * doc/misc/cl.texi (Function Bindings): Don't imply that function cells of symbols are modified by cl-flet. Don't claim that cl-flet or cl-labels affect references of the form (quote FUNC).
* Fix byte compilation of (eq foo 'default)Paul Eggert2018-06-161-9/+15
| | | | | | | | | | | | | Backport from master. Do not use the symbol ‘default’ as a special marker. Instead, use a value that cannot appear in the program, improving on a patch proposed by Robert Cochran (Bug#31718#14). * lisp/emacs-lisp/bytecomp.el (byte-compile--default-val): New constant. (byte-compile-cond-jump-table-info) (byte-compile-cond-jump-table): Use it instead of 'default. * test/lisp/emacs-lisp/bytecomp-tests.el: (byte-opt-testsuite-arith-data): Add a test for the bug.
* Make cl-print respect print-quoted (bug#31649)Gemini Lasswell2018-06-071-2/+7
| | | | | | * lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Observe print-quoted when printing quote and its relatives. Add printing of 'function' as #'.
* Make cl-print respect print-level and print-length (bug#31559)Gemini Lasswell2018-06-041-47/+68
| | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print--depth): New variable. (cl-print-object) <cons>: Print ellipsis if printing depth greater than 'print-level' or length of list greater than 'print-length'. (cl-print-object) <vector>: Truncate printing with ellipsis if vector is longer than 'print-length'. (cl-print-object) <cl-structure-object>: Truncate printing with ellipsis if structure has more slots than 'print-length'. (cl-print-object) <:around>: Bind 'cl-print--depth'. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-3, cl-print-tests-4): New tests. (cherry picked from commit 0f48d18fd2a30f29cc3592a835d2a2254c9b0afb)
* Update doc string of 'rx'Eli Zaretskii2018-06-031-6/+12
| | | | | * lisp/emacs-lisp/rx.el (rx): Update the description of some character classes.
* Fix cl-print for circular sublists (Bug#31146)Noam Postavsky2018-06-031-3/+6
| | | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Push each element of list being printed onto cl-print--currently-printing. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle-2): New test. (cherry picked from commit b8aa7ecf54c9b164a59f1b0e9f9fe90531dadd20)
* Improve read-multiple-choice docstring (Bug#31628)Damien Cassou2018-05-291-9/+9
| | | | * lisp/emacs-lisp/rmc.el (read-multiple-choice): Improve docstring.
* Overhaul pcase documentationThien-Thi Nguyen2018-05-271-51/+51
| | | | | | | | | | | | | | | | | | | Suggested by Drew Adams (Bug#31311). * doc/lispref/control.texi (Control Structures): Add "Pattern-Matching Conditional" to menu, before "Iteration". (Conditionals): Delete menu. (Pattern matching case statement): Delete node/subsection, by actually moving, renaming, and overhauling it to... (Pattern-Matching Conditional): ...new node/section. (pcase Macro): New node/subsection. (Extending pcase): Likewise. (Backquote Patterns): Likewise. * doc/lispref/elisp.texi (Top) In @detailmenu, add "Pattern-Matching Conditional" under "Control Structures" section and delete "Conditionals" section. * lisp/emacs-lisp/pcase.el (pcase): Rewrite docstring. (pcase-defmacro \` (qpat) ...): Likewise.
* Use EXPVAL in docstrings of patterns defined using pcase-defmacroThien-Thi Nguyen2018-05-274-9/+11
| | | | | | | | | Suggested by Drew Adams (Bug#31311). * lisp/emacs-lisp/cl-macs.el (cl-struct): ...here. * lisp/emacs-lisp/eieio.el (eieio): Likewise. * lisp/emacs-lisp/radix-tree.el (radix-tree-leaf): Likewise. * lisp/emacs-lisp/rx.el (rx): Likewise.
* Introduce EXPVAL for pcase, pcase-defmacro docstringsThien-Thi Nguyen2018-05-271-2/+6
| | | | | | | | | Suggested by Drew Adams (Bug#31311). * lisp/emacs-lisp/pcase.el (pcase): Use EXPVAL in docstring to stand for the result of evaluating EXP. (pcase-defmacro): Add (fn ...) form in docstring that includes [DOC], and the EXPVAL convention.
* Ensure pcase doc shows `QPAT first among extensionsThien-Thi Nguyen2018-05-271-9/+24
| | | | | | | * lisp/emacs-lisp/pcase.el (pcase--make-docstring): Split extensions display into two phases, collection and display, separated by a reordering step that ensures backquote is the first.
* Clarify when to use advice-add vs add-functionNoam Postavsky2018-05-221-0/+3
| | | | | * lisp/emacs-lisp/nadvice.el (add-function): Note in docstring that advice-add should be used for named functions.
* * lisp/emacs-lisp/inline.el: Clarify apparent typosStefan Monnier2018-04-041-0/+4
|
* Quote a few backticks in docstrings.Philipp Stephani2018-04-011-3/+3
| | | | | * lisp/emacs-lisp/macroexp.el (macroexp-progn, macroexp-let*) (macroexp-if): Quote backtick in docstrings.
* Document return value of pcase (Bug#30425)Noam Postavsky2018-03-311-2/+5
| | | | | | | | * doc/lispref/control.texi (Pattern matching case statement): * lisp/emacs-lisp/pcase.el (pcase): State that pcase returns nil if no patterns match. (pcase-exhaustive): State that an error is signaled if no patterns match.
* ; Fix some tiny doc typosGlenn Morris2018-03-271-1/+1
|
* De-obsolete `if-let' and `when-let'Michael Heerdegen2018-03-271-20/+26
| | | | | | | | | | For the following release it is planned to make `if-let*' and `when-let*' aliases for `if-let' and `when-let'. For now we revert declaring `if-let' and `when-let' obsolete and tweak the docstrings. * lisp/emacs-lisp/subr-x.el (if-let*, when-let*): Make docstrings refer to those of `if-let' and `when-let'. (if-let, when-let): De-obsolete. Rewrite documentation.
* * lisp/htmlfontify.el (hfy-begin-span-handler): Doc fix.Glenn Morris2018-03-261-2/+2
|
* Improve warning and error messagesEric Abrahamsen2018-03-221-8/+12
| | | | | | * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read, (eieio-persistent-validate/fix-slot-value): Indicate exactly what went wrong.
* Let eieio-persistent-read read what object-write has writtenEric Abrahamsen2018-03-221-8/+17
| | | | | | | | | | | * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): `object-write' may quote lists inside hash tables and vectors, so unquote those lists here. This patch allows the eieio-persistent write/restore process to perform a clean round trip. It only handles a very specific and limited range of object structures, but at least the write and read procedures match.
* Handle possible classtype values in eieio-persistent-readEric Abrahamsen2018-03-221-1/+1
| | | | | | * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): The function `eieio-persistent-slot-type-is-class-p' could return either a single class, or a list of classes.
* Clarify that nil doesn't match itself as a cl-case clause (Bug#30749)Noam Postavsky2018-03-101-7/+9
| | | | | * lisp/emacs-lisp/cl-macs.el (cl-case): Mention that the ATOM => (ATOM) short form is only for non-nil ATOMs.
* Revert last commitMichael Heerdegen2018-03-061-23/+32
| | | | | This reverts commit af4697faa1f5b643f63a9ea61aa205a4c1432e23. It's too late for this to be in the release.
* Define if-let* and derivatives as aliases for if-let etcMichael Heerdegen2018-03-061-32/+23
| | | | | | | | | | | | | | | | | | This commit reverts declaring `if-let' and `when-let' obsolete in favor of the new `if-let*' and `when-let*' versions because of the compiler warning mess (Bug#30039). Instead we make foo-let* aliases for foo-let. The old single-tuple variable spec case is still supported for backward compatibility. * lisp/emacs-lisp/subr-x.el (if-let, when-let): Don't declare obsolete. Tweak edebug specs. (and-let): Renamed from `and-let*' for compatibility with the names `if-let' and `when-let'. (if-let*, when-let*, and-let*): Define as aliases for `if-let', `when-let' and `and-let'. * test/lisp/emacs-lisp/subr-x-tests.el (if-let-single-tuple-case-test) (when-let-single-tuple-case-test): New tests for the single-binding tuple case. In the whole file, prefer the names without "*".
* Remove outdated comment in syntax.elEli Zaretskii2018-03-031-6/+0
| | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss-toplevel-pos): Remove outdated comment. (Bug#30617)
* ; Spelling and grammar fixes.Paul Eggert2018-02-171-1/+1
|
* Improve documentation of Profiling featuresEli Zaretskii2018-02-172-3/+5
| | | | | | | | * doc/lispref/debugging.texi (Profiling): Improve the description of elp.el. Improve wording of the rest of the section. (Bug#30491) * lisp/emacs-lisp/elp.el (elp-instrument-list): Make the interactive invocation work. Doc fix.
* ; Fix doc typos related to indefinite articlesGlenn Morris2018-02-161-1/+1
|
* ; Fix doc typos related to indefinite articlesGlenn Morris2018-02-162-2/+2
|
* Make 'byte-compile-error-on-warn' a safe file variableRobert Cochran2018-02-161-0/+5
| | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-error-on-warn): Mark as a safe local variable for boolean values.
* Define cl-type-definition button type as needed (Bug#28899)Noam Postavsky2018-01-301-1/+4
| | | | | * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor): Require `cl-extra' before using the `cl-type-definition' button type.
* * lisp/emacs-lisp/rx.el (rx): Fix the definition of 'blank'.Philipp Stephani2018-01-301-4/+7
|
* Revert "Fix tempfile creation when byte compiling"Eli Zaretskii2018-01-201-1/+11
| | | | | | This reverts commit 4fd446e9f65e5531b18d4a0c5e08a6eeabc292d8: * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Put tempfile next to the target file, as was the original intent.
* Fix tempfile creation when byte compilingPaul Eggert2018-01-191-11/+1
| | | | | | | | This improves on the recent fix for master failing to build on FreeBSD. Suggested by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Put tempfile next to the target file, as was the original intent.
* * lisp/emacs-lisp/bytecomp.el: Tweak last changeStefan Monnier2018-01-191-7/+7
| | | | (byte-compile-file): Move comment closer to the code it describes.
* Unbreak building Emacs on FreeBSDEli Zaretskii2018-01-191-1/+11
| | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't create the temporary file under temporary-file-directory if the file being compiled is specified by an absolute file name. This avoids problems with ACL copying from temporary-file-directory on FreeBSD. For the details, see http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00513.html.
* Handle case-insensitive filenames for load-path shadows (Bug#5845)Noam Postavsky2018-01-181-2/+8
| | | | | | | | | * lisp/emacs-lisp/shadow.el (load-path-shadows-find): Check for shadowing with case-insensitive matching for files of case-insensitive directories (as determined by `file-name-case-insensitive-p'). * test/lisp/emacs-lisp/shadow-tests.el: New test. * test/lisp/emacs-lisp/shadow-resources/p1/foo.el: * test/lisp/emacs-lisp/shadow-resources/p2/FOO.el: New test files.
* * lisp/emacs-lisp/generator.el (iter-defun): Add 'doc-string' prop.Stefan Monnier2018-01-111-1/+2
|
* * lisp/emacs-lisp/syntax.el (syntax-propertize): Fix bug#29767Stefan Monnier2018-01-111-0/+8
|
* Fix mark-defun when there's no spaces between successive defuns.Alan Mackenzie2018-01-061-10/+8
| | | | | | | | | | | The problem was a parse-partial-sexp call which tried to use the STOPBEFORE argument to detect non-syntactic WS. This fails on a "}", which does not begin a sexp. * lisp/emacs-lisp/lisp.h (beginning-of-defun--in-emptyish-line-p): Enhance to handle BOL being in a string. (beginning-of-defun-comments): Call the above function in place of the call to parse-partial-sexp.
* Fix copyright years by handPaul Eggert2018-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* Update copyright year to 2018Paul Eggert2018-01-0186-86/+86
| | | | Run admin/update-copyright.
* * lisp/emacs-lisp/inline.el (define-inline): Add a doc string.Eli Zaretskii2017-12-221-0/+4
|
* ; Replace non-ascii quote characters in doc strings etcGlenn Morris2017-12-201-1/+1
|
* * lisp/subr.el (delayed-after-hook-functions): Rename from ...-formsStefan Monnier2017-12-181-1/+1
| | | | | | (run-mode-hooks): `funcall` the functions instead of `eval`ing the forms. * lisp/emacs-lisp/derived.el (define-derived-mode): Push functions rather than forms (bug#29679).
* Partially revert "Mention new strictness for &optional, &rest..."Noam Postavsky2017-12-151-27/+11
| | | | | | | | | | | | | The changes to cl argument parsing are not backwards compatible, and cause inconvenience when writing macros (e.g., instead of doing '&aux ,@auxargs', some more complicated conditionals would be required). The `cl-defstruct' macro makes use of this convenience when defining empty structs (Bug#29728). * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): (cl--do-&aux, cl--do-arglist): Undo strict checking of &rest, &key, and &aux. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-bad-arglist): Remove test.
* Mention new strictness for &optional, &rest in arglists (Bug#29165)Noam Postavsky2017-12-131-11/+27
| | | | | | | | | | * etc/NEWS: Explain that '&optional' not followed by a variable is now an error. * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda, cl--do-&aux) (cl--do-arglist): Also reject '&optional', '&rest', or '&aux' not followed by a variable for consistency. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-bad-arglist): New test.
* Add missing :version tags revealed by cusver-checkGlenn Morris2017-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/comint.el (comint-move-point-for-matching-input): * lisp/epa.el (epa-replace-original-text): * lisp/image-dired.el (image-dired-cmd-optipng-program) (image-dired-cmd-optipng-options): * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-use-jump-table): * lisp/gnus/gnus-cloud.el (gnus-cloud-storage-method) (gnus-cloud-interactive): * lisp/net/mailcap.el (mailcap-user-mime-data): * lisp/progmodes/cc-vars.el (c-asymmetry-fontification-flag) (c-noise-macro-names, c-noise-macro-with-parens-names): * lisp/progmodes/flymake.el (flymake-start-on-flymake-mode) (flymake-wrap-around): * lisp/progmodes/grep.el (grep-use-null-filename-separator): * lisp/progmodes/js.el (js-indent-align-list-continuation): * lisp/progmodes/perl-mode.el (perl-flymake-command): * lisp/progmodes/python.el (python-flymake-command) (python-flymake-command-output-pattern, python-flymake-msg-alist): * lisp/progmodes/ruby-mode.el (ruby-flymake-use-rubocop-if-available) (ruby-rubocop-config): * lisp/textmodes/less-css-mode.el (less-css): * lisp/textmodes/tex-mode.el (tex-chktex-program) (tex-chktex-extra-flags): Add missing :version tags.
* Handle hash tables and vectors when reading/writing EIEIO objectsEric Abrahamsen2017-12-092-0/+39
| | | | | | | | | | * lisp/emacs-lisp/eieio.el (eieio-override-prin1): EIEIO objects printed with `prin1' can no longer be read with `read'. Make sure they are printed with object-write instead, even when they're inside hash tables and vectors. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Check for written representations of objects inside hash tables and vectors, and reconstruct them.
* Let autoload-compute-prefix be set file-locally (Bug#29471)Noam Postavsky2017-12-021-0/+1
| | | | | * lisp/emacs-lisp/autoload.el (autoload-compute-prefixes): Mark boolean values as safe.