summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Switch pp.el to lexical bindingNoam Postavsky2017-03-021-33/+18
| | | | | | | | | | | | | | | | | | | | Additionally, do some minor code cleanup. * lisp/emacs-lisp/pp.el: Set lexical-binding. (pp-buffer): Use skip-syntax-forward. (pp-eval-expression): Use push. (pp-last-sexp): Use with-syntax-table. * test/lisp/emacs-lisp/pp-tests.el: New tests.
* | Fix completing-read call in reb-change-syntaxChunyang Xu2017-03-021-4/+4
| | | | | | | | | | | | | | * lisp/emacs-lisp/re-builder.el (reb-change-syntax): Use 'default' arg of completing-read. Copyright-paperwork-exempt: yes
* | Ert commands to error if no test at point (bug#25931)Glenn Morris2017-03-021-23/+34
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-results-mode-menu): Deactivate some items if no test at point. (ert--results-test-at-point-no-redefinition): Add option to signal an error rather than return nil. (ert-results-pop-to-backtrace-for-test-at-point) (ert-results-pop-to-messages-for-test-at-point) (ert-results-pop-to-should-forms-for-test-at-point) (ert-results-describe-test-at-point): Error if no test at point.
* | Prevent for consing in cl-mapc and cl-maplTino Calancha2017-02-272-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-extra.el (cl--mapcar-many): Add optional arg ACC; If non-nil, accumulate values in the result (Bug#25826). (cl-mapc): Do computations inside function instead of call cl-map. (cl-mapl): Do computations inside function instead of call cl-maplist. * lisp/emacs-lisp/cl-lib.el (mapcar): Add autoload cookie. Call cl--mapcar-many with non-nil 3rd argument. * test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-map) (cl-extra-test-mapc, cl-extra-test-mapcar, cl-extra-test-mapl) (cl-extra-test-maplist): New tests.
* | Don't call package--ensure-init-file if initialized during startupNoam Postavsky2017-02-261-7/+7
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package-initialize): Check `after-init-time' rather than `load-file-name' to decide if `package--ensure-init-file' should be called. Depending on `load-file-name' will fail if the user calls `pacakge-initialize' in file which is loaded from the init file (Bug#24643, Bug#25819).
* | Use cl-print for Edebug and EIEIOStefan Monnier2017-02-233-66/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-prin1-to-string): Use cl-print. (edebug-prin1, edebug-print): Remove. * lisp/emacs-lisp/eieio.el (object-print): Declare obsolete. (cl-print-object): Add a method for EIEIO objects. (eieio-edebug-prin1-to-string): Delete. (edebug-prin1-to-string): Don't advise any more. * lisp/emacs-lisp/eieio-datadebug.el (data-debug-insert-object-button): Replace `object-print' -> `cl-prin1-to-string'.
* | * lisp/emacs-lisp/cl-print.el: New fileStefan Monnier2017-02-232-5/+209
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/nadvice.el (advice--where): New function. (advice--make-docstring): Use it. * src/print.c (print_number_index): Don't declare here any more. (Fprint_preprocess): New function. * test/lisp/emacs-lisp/cl-print-tests.el: New file.
* | Support read syntax for circular objects in Edebug (Bug#23660)Gemini Lasswell2017-02-231-12/+48
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-read-special): New name for edebug-read-function. Handle the read syntax for circular objects. (edebug-read-objects): New variable. (edebug-read-and-maybe-wrap-form1): Reset edebug-read-objects. * src/lread.c (Fsubstitute_object_in_subtree): Make substitute_object_in_subtree into a Lisp primitive.
* | * lisp/emacs-lisp/cl-generic.el (cl--generic-typeof-types): Add `atom'Stefan Monnier2017-02-211-15/+22
| | | | | | | | | | | | | | remove entries whose car can't be returned by type-of. (cl--generic-all-builtin-types): New var. (cl-generic-generalizers): Use it to avoid requiring extra entries in cl--generic-typeof-types.
* | * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Fix last changeStefan Monnier2017-02-211-1/+1
| |
* | * lisp/emacs-lisp/autoload.el (make-autoload): Support cl-defgenericStefan Monnier2017-02-212-5/+2
| | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Tweak for autoloading.
* | * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Fix duplicationStefan Monnier2017-02-211-1/+14
| | | | | | | | | | which resulted in incomplete list of parents in one copy of the cl-structure-class class.
* | Simplify cl-get using `plist-member'Noam Postavsky2017-02-201-20/+8
| | | | | | | | | | | | * lisp/emacs-lisp/cl-extra.el (cl-get, cl-getf, cl--set-getf): Use `plist-member' instead of explicit loop. * test/lisp/emacs-lisp/cl-extra-tests.el: New tests.
* | Turn on lexical-binding in elint.elMark Oteiza2017-02-171-9/+7
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/elint.el: Quote entry point commands in commentary. (elint-running, elint-current-pos): Move these dynamic vars to toward the top of the file. (elint-check-quote-form): Ignore unused argument. (elint-check-conditional-form): Remove unused binding.
* | * lisp/emacs-lisp/subr-x.el (if-let*): Fix Edebug spec (Bug#24748)Gemini Lasswell2017-02-171-1/+2
| |
* | ; Spelling, punctuation and minor wording fixesPaul Eggert2017-02-162-4/+4
| |
* | bytecomp.el: Avoid unnecessary calculation for jump table addresses.Vibhav Pant2017-02-161-2/+7
| | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode): Don't do redundant operations while calculating the correct jump addresses from TAGs in jump tables.
* | Don't expand body inside a let-binding when there are no bindingsMark Oteiza2017-02-151-2/+4
| | | | | | | | | | * lisp/emacs-lisp/pcase.el (pcase-codegen): Only let-bind if VARS is non-nil.
* | byte-opt: Replace merged tags in jump tables too. (bug#25716)Vibhav Pant2017-02-141-1/+11
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): While merging adjacent tags, make sure that the old tag is replaced in all jump tables, if any. This fixes the bytecode VM jumping to the wrong address in compiled cond forms where the body of a clause was a loop of any sort.
* | Merge branch 'master' into feature/byte-switchVibhav Pant2017-02-134-11/+11
|\ \
| * | Nix some useless uses of looking-at, looking-backMark Oteiza2017-02-124-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/allout.el (allout-kill-topic): (allout-next-topic-pending-encryption): * lisp/bookmark.el (bookmark-kill-line): * lisp/cus-edit.el (custom-save-variables, custom-save-faces): * lisp/cus-theme.el (custom-theme-write-variables): (custom-theme-write-faces): * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads): * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): * lisp/emacs-lisp/checkdoc.el (checkdoc-interactive-loop): (checkdoc-interactive-ispell-loop): (checkdoc-message-interactive-ispell-loop, checkdoc-this-string-valid): (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emulation/viper-cmd.el (viper-backward-indent): * lisp/image-dired.el (image-dired-delete-char): * lisp/simple.el (kill-visual-line): Replace instances of looking-at, looking-back with char comparisons using following-char, preceding-char.
* | | ; Add more documentation for byte-switch related code.Vibhav Pant2017-02-132-3/+13
| | |
* | | ; lisp/emacs-lisp/bytecomp.el: Fix indentation.Vibhav Pant2017-02-121-1/+1
| | |
* | | Merge branch 'master' into feature/byte-switchVibhav Pant2017-02-111-4/+2
|\| |
| * | Fix instrumenting code with propertized strings in EdebugGemini Lasswell2017-02-101-4/+2
| | | | | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-read-function): Allow 'read' to decide what is and isn't a syntax error. (Bug#25068)
* | | Improve byte-switch execution.Vibhav Pant2017-02-092-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el, lisp/emacs-lisp/bytecomp.el (byte-decompile-bytecode-1), (byte-compile-lapcode): Calculate the actual jump address while compiling, store it in the jump table. * src/bytecode.c: Jump to the looked up value directly, do a linear search when the number of elements is <= 5.
* | | ; bytecomp.el (byte-compile-cond-jump-table): Add TODO noteVibhav Pant2017-02-061-0/+2
| | |
* | | ; byte(-opt, comp).el: Add more documentation for byte-switch code.Vibhav Pant2017-02-062-0/+22
| | |
* | | Merge remote-tracking branch 'origin/master' into feature/byte-switchVibhav Pant2017-02-055-16/+69
|\| |
| * | New macro 'ert-with-message-capture'Gemini Lasswell2017-02-041-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-message-capture): New macro. (Bug#25158) * test/lisp/autorevert-tests.el (auto-revert--wait-for-revert) (auto-revert-test00-auto-revert-mode) (auto-revert-test01-auto-revert-several-files) (auto-revert-test02-auto-revert-deleted-file) (auto-revert-test03-auto-revert-tail-mode) (auto-revert-test04-auto-revert-mode-dired): * test/lisp/filenotify-tests.el (file-notify-test03-autorevert): Use ert-with-message-capture.
| * | Avoid invalid read syntax errors due to 'ert-with-test-buffer'Gemini Lasswell2017-02-041-1/+1
| | | | | | | | | | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-test-buffer): Fix the 'declare' form. (Bug#24722)
| * | Fix a syntax error when evaluating pcase.el under EdebugEli Zaretskii2017-02-041-1/+2
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/pcase.el (pcase-MACRO): Replace def-edebug-spec with an explicit 'put' form. Suggested by Gemini Lasswell <gazally@runbox.com>. (Bug#24717)
| * | Change edebug-max-depth from defconst to defcustomGemini Lasswell2017-02-041-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-max-depth): Add defcustom. (Bug#24713) * etc/NEWS: Mention edebug-max-depth. * doc/lispref/edebug.texi (Checking Whether to Stop): Mention edebug-max-depth and index it. Add cross-references for max-lisp-eval-depth and max-specpdl-size. Co-authored-by: Eli Zaretskii <eliz@gnu.org>
| * | Rename to if-let* and when-let*Mark Oteiza2017-02-031-12/+24
| | | | | | | | | | | | | | | | | | | | | Make the existing if-let and when-let aliases. * lisp/emacs-lisp/subr-x.el (if-let*, when-let*): New macros. Rewrite docstrings, incorporating that from let* and the existing if-let. (if-let, when-let, and-let*): Alias them.
| * | ; Bump let-alistMark Oteiza2017-01-311-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/let-alist.el: Bump micro version (bug#24641).
| * | read-multiple-choice: explain dialog popups moreTed Zlatanov2017-01-311-0/+5
| | | | | | | | | | | | | | | * lisp/emacs-lisp/subr-x.el (read-multiple-choice): Explain when a graphical popup is used and how it can be avoided.
| * | Revert two accidental commitsDima Kogan2017-01-311-54/+0
| | | | | | | | | | | | | | | This reverts commit f3c77d11af65f3b319b1784b4c3cf08c51aa7997. This reverts commit 3c941b900007c9e79c00af0f21d88154f6d8af1a.
| * | stashDima Kogan2017-01-301-0/+54
| | |
* | | bytecomp.el: Use macroexp-const-p instead of bc-cond-valid-obj2-p.Vibhav Pant2017-02-051-11/+5
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-vars): Use (macroexp-cons-p) instead of (byte-compile-cond-valid-obj2-p) to make sure that obj1/obj2 can be compared with `eq'.
* | | * byte-opt.el (byte-decompile-bytecode-1): Use eq instead of =.Vibhav Pant2017-02-051-1/+1
| | |
* | | ; Fix typo.Vibhav Pant2017-02-051-1/+1
| | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-jump-table-info): Fix typo in docstring.
* | | ; bytecomp.el (-inline-lapcode): Fix incorrect parenthesis, refactorVibhav Pant2017-02-051-5/+5
| | |
* | | bytecomp.el: Inline lapcode containing `byte-switch' correctly.Vibhav Pant2017-02-051-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-inline-lapcode): Restore value of byte-compile-depth after emitting a jump to a tag in a jump table, or default/done tags. Set the depth of final tags for byte-switch to nil after emitting any jumps to them.
* | | ; * byte-opt.el (byte-decompile-bytecode-1): Add more documentation.Vibhav Pant2017-02-051-1/+3
| | |
* | | byte-opt.el: Replace jump tables while decompiling correctly.Vibhav Pant2017-02-051-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1): Don't make a copy of the constant vector, as it isn't used with the decompiled lapcode. Make sure that the correct lapcode pair/list is being modified while replacing the jump table.
* | | bytecomp.el: Don't store non-keyword symbols in jump-tables.Vibhav Pant2017-02-051-5/+7
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-valid-obj2-p) return nil when OBJ is a non-keyword symbol (i.e a variable), as the jump table can only be used when comparing variables with constant values.
* | | Revert "Use maphash instead of cl-loop."Vibhav Pant2017-02-031-4/+4
| | | | | | | | | | | | This reverts commit bfa88520136dd6b187ba101e6db5a5f8f0d5e874.
* | | Use maphash instead of cl-loop.Vibhav Pant2017-02-011-4/+4
| | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el: (byte-compile-lapcode) Use maphash instead of cl-loop
* | | * lisp/emacs-lisp/bytecomp.el: Create jump tables with :purecopy tVibhav Pant2017-01-301-0/+1
| | |
* | | Merge remote-tracking branch 'origin/master' into feature/byte-switchVibhav Pant2017-01-306-152/+51
|\| |