summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* * 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
|
* Mark keywordp as a safe, error-free functionWilfred Hughes2017-05-261-1/+1
| | | | | * lisp/emacs-lisp/byte-opt.el: Add keywordp to side-effect-and-error-free-fns.
* Protect *Backtrace* from being killed (Bug#26650)Noam Postavsky2017-05-231-0/+3
| | | | | * lisp/emacs-lisp/debug.el (debugger-mode): Call `top-level' in `kill-buffer-hook'.
* Give a name to lisp-mode's adaptive-fill-function (Bug#22730)Noam Postavsky2017-05-231-4/+8
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-adaptive-fill): New function. (lisp-mode-variables): Use it.
* * lisp/emacs-lisp/cl-indent.el: Don't require CL. Use lexical-binding.Stefan Monnier2017-05-231-18/+16
| | | | | (common-lisp-indent-function-1): Remove unused var `last-point`. (lisp-indent-error-function): Move defvar before first use.
* * lisp/emacs-lisp/package.el (package-delete): Delete readme file as well.Tino Calancha2017-05-211-4/+9
|
* Don't save unrelated buffers before recompiling directory (Bug#25964)Andreas Politz2017-05-201-1/+6
| | | | | * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Only save buffers visiting lisp files under the directory being compiled.
* New commands: find-library-other-window, find-library-other-frameCharles A. Roelli2017-05-201-35/+57
| | | | | | | | | * lisp/emacs-lisp/find-func.el (find-library-other-window) (find-library-other-frame): New commands to complement the existing 'find-library' command. (Bug#26712) (read-library-name): New function to read a library name. * etc/NEWS: Mention 'find-library-other-window' and 'find-library-other-frame'.
* * lisp/emacs-lisp/package.el: Quote `package-desc' in docstringsStefan Monnier2017-05-191-12/+12
|
* Add an optional arguments to string-trimJean-Christophe Helary2017-05-191-9/+15
| | | | | | * lisp/emacs-lisp/subr-x.el (string-trim-left, string-trim-right) (string-trim): Add optional args that serve as defaults per the original behavior. (Bug#26908)
* autoload-rubric no longer provides a feature by defaultGlenn Morris2017-05-171-14/+10
| | | | | | * lisp/emacs-lisp/autoload.el (autoload-rubric): Stop providing a feature unless explicitly requested. (autoload-find-generated-file): Update autoload-rubric call.
* Make sure indent-sexp stops at end of sexp (Bug#26878)Noam Postavsky2017-05-151-15/+18
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Check endpos before indenting. * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-stop): New test.
* Make edebug-step-in work on generic methods (Bug#22294)Gemini Lasswell2017-05-143-15/+46
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-match-cl-generic-method-args): New function to implement the edebug-form-spec property of the symbol cl-generic-method-args. (edebug-instrument-function): If the function is a generic function, find and instrument all of its methods. Return a list instead of a single symbol. (edebug-instrument-callee): Now returns a list. Update docstring. (edebug-step-in): Handle the list returned by edebug-instrument-callee. * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Use name and cl-generic-method-args in its Edebug spec. * lisp/emacs-lisp/eieio-compat.el (defmethod): Use name and cl-generic-method-args in its Edebug spec. * lisp/subr.el (method-files): New function. * test/lisp/subr-tests.el (subr-tests--method-files--finds-methods) (subr-tests--method-files--nonexistent-methods): New tests.
* Merge branch 'fix/bug-21072'Marcin Borkowski2017-05-141-38/+98
|\
| * Modify `beginning-of-defun-comments'Noam Postavsky2017-05-121-8/+16
| | | | | | | | | | * lisp/emacs-lisp/lisp.el (beginning-of-defun-comments): Try not to stop in the middle of a multiline comment.
| * * lisp/emacs-lisp/lisp.el (mark-defun): Simplify moving the point.Noam Postavsky2017-05-121-7/+3
| |
| * Fix Bug#21072 and rework `mark-defun'Marcin Borkowski2017-05-121-38/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer): New variable (mark-defun-no-arg-region-inactive) (mark-defun-no-arg-region-active) (mark-defun-arg-region-active) (mark-defun-pos-arg-region-inactive) (mark-defun-neg-arg-region-inactive, mark-defun-bob): Add tests for the new `mark-defun'. * lisp/emacs-lisp/lisp.el (beginning-of-defun--in-emptyish-line-p): New function. (beginning-of-defun-comments): New function. (mark-defun): Fix bug#21072, also rewrite large parts of `mark-defun' to accept a numerical prefix argument.
* | ; Revert "Adjust the edebug spec of if-let*"Mark Oteiza2017-05-131-2/+1
| | | | | | | | This reverts commit fd4b83ca7c20a68060772ec13aadbe29db612b3f.
* | Make `old-style-backquotes' variable internalPhilipp2017-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/lread.c (load_warn_old_style_backquotes, Fload, read1) (syms_of_lread): Rename `old-style-backquotes' to `lread--old-style-backquotes', and clarify that it's for internal use only. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename variable. * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add unit test. * emacs-lisp/bytecomp-tests.el (bytecomp-tests--old-style-backquotes): Add unit test.
* | Improve unescaped character literal warningsPhilipp Stephani2017-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | * src/lread.c (load_warn_unescaped_character_literals) (syms_of_lread): lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve formatting of unescaped character literal warnings. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
* | Fix lisp-indent-region and indent-sexp (Bug#26619)Noam Postavsky2017-05-091-85/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new lisp-indent-region introduced in 2017-04-22 "Add new `lisp-indent-region' that doesn't reparse the code." is broken because it doesn't save the calculated indent amounts for already seen sexp depths. Fix this by unifying the indent-sexp and lisp-indent-region code. Furthermore, only preserve position 2 of the running parse when the depth doesn't change. * lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Use an OLDSTATE that corresponds with the start point when calling parse-partial-sexp. (lisp-indent-state): New struct. (lisp-indent-calc-next): New function, extracted from indent-sexp. (indent-sexp, lisp-indent-region): Use it. (lisp-indent-line): Take indentation, instead of parse state. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-mode-tests--correctly-indented-sexp): New constant. (lisp-indent-region, lisp-indent-region-defun-with-docstring): (lisp-indent-region-open-paren, lisp-indent-region-in-sexp): New tests.
* | Don't duplicate autoload code in package.elGlenn Morris2017-05-092-27/+23
| | | | | | | | | | | | * lisp/emacs-lisp/autoload.el (autoload-rubric): Add a package option. * lisp/emacs-lisp/package.el (autoload-rubric): Declare. (package-autoload-ensure-default-file): Use autoload-rubric.