summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Improve ert backtrace recordingNoam Postavsky2017-06-292-120/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | Change ert to use the new `backtrace-frames' function instead of collecting frames one by one with `backtrace-frame'. Additionally, collect frames starting from `signal' instead the somewhat arbitrary "6 from the bottom". Skipping 6 frames would skip the expression that actually caused the signal that triggered the debugger. Possibly 6 was chosen because in the case of a failed test, the triggering frame is an `ert-fail' call, which is not so interesting. But in case of a test throwing an error, this drops the `error' call which is too much. * lisp/emacs-lisp/debug.el (debugger-make-xrefs): Remove. * lisp/emacs-lisp/ert.el (ert--make-xrefs-region): Bring in relevant code from `debugger-make-xrefs'. (ert--print-backtrace): Add DO-XREFS parameter, delegate to `debugger-insert-backtrace'. (ert--run-test-debugger): Record the backtrace frames starting from the instigating `signal' call. (ert-run-tests-batch): Pass nil for `ert--print-backtrace's new DO-XREFS parameter. (ert-results-pop-to-backtrace-for-test-at-point): Pass t as DO-XREFS to `ert--print-backtrace' and remove call to `debugger-make-xrefs'. * test/lisp/emacs-lisp/ert-tests.el (ert-test-record-backtrace): Check the backtrace list instead of comparing its string representation. Expect `signal' to be the first frame.
* Operate on frame list instead of printed backtraceNoam Postavsky2017-06-291-39/+51
| | | | | | | * lisp/emacs-lisp/debug.el (debugger-insert-backtrace): New function, prints the given backtrace frames. (debugger-setup-buffer): Use it instead of editing the backtrace buffer text.
* Adjust lm-verify to accept current noticesPaul Eggert2017-06-241-3/+4
| | | | | | | | Problem reported by Mike Kupfer in: http://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00512.html * lisp/emacs-lisp/lisp-mnt.el (lm-crack-copyright): Do not require later lines in a copyright notice to have more indentation than earlier lines.
* Don't change byte-compile-delete-errors at runtime (Bug#27340)Noam Postavsky2017-06-241-3/+7
| | | | | * lisp/emacs-lisp/eieio-core.el: Confine `cl-declaim' calls to compile time.
* Don't put deleted packages in the trash (bug#14967)Glenn Morris2017-06-191-1/+1
| | | | | | | * lisp/emacs-lisp/package.el (package-delete): Don't pay attention to delete-by-moving-to-trash. ; * etc/NEWS: Mention this.
* Fix wrong indentation after string literal (Bug#27306)Noam Postavsky2017-06-131-14/+13
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-state) (lisp-indent-calc-next): Remove `depth' field, use (car ppss) instead. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-region-after-string-literal): New test.
* Buttonize #<bytecode> part of printed functions (Bug#25226)Noam Postavsky2017-06-121-4/+29
| | | | | | | | * lisp/emacs-lisp/cl-print.el: Autoload `disassemble-1'. (cl-print-compiled-button): New variable. (help-byte-code): New button type, calls `disassemble' in its action. (cl-print-object): Use it if `cl-print-compiled-button' is non-nil.
* Split variable macro env from function envNoam Postavsky2017-06-071-36/+28
| | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Remove. (cl-symbol-macrolet): Instead of adding each binding directly into the main environment with a special key format, put all symbol macro bindings into a single entry in the main environment under `:cl-symbol-macros'. (cl--sm-macroexpand): Look up symbol bindings in the `:cl-symbol-macros' entry of the environment.
* Enable ElDoc messages after the newline commandDmitry Gutov2017-06-061-1/+1
| | | | | * lisp/emacs-lisp/eldoc.el: Add "newline" to the eldoc-add-command-completions call (bug#27228).
* Fix check for package-unsigned-archives during retrievalAndy Moreton2017-06-061-1/+1
| | | | | * lisp/emacs-lisp/package.el (package--download-one-archive): Fix check for package-unsigned-archives.
* Implement field numbers in format stringsPhilipp Stephani2017-06-021-3/+8
| | | | | | | | | | | | | | | A field number explicitly specifies the argument to be formatted. This is especially important for potential localization work, since grammars of various languages dictate different word orders. * src/editfns.c (Fformat): Update documentation. (styled_format): Implement field numbers. * doc/lispref/strings.texi (Formatting Strings): Document field numbers. * lisp/emacs-lisp/bytecomp.el (byte-compile-format-warn): Adapt. * test/src/editfns-tests.el (format-with-field): New unit test.
* cl-print: handle circular objects when `print-circle' is nil (Bug#27117)Noam Postavsky2017-05-311-11/+24
| | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print--currently-printing): New variable. (cl-print-object): When `print-circle' is nil, bind it to a list of objects that are currently printing to avoid printing the same object endlessly. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle): New test.
* Extract eldoc--supported-pDmitry Gutov2017-05-311-2/+5
| | | | | | * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): New function. (turn-on-eldoc-mode, eldoc-mode): Use it. (http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00865.html)
* Turn global-eldoc-mode into a globalized minor modeDmitry Gutov2017-05-301-20/+9
| | | | | | | * lisp/emacs-lisp/eldoc.el (global-eldoc-mode): Turn into globalized mode (bug#19853). (turn-on-eldoc-mode): Make it into a wrapper instead of alias. (eldoc-mode): Only show the message when called interactively.
* Fix cl-indent for `loop' with :keywords (Bug#15543)Svante Carl v. Erichsen2017-05-271-1/+1
| | | | | | | * lisp/emacs-lisp/cl-indent.el (lisp-extended-loop-p): Allow for ":keywords". Copyright-paperwork-exempt: yes
* Don't attempt to recover from undefined behavior in some casesPhilipp Stephani2017-05-272-0/+18
| | | | | | | | | | | | | These functions can only be run in batch mode and exit Emacs on return, so nothing can be recovered. Disable unsafe recover mechanisms so that we get real failures and good stack traces on fatal signals. * lisp/emacs-lisp/bytecomp.el (batch-byte-compile) (batch-byte-recompile-directory): * lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit) (ert-summarize-tests-batch-and-exit): Don't attempt to recover from undefined behavior.
* * lisp/emacs-lisp/eieio.el (defclass): Fix quote in warning message.Noam Postavsky2017-05-261-1/+1
|