summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow customizing line length of ert backtraces in batch modeGlenn Morris2017-09-051-12/+19
| | | | | | * lisp/emacs-lisp/ert.el (ert-batch-backtrace-right-margin): Make it a user option. (ert-run-tests-batch): Handle ert-batch-backtrace-right-margin nil.
* Turn off checkdoc complaint about default argument orderMark Oteiza2017-09-011-1/+2
| | | | | | * etc/NEWS: Mention change. * lisp/emacs-lisp/checkdoc.el (checkdoc-arguments-in-order-flag): Disable by default, note version.
* Support lazy loading for autogenerated usage docstrings too (Bug#27748)Noam Postavsky2017-08-301-1/+1
| | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble): Consider any documentation that ended up in code as a docstring (e.g., autogenerated (fn ARG1 ARG2) type things), not just what the user passed.
* Drop docstrings from cl-defsubst produced inline bodies (Bug#27748)Noam Postavsky2017-08-301-1/+2
| | | | | * lisp/emacs-lisp/cl-macs.el (cl-defsubst): Use macroexp-parse-progn to drop the docstring. Add a simple docstring to the compiler-macro.
* Minor simplification for byte-compile-constant-pushNoam Postavsky2017-08-291-5/+4
| | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-constant): Move the meat of the code from here... (byte-compile-constant-push): ... to here. No need to bind byte-compile--for-effect anymore.
* Fix over-protection of byte-compiled filesPaul Eggert2017-08-262-1/+12
| | | | | | | | | | Problem reported by Sven Joachim (Bug#28244). Also, fix similar problem for autoload files. * lisp/emacs-lisp/autoload.el (autoload--save-buffer): Set temp file modes to the buffer-file-name file modes (or 666 if not available) as adjusted by umask. * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Set temp file modes to 666 as adjusted by umask.
* * lisp/emacs-lisp/package.el: Don't let failure stop usStefan Monnier2017-08-251-27/+33
| | | | | | (package-activate-1): Don't throw an error for missing deps. (package-unpack): Don't bother compiling if activation failed. (package-initialize): Report failures but keep activating other packages.
* Simplify eldoc-messageDmitry Gutov2017-08-211-11/+4
| | | | | * lisp/emacs-lisp/eldoc.el (eldoc-message): Simplify. Don't use ARGS because no callers pass them. Discussed in bug#27230.
* Stop printing '4' in .elc files after 'define-symbol-prop' callsNoam Postavsky2017-08-191-1/+2
| | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-define-symbol-prop): Return nil in case we have compiled the form, to prevent a redundant constant from getting added to the compiled output.
* Improve support of display-line-numbers in package.elEli Zaretskii2017-08-192-5/+8
| | | | | | | | * lisp/emacs-lisp/package.el (package-menu--refresh): Redisplay the header. (Bug#27895) * lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width): Fix the case when display-line-numbers is nil.
* ; Fix last changeEli Zaretskii2017-08-191-3/+4
| | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width): Fix last change.
* Improve support of display-line-numbers in tabulated-list-modeEli Zaretskii2017-08-191-2/+13
| | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width): New function. (tabulated-list-init-header, tabulated-list-print-entry): Use it. (Bug#27895)
* Adapt tabulated list when display-line-number is turned onEli Zaretskii2017-08-121-1/+3
| | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Add a hook to revert the display when display-line-numbers is turned on. (Bug#27895)
* Add new face 'header-line-highlight'Alexander Gramiak2017-08-121-1/+1
| | | | | | | | * lisp/faces.el: Define the face. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header): * lisp/info.el (Info-fontify-node): Use the new face. * doc/emacs/display.texi (Standard Faces): * etc/NEWS: Document the new face. (Bug#28033)
* Don't define gv expanders in compiler's runtime (Bug#27016)Noam Postavsky2017-08-071-6/+1
| | | | | | | | This prevents definitions being compiled from leaking into the current Emacs doing the compilation. * lisp/emacs-lisp/gv.el (gv-define-expander): Use function-put instead of `put' with `eval-and-compile'. * test/lisp/emacs-lisp/gv-tests.el: New tests.
* Let the cl-typep effects of defclass work during compilation (Bug#27718)Noam Postavsky2017-08-071-1/+1
| | | | | | | | | * lisp/emacs-lisp/eieio.el (defclass): Use `define-symbol-prop' instead of `put'. * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-tests--dummy-function): Remove. (eieio-test-25-slot-tests, eieio-test-23-inheritance-check): Don't expect to fail if compiled.
* Let `define-symbol-prop' take effect during compilationStefan Monnier2017-08-071-0/+29
| | | | | | | | | | | | * src/fns.c (syms_of_fns): New variable `overriding-plist-environment'. (Fget): Consult it. * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Let-bind it to nil. (byte-compile-define-symbol-prop): New function, handles compilation of top-level `define-symbol-prop' and `function-put' calls by putting the symbol setting into `overriding-plist-environment'. Co-authored-by: Noam Postavsky <npostavs@gmail.com>
* Don't error on circular values in testcoverNoam Postavsky2017-08-071-2/+8
| | | | | * lisp/emacs-lisp/testcover.el (testcover-after, testcover-1value): Consider circular lists to be non-equal instead of signaling error.
* Catch argument and macroexpansion errors in ertAlexander Gramiak2017-08-071-9/+32
| | | | | | | | | | | | This kludge catches errors caused by evaluating arguments in ert's should, should-not, and should-error macros; it also catches macroexpansion errors inside of the above macros (Bug#24402). * lisp/emacs-lisp/ert.el: (ert--should-signal-hook): New function. (ert--expand-should-1): Catch macroexpansion errors. * test/lisp/emacs-lisp/ert-tests.el (ert-test-should-error-argument) (ert-test-should-error-macroexpansion): Tests for argument and expansion errors.
* Fix a couple of make-temp-file racesPaul Eggert2017-08-052-24/+26
| | | | | | | | | * lisp/emacs-lisp/autoload.el (autoload--save-buffer): * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Use make-temp-file, not make-temp-name, to avoid an unlikely race that could lose data. Remove the deletion hook as quickly as possible after the file is renamed; though a race still remains here, it is smaller than before.
* Make header line in some modes be sensitive to display-line-numbersEli Zaretskii2017-08-051-0/+4
| | | | | | | * lisp/ruler-mode.el (ruler-mode-ruler, ruler-mode-window-col): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header) (tabulated-list-print-entry): Account for the width taken by line-number display. (Bug#27895)
* ; * lisp/emacs-lisp/re-builder.el: Fix commentary (Bug#27947).Noam Postavsky2017-08-041-2/+2
|
* Implement iterator generator for avl-trees.Toby S. Cubitt2017-08-041-1/+16
| | | | * lisp/emacs-lisp/avl-tree.el (avl-tree-iter): New iter-defun.
* * lisp/subr.el (define-symbol-prop): New functionStefan Monnier2017-07-282-11/+4
| | | | | | | | (symbol-file): Make it find symbol property definitions. * lisp/emacs-lisp/pcase.el (pcase-defmacro): * lisp/emacs-lisp/ert.el (ert-set-test): Use it instead of `put'. (ert-describe-test): Adjust call to symbol-file accordingly.
* * lisp/subr.el (method-files): Move function to cl-generic.elStefan Monnier2017-07-282-2/+20
| | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-generic-p): New function. (cl--generic-method-files): New function, moved from subr.el. * lisp/emacs-lisp/edebug.el (edebug-instrument-function): Use them. * test/lisp/emacs-lisp/cl-generic-tests.el: * test/lisp/subr-tests.el: Move and adjust method-files tests accordingly.
* * lisp/loadhist.el (unload-feature): Remove ad-hoc ELP codeStefan Monnier2017-07-271-0/+5
| | | | * lisp/emacs-lisp/elp.el (loadhist-unload-element): Un-instrument functions.
* * lisp/emacs-lisp/cl-generic.el (cl-generic-define-method):Stefan Monnier2017-07-261-17/+18
| | | | Record this as the function's definition site if it's the first def.
* Stop using unibyte buffers for ert backtracesGlenn Morris2017-07-261-2/+1
| | | | | | | | * lisp/emacs-lisp/ert.el (ert-results-pop-to-backtrace-for-test-at-point): Set multibyte true, not false. This copies a debugger-setup-buffer change from 2009-08-30, and stops the "Backtrace for" header line containing ^X and ^Y.
* Fix cl-defmethod indentationGrégoire Jadi2017-07-261-1/+1
| | | | | * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Declare (indent defun). Fixes bug#23994.
* * lisp/emacs-lisp/eieio-compat.el (eieio--defgeneric-init-form):Stefan Monnier2017-07-251-1/+2
| | | | Adjust to change in cl-generic-ensure-function.
* (loadhist-unload-element): Move ERT and cl-generic methodsStefan Monnier2017-07-242-8/+21
| | | | | | | | | | | | | | | * lisp/loadhist.el (loadhist-unload-element): Don't define cl-generic and ert methods here. (loadhist-unload-element) <(head define-type)>: Remove unused var `slots'. * lisp/emacs-lisp/cl-generic.el (loadhist-unload-element): Define unload method for cl-defmethod. (cl-generic-ensure-function): Remove redundant `defalias'. * lisp/emacs-lisp/ert.el (ert-set-test): Move the current-load-list setting here... (ert-deftest): ...from here. (loadhist-unload-element): Define unload method for ert-deftest.
* Add 'rx' pattern for pcase.Philipp Stephani2017-07-232-1/+56
| | | | | * lisp/emacs-lisp/rx.el (rx): New pcase macro. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add unit test.
* ElDoc: add docstrings and minor refactoringCharles A. Roelli2017-07-221-11/+38
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc-edit-message-commands): Add docstring. (turn-on-eldoc-mode): Fix capitalization. (eldoc--supported-p): Add docstring. (eldoc-schedule-timer): Add docstring and use 'eldoc--supported-p'. (eldoc-message): Add docstring and make calling convention clearer. (eldoc--message-command-p): (eldoc-pre-command-refresh-echo-area): (eldoc-display-message-p): (eldoc-display-message-no-interference-p): (eldoc-print-current-symbol-info): (eldoc-docstring-format-sym-doc): (eldoc-add-command, eldoc-add-command-completions): (eldoc-remove-command, eldoc-remove-command-completions): Add docstring. (Bug#27230)
* * lisp/emacs-lisp/nadvice.el (advice--defalias-fset): Strip advicesStefan Monnier2017-07-181-0/+12
| | | | This tries to make sure that (defalias F (symbol-function F)) stays a no-op.
* Use a more specific test for running on hydra.nixos.orgGlenn Morris2017-07-181-1/+1
| | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): * test/Makefile.in (WRITE_LOG): * test/lisp/filenotify-tests.el: * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el (eieio-test-method-order-list-6): * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-37-obsolete-name-in-constructor): * test/lisp/net/tramp-tests.el: Replace NIX_STORE with EMACS_HYDRA_CI.
* * emacs-lisp/cl-lib.el (cl--old-struct-type-of): Accept `[]'Stefan Monnier2017-07-181-1/+1
|
* * lisp/emacs-lisp/map.el (map-put): Fix redundancy in docstring.Tino Calancha2017-07-171-2/+0
|
* alist-get: Add optional arg TESTFNTino Calancha2017-07-172-10/+17
| | | | | | | | | | | | If TESTFN is non-nil, then it is the predicate to lookup the alist. Otherwise, use 'eq' (Bug#27584). * lisp/subr.el (alist-get): Add optional arg FULL. * lisp/emacs-lisp/map.el (map-elt, map-put): Add optional arg TESTFN. * lisp/emacs-lisp/gv.el (alist-get): Update expander. * doc/lispref/lists.texi (Association Lists): Update manual. * etc/NEWS: Announce the changes. * test/lisp/emacs-lisp/map-tests.el (test-map-put-testfn-alist) (test-map-elt-testfn): New tests.
* * lisp/emacs-lisp/bytecomp.el: Fix bug#14860.Stefan Monnier2017-07-141-28/+15
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--function-signature): New fun. Dig into advice wrappers to find the "real" signature. (byte-compile-callargs-warn, byte-compile-arglist-warn): Use it. (byte-compile-arglist-signature): Don't bother with "new-style" arglists, since bytecode functions are now handled in byte-compile--function-signature. * lisp/files.el (create-file-buffer, insert-directory): Remove workaround introduced for (bug#14860). * lisp/help-fns.el (help-fns--analyse-function): `nadvice` is preloaded. * lisp/help.el (help-function-arglist): Dig into advice wrappers to find the "real" signature.
* * lisp/emacs-lisp/cl-lib.el (cl--random-time): Remove as wellStefan Monnier2017-07-141-5/+0
| | | | It's also defined in cl-extra.el.
* Remove duplicate cl--random-state definitionPaul Eggert2017-07-141-3/+0
| | | | | * lisp/emacs-lisp/cl-lib.el (cl--random-state): Remove. This variable is now defined in cl-extra.el (Bug#27617).
* Fix core dump in substitute-object-in-subtreePaul Eggert2017-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this fix, (substitute-object-in-subtree #0=(#0# 'a) 'a) would dump core, since the C code would recurse indefinitely through the infinite structure. This patch adds an argument to the function, and renames it to lread--substitute-object-in-subtree as the function is not general-purpose and should not be relied on by outside code. See Bug#23660. * src/intervals.c (traverse_intervals_noorder): ARG is now void *, not Lisp_Object, so that callers need not cons unnecessarily. All callers changed. Also, remove related #if-0 code that was “temporary” in the early 1990s and has not been compilable for some time. * src/lread.c (struct subst): New type, for substitution closure data. (seen_list): Remove this static var, as this info is now part of struct subst. All uses removed. (Flread__substitute_object_in_subtree): Rename from Fsubstitute_object_in_subtree, and give it a 3rd arg so that it doesn’t dump core when called from the top level with an already-cyclic structure. All callers changed. (SUBSTITUTE): Remove. All callers expanded and then simplified. (substitute_object_recurse): Take a single argument SUBST rather than a pair OBJECT and PLACEHOLDER, so that its address can be passed around as part of a closure; this avoids the need for an AUTO_CONS call. All callers changed. If the COMPLETED component is t, treat every subobject as potentially circular. (substitute_in_interval): Take a struct subst * rather than a Lisp_Object, for the closure data. All callers changed. * test/src/lread-tests.el (lread-lread--substitute-object-in-subtree): New test, to check that the core dump does not reoccur.
* Fix lisp-comment-indent for single-semicolon caseNoam Postavsky2017-07-061-6/+8
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-comment-indent): Only check for open paren if we're looking at multiple comment characters. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-comment-indent-1) (lisp-comment-indent-2): New tests.
* Don't put whitespace between open paren and comment in Lisp modes (Bug#19740)Noam Postavsky2017-07-051-3/+10
| | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-comment-indent): If current line's code ends in open paren, set comment indentation exactly to column following it. (lisp-mode-variables): Set `comment-indent-function' to `lisp-comment-indent'.
* * lisp/emacs-lisp/cl-print.el (cl-print-compiled-button): t by default.Noam Postavsky2017-07-022-4/+1
| | | | | | * lisp/emacs-lisp/debug.el (debugger-insert-backtrace): * lisp/help-fns.el (describe-variable): No need to let-bind `cl-print-compiled-button' to t anymore.
* Let test summary go through even if some logs were not generatedNoam Postavsky2017-07-011-1/+1
| | | | | * lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): Check for existence of log files before reading.
* * lisp/emacs-lisp/cl-extra.el (cl--random-state): New defstructStefan Monnier2017-06-301-15/+24
| | | | | | | (cl--random-state, cl--random-time): Move from cl-lib.el. (cl-random): Use struct accessors. (cl-random-state-p): Remove, provided by the defstruct. (cl-make-random-state): Rewrite to struct constructor.
* * lisp/emacs-lisp/debug.el (debugger-list-functions): Remove obsolete msgStefan Monnier2017-06-301-3/+7
|
* Hide byte code in backtraces (Bug#6991)Noam Postavsky2017-06-291-8/+18
| | | | | | | | * lisp/emacs-lisp/debug.el (debugger-print-function): New defcustom, defaulting to `cl-print'. (debugger-insert-backtrace, debugger-setup-buffer): Use it instead of `prin1'. * etc/NEWS: Announce it.
* Don't redundantly cl-print arglist in function docstring againNoam Postavsky2017-06-291-4/+5
| | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print-object): Don't print arglist part of docstring. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-1): Update test accordingly.