summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* | * lisp/emacs-lisp/map.el: Add support for plistsStefan Monnier2018-12-201-2/+5
| | | | | | | | | | | | | | | | | | | | (map--plist-p, map--plist-delete): New functions. (map-elt, map-delete, map-length, map-into, map-put!, map-insert) (map-apply, map-do): Handle the plist case. * test/lisp/emacs-lisp/map-tests.el (with-maps-do): Add sample plist. (test-map-put!): The behavior of map-put! is not the same for plists as for alists.
* | New convenience functions in seq.elNicolas Petton2018-12-181-0/+12
| | | | | | | | | | | | | | | | | | | | Functions to access the first or all but the first elements of sequences have been repeatedly asked for (the last occurrence being https://github.com/NicolasPetton/seq.el/issues/9). * lisp/emacs-lisp/seq.el (seq-first, seq-rest): New functions. * test/lisp/emacs-lisp/seq-tests.el (test-seq-first, test-seq-rest): New tests for seq-first and seq-rest.
* | * lisp/emacs-lisp/map.el: Avoid special casing lists.Stefan Monnier2018-12-171-4/+16
| | | | | | | | | | | | | | | | | | | | | | (map-not-inplace, map-inplace): New errors. (map-insert): New generic function. (map-put!): Signal map-not-inplace rather than a generic 'error'. (map-elt): Use map-not-inplace and map-insert to avoid hardcoding a special case for lists. * test/lisp/emacs-lisp/map-tests.el (test-map-put!): Rename from test-map-put. Also test the errors signaled.
* | Get long package description for installed packages from installed filesStephen Leake2018-12-131-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/package.texi (Archive Web Server): New; document web server interface. * lisp/emacs-lisp/package.el (package--get-description): New; get long description from installed files. (describe-package-1): Use it, improve comments. No longer writing NAME-readme.txt. * test/lisp/emacs-lisp/package-tests.el: (package-test-describe-package): There is now a description for an installed package. (package-test-describe-installed-multi-file-package): New test.
* | Replace insignificant backquotesMichael Heerdegen2018-11-252-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
* | Add 'ring-resize' functionAllen Li2018-11-101-0/+37
| | | | | | | | | | | | | | * lisp/emacs-lisp/ring.el (ring-resize): New function. (Bug#32849) * doc/lispref/sequences.texi (Rings): Document new function 'ring-resize'. * etc/NEWS: Document new function 'ring-resize'. * test/lisp/emacs-lisp/ring-tests.el (ring-test-ring-resize): New tests.
* | Don't quote self-quoting pcase patternsMichael Heerdegen2018-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/bzrmerge.el: * lisp/char-fold.el: * lisp/dired.el: * lisp/emacs-lisp/derived.el: * lisp/emacs-lisp/easy-mmode.el: * lisp/emacs-lisp/easymenu.el: * lisp/emacs-lisp/eieio-core.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/smie.el: * lisp/faces.el: * lisp/filesets.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/perl-mode.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/server.el: * lisp/subr.el: * lisp/textmodes/css-mode.el: * test/lisp/emacs-lisp/pcase-tests.el: Don't quote self-quoting 'pcase' patterns.
* | Improve rounding in recent timer fixPaul Eggert2018-10-221-4/+16
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time): Use more-precise arithmetic to handle some boundary cases better when rounding errors occur (Bug#33071). * test/lisp/emacs-lisp/timer-tests.el: (timer-next-integral-multiple-of-time-3): New test, to test one of the boundary cases. (timer-next-integral-multiple-of-time-2): Redo so as to not assume a particular way of rounding 0.01.
* | Fix 'timer-next-integral-multiple-of-time'Eli Zaretskii2018-10-201-0/+8
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time): Fix recent change for fractional values of SECS. (Bug#33071) * test/lisp/emacs-lisp/timer-tests.el (timer-next-integral-multiple-of-time-2): New test.
* | Rename time-equal to time-equal-pPaul Eggert2018-09-281-1/+1
| | | | | | | | | | | | | | | | This is for consistency with time-less-p. * doc/lispref/os.texi (Time Calculations), etc/NEWS: * src/editfns.c (Ftime_equal_p, syms_of_editfns): * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time): Rename.
* | time-equal, and time values of infinity and NaNPaul Eggert2018-09-271-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/os.texi (Time Calculations): Document time-equal, and the behavior on NaNs and infinities of time-less-p, time-add, time-subtract. * etc/NEWS: Mention the change. * src/editfns.c (time_arith): Change last arg from function to bool. All callers changed. Do the right thing with infinities and NaNs. (time_cmp): New function, which handlesx infinities and NaNs. (Ftime_less_p): Use it. (Ftime_equal): New function. * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time): Use it.
* | Remove some assumptions about timestamp formatPaul Eggert2018-09-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes remove some assumptions of Lisp code on timestamp format. Although we’re not going to change the default format any time soon, I went looking for code that was too intimate about details of timestamp format and removed assumptions where this was easy to do with current Emacs primitives. * lisp/ido.el (ido-wash-history): Fix test for zero timestamp. * lisp/time.el (display-time-event-handler): Use time-less-p rather than doing it by hand. (display-time-update): Simplify by using float-time instead of doing the equivalent by hand. * lisp/url/url-auth.el (url-digest-auth-make-cnonce): * test/lisp/calendar/parse-time-tests.el (parse-time-tests): * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time): * test/lisp/net/tramp-tests.el: (tramp-test19-directory-files-and-attributes) (tramp-test22-file-times, tramp-test23-visited-file-modtime): Don’t assume detailed format of returned Lisp timestamps.
* | Fix timer.el minor rounding errorPaul Eggert2018-09-051-0/+5
| | | | | | | | | | | | | | * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time): Fix rounding error by using integers rather than floats. * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time): New test.
* | Give two backtrace-mode commands better namesGemini Lasswell2018-08-031-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Update bindings and menu items with new function names. (backtrace-collapse, backtrace-pretty-print) (backtrace--collapse, backtrace--pretty-print): Remove functions. (backtrace-single-line, backtrace-multi-line) (backtrace--single-line, backtrace--multi-line): New functions. (backtrace--reformat-sexp): Remove 'error-message' argument. * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--pretty-print-and-collapse): Remove. (backtrace-tests--single-and-multi-line): New test. (backtrace-tests--verify-pp-and-collapse): Remove. (backtrace-tests--verify-single-and-multi-line): New function.
* | Add new commands to Edebug backtracesGemini Lasswell2018-08-032-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add commands to go to source if available, and to show and hide Edebug's instrumentation. Make Edebug pop to backtraces instead of displaying them, which makes Edebug consistant with the behavior of ERT and the Lisp Debugger. * doc/lispref/edebug.texi (Edebug Misc): Document when and how you can jump to source code from an Edebug backtrace. Document 'edebug-backtrace-show-instrumentation' and 'edebug-backtrace-hide-instrumentation'. * lisp/emacs-lisp/backtrace.el (backtrace-frame): Add comments to describe the fields. (backtrace-goto-source-functions): New abnormal hook. (backtrace-mode-map): Add keybinding and menu item for backtrace-goto-source. (backtrace--flags-width): New constant. (backtrace-update-flags): Use it. (backtrace-goto-source): New command. (backtrace--print-flags): Print the :source-available flag. * lisp/emacs-lisp/edebug.el (edebug-backtrace-frames) (edebug-instrumented-backtrace-frames): New variables. (edebug-backtrace, edebug--backtrace-frames): Remove functions. (edebug-pop-to-backtrace, edebug--backtrace-goto-source) (edebug--add-source-info): New functions. (edebug-mode-map, edebug-mode-menus): Replace 'edebug-backtrace' with 'edebug-pop-to-backtrace'. (edebug--strip-instrumentation): New function. (edebug--unwrap-and-add-info): Remove. (edebug-unwrap-frame, edebug-add-source-info): New functions. (edebug-backtrace-show-instrumentation) (edebug-backtrace-hide-instrumentation): New commands. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-check-keymap): Verify keybindings in backtrace-mode-map used by new test. Update with binding for 'edebug-pop-to-backtrace'. (edebug-tests-backtrace-goto-source): New test. * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el (edebug-test-code-range): Add a new stop point.
* | Add new command to expand all "..."s in a backtrace frameGemini Lasswell2018-08-032-9/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/debugging.texi (Backtraces): Document new keybinding. * lisp/emacs-lisp/backtrace.el (backtrace-line-length): Add the option of unlimited line length. (backtrace--match-ellipsis-in-string): Add a comment to explain why this function is necessary. (backtrace-mode-map): Add keybinding for 'backtrace-expand-ellipses'. (backtrace-expand-ellipsis): Use 'cl-print-to-string-with-limit'. (backtrace-expand-ellipses): New command. (backtrace-print-to-string): Use 'cl-print-to-string-with-limit'. Tag the printed forms with a gensym instead of the values of print-length and print-level. (backtrace--print): Add 'stream' argument. * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--expand-ellipsis): Make the test less dependent on the implementation. (backtrace-tests--expand-ellipses): New test. Move the fitting of a printed representation into a limited number of characters using appropriate values of print-level and print-length from 'backtrace-print-to-string' to cl-print.el for future use by other parts of Emacs. * lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): New function. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-print-to-string-with-limit): New test.
* | Add more tests for backtrace-modeGemini Lasswell2018-08-031-47/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--variables) (backtrace-tests--backward-frame, backtrace-tests--forward-frame) (backtrace-tests--pretty-print-and-collapse) (backtrace-tests--verify-pp-and-collapse) (backtrace-tests--print-circle, backtrace-tests--make-regexp) (backtrace-tests--expand-ellipsis): New tests. (backtrace-tests--to-string): Use backtrace-tests--make-backtrace. (backtrace-tests--get-substring): New function. Change the method of generating sample backtraces in backtrace tests to work whether or not the tests are byte-compiled. * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--func1) (backtrace-tests--func2, backtrace-tests--func3) (backtrace-tests--create-backtrace-frames): Remove. (backtrace-tests--uncompiled-functions): New constant. (backtrace-tests--make-backtrace, backtrace-tests--setup-buffer): New functions. (backtrace-tests--backtrace-lines) (backtrace-tests--backtrace-lines-with-locals): New functions. (backtrace-tests--line-count): New constant. (backtrace-tests--result, backtrace-tests--result-with-locals): New functions. (backtrace-tests--header): New constant. (backtrace-tests--insert-header): Use backtrace-tests--header. (backtrace-tests--with-buffer): Remove.
* | Add backtrace-mode and use it in the debugger, ERT and EdebugGemini Lasswell2018-08-032-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/debugging.texi (Using Debugger): Remove explanation of backtrace buffer. Refer to new node. (Backtraces): New node. (Debugger Commands): Refer to new node. Remove 'v'. * doc/lispref/edebug.texi (Edebug Misc): Refer to new node. * doc/misc/ert.texi (Running Tests Interactively): Refer to new node. * lisp/emacs-lisp-backtrace.el: New file. * test/lisp/emacs-lisp/backtrace-tests.el: New file. * lisp/emacs-lisp/debug.el: (debugger-buffer-state): New cl-defstruct. (debugger--restore-buffer-state): New function. (debug): Use a debugger-buffer-state object to save and restore buffer state. Fix bug#15749 by leaving an unused buffer in debugger-mode, empty, instead of in fundamental-mode, and then when reusing a buffer, not calling debugger-mode if the buffer is already in debugger-mode. (debugger-insert-backtrace): Remove. (debugger-setup-buffer): Use backtrace-mode. (debugger--insert-header): New function. (debugger-continue, debugger-return-value): Change check for flags to use backtrace-frames. (debugger-frame-number): Determine backtrace frame number from backtrace-frames. (debugger--locals-visible-p, debugger--insert-locals) (debugger--show-locals, debugger--hide-locals) (debugger-toggle-locals): Remove. (debugger-mode-map): Make a child of backtrace-mode-map. Move navigation commands to backtrace-mode-map. Bind 'q' to debugger-quit instead of top-level. Make Help Follow menu item call backtrace-help-follow-symbol. (debugger-mode): Derive from backtrace-mode. (debug-help-follow): Remove. Move body of this function to 'backtrace-help-follow-symbol' in backtrace.el. (debugger-quit): New function. * lisp/emacs-lisp/edebug.el (edebug-unwrap-results): Remove warning in docstring about circular results. (edebug-unwrap): Use pcase. (edebug-unwrap1): New function to unwrap circular objects. (edebug-unwrap*): Use it. (edebug--frame): New cl-defstruct. (edebug-backtrace): Call the buffer *Edebug Backtrace* and use backtrace-mode. Get the frames from edebug--backtrace-frames. (edebug--backtrace-frames, edebug--unwrap-and-add-info) (edebug--symbol-not-prefixed-p): New functions. * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-for-backtraces) (lisp-el-font-lock-keywords-for-backtraces-1) (lisp-el-font-lock-keywords-for-backtraces-2): New constants. * lisp/emacs-lisp/ert.el (ert--print-backtrace): Remove. (ert--run-test-debugger): Use backtrace-get-frames. (ert-run-tests-batch): Use backtrace-to-string. (ert-results-pop-to-backtrace-for-test-at-point): Use backtrace-mode. (ert--insert-backtrace-header): New function. * tests/lisp/emacs-lisp/ert-tests.el (ert-test--which-file): Use backtrace-frame slot accessor.
* | Add methods for strings to cl-printGemini Lasswell2018-08-031-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print-object) <string>: New method. (cl-print-object-contents) <string>: New method. (cl-print--find-sharing): Look in string property lists. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-3): Test printing of long strings. (cl-print-tests-4): Test printing of strings nested in other objects. (cl-print-tests-strings, cl-print-tests-ellipsis-string): New tests.
* | Support ellipsis expansion in cl-printGemini Lasswell2018-08-031-3/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print-object-contents): New generic method. (cl-print-object-contents) <cons, vector,cl-structure-object>: New methods. (cl-print-object) <cons>: Use cl-print-insert-ellipsis. (cl-print-object) <vector, cl-structure-object>: Elide whole object if print-level exceeded. Use cl-print-insert-ellipsis. (cl-print-insert-ellipsis, cl-print-propertize-ellipsis) (cl-print-expand-ellipsis): New functions. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-4): Test printing of objects nested in other objects. (cl-print-tests-strings, cl-print-tests-ellipsis-cons) (cl-print-tests-ellipsis-vector, cl-print-tests-ellipsis-struct) (cl-print-tests-ellipsis-circular): New tests. (cl-print-tests-check-ellipsis-expansion) (cl-print-tests-check-ellipsis-expansion-rx): New functions.
* | Fix Edebug spec for cl-macrolet (bug#29919)Gemini Lasswell2018-08-012-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an Edebug matching function for cl-macrolet which keeps track of its bindings and treats them as macros without Edebug specs when found in the body of the expression. * lisp/emacs-lisp/edebug.el (edebug--cl-macrolet-defs): New variable. (edebug-list-form-args): Use it. (edebug--current-cl-macrolet-defs): New variable. (edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name) (edebug-match-cl-macrolet-body): New functions. * lisp/emacs-lisp/cl-macs.el (cl-macrolet): Use cl-macrolet-expr for Edebug spec. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-macrolet): New test. * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el (edebug-test-code-use-cl-macrolet): New function.
* | Merge from origin/emacs-26Glenn Morris2018-07-281-0/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bd52f37 (origin/emacs-26) ; Fix last change: only MinGW runtime 5.0.2... 024d20f Fix compilation with mingw.org's MinGW 5.x headers 38b6748 Update the list of special forms in the ELisp manual 8579105 Don't fail to indent-sexp before a full sexp (Bug#31984) d24c5f2 Fix calls to modifications hooks in replace-buffer-contents 71a9151 * src/character.c (char_width): Support glyphs with faces. (... 0feb673 Display raw bytes as belonging to 'eight-bit' charset 2e2f00f ; * doc/emacs/mule.texi (International Chars): Fix last change. 00561b5 Fix inaccurate text in the user manual 5cfb7a3 Copyedits in tramp.texi, improved example with bash's readline 6f8f358 Minor Tramp doc update 2585fcb File Shadowing is not available on MS Windows 39da592 ; Minor markup change in indent.texi 2f00ffe ; bookmark-jump: Add comment about last change.
| * Don't fail to indent-sexp before a full sexp (Bug#31984)Noam Postavsky2018-07-271-0/+11
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Only signal error if the initial forward-sexp fails. Suppress scan-error forn any of the forward-sexp calls after that. * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-cant-go): New test.
* | Merge from origin/emacs-26Glenn Morris2018-07-241-0/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | f64c277 (origin/emacs-26) Let bookmark-jump override window-point (Bu... 1208aaa Omit keymap from subword-mode docstring (Bug#32212) 2b70b54 Prevent line-mode term from showing user passwords 5de4441 Check for special filenames in eshell (Bug#30724) 1b4b965 Fix indent-sexp of #s(...) (Bug#31984) 59e8533 Add save-match-data to abbreviate-file-name (Bug#32201) 47f75b1 Fix last change in editfns.c 671dc5a Fix calls to buffer modification hooks from replace-buffer-co... cc4ceed ; etc/NEWS: Remove unnecessary reference to a bug number. e0f33ea Fix Bug#32226 7308fa0 Improve doc strings of several variables in keyboard.c
| * Fix indent-sexp of #s(...) (Bug#31984)Noam Postavsky2018-07-211-0/+12
| | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Look for a sexp that ends after the current line. * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-go): New test.
| * Stop using indent-line-to in lisp-indent-line (Bug#32014)Noam Postavsky2018-07-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | This is partial revert of "Remove ignored argument from lisp-indent-line", because `indent-line-to' doesn't respect field boundaries. * lisp/emacs-lisp/lisp-mode.el (lisp-indent-line): Use delete-region and indent-to instead of `indent-line-to'. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-with-read-only-field): Expect to pass. Don't merge to master, we will fix indent-line-to there instead.
* | Don't test symmetric operations on gpg 2.0 (Bug#23561)Noam Postavsky2018-07-151-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the Hydra test machines, which have gpg 2.0, the symmetric tests fail. * test/lisp/epg-tests.el (with-epg-tests): Pass REQUIRE-PUBLIC-KEY to `epg-tests-find-usable-gpg-configuration' and call it before `epg-make-context' so that the latter uses the resulting cached config. (epg-tests-find-usable-gpg-configuration): Only allow gpg 2.0 for symmetric operations. Clear `epg--configurations' and don't pass NO-CACHE to `epg-find-configuration'. (epg-tests--config-program-alist): Use copy-tree to avoid modifying the epg-config--program-alist cons values. * test/lisp/emacs-lisp/package-tests.el (package-test-signed): Allow running with gpg 2.0.
* | Update package.el test for message format changesNoam Postavsky2018-07-151-2/+3
| | | | | | | | | | | | | | * test/lisp/emacs-lisp/package-tests.el (package-test-signed): Update the expected message. The message was changed in 2018-06-25 "Reformat package.el message strings for future l10n". (with-package-test, with-fake-help-buffer): Add debug declarations.
* | Fix gpg detection for tests (Bug#23561)Noam Postavsky2018-07-141-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/package-tests.el (package-test-signed): Stop using epg-check-configuration and ignore-errors, they're redundant because epg-find-configuration already does all that. * test/lisp/epg-tests.el (epg-tests-find-usable-gpg-configuration): Remove tracing. (with-epg-tests): Skip test if no gpg config is found. (epg-decrypt-1 epg-roundtrip-1, epg-sign-verify-1, epg-sign-verify-2) (epg-import-1): Don't check gpg configuration at top-level, rely on `with-epg-tests' instead. Checking the gpg configuration requires a valid HOME (or GNUPGHOME), which is provided by `with-epg-tests'.
* | Tweak subr-x.el substring functionsBasil L. Contovounesios2018-07-131-0/+47
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-join): #'-quote function symbol. (string-trim-left, string-trim-right): Make better use of substring for minor speedup. * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-string-trim-left, subr-x-test-string-trim-right) (subr-x-test-string-remove-prefix) (subr-x-test-string-remove-suffix): New tests.
* | Add predicate proper-list-pBasil L. Contovounesios2018-07-091-42/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For discussion, see emacs-devel thread starting at https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00460.html. * lisp/subr.el (proper-list-p): New function. Implementation suggested by Paul Eggert <eggert@cs.ucla.edu> in https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00138.html. * doc/lispref/lists.texi (List Elements): * etc/NEWS: Document proper-list-p. * lisp/org/ob-core.el (org-babel-insert-result): * lisp/emacs-lisp/byte-opt.el (byte-optimize-if): * lisp/emacs-lisp/cl-macs.el (cl--make-usage-args): Use proper-list-p. * lisp/emacs-lisp/ert.el (ert--proper-list-p): Remove. Replaced by proper-list-p in lisp/subr.el. (ert--explain-equal-rec): Use proper-list-length. * lisp/format.el (format-proper-list-p): Remove. Replaced by proper-list-p in lisp/subr.el. (format-annotate-single-property-change): Use proper-list-p. * test/lisp/emacs-lisp/ert-tests.el (ert-test-proper-list-p): Move from here... * test/lisp/subr-tests.el (subr-tests--proper-list-length): ...to here, mutatis mutandis.
* | Respect field boundaries in indent-line-to (Bug#32014)Noam Postavsky2018-07-091-1/+0
| | | | | | | | | | | | | | | | * lisp/indent.el (indent-line-to): Use the back-to-indentation point as the end-point of whitespace removal, rather than backward-to-indentation which doesn't respect field boundaries. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-with-read-only-field): Don't expect to fail.
* | Merge from emacs-26Noam Postavsky2018-07-091-0/+11
|\| | | | | | | | | | | | | | | | | db3f779780 ; Test for Bug#32014 90d95b000c Explicitly reject :server and :nowait (Bug#31903) 917158f8c9 Fix Bug#32090 # Conflicts: # src/process.c
| * ; Test for Bug#32014Noam Postavsky2018-07-091-0/+11
| | | | | | | | | | * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-with-read-only-field): New test.
* | Reformat package.el message strings for future l10nJean-Christophe Helary2018-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package-buffer-info) (package--download-one-archive, package-install-selected-packages) (package-autoremove, describe-package-1, package-menu-toggle-hiding) (package-menu-hide-package, package-menu--mark-upgrades-1) (package-menu--list-to-prompt, package-menu--prompt-transaction-p) (package-menu-execute, package-menu--find-and-notify-upgrades): Reformat message strings to remove need for plural computation. Try to put full sentences in source string literals. * test/lisp/emacs-lisp/package-tests.el (package-test-describe-package): Update to match new message format.
* | Merge from origin/emacs-26Glenn Morris2018-06-231-0/+35
|\| | | | | | | | | | | | | | | | | | | 5cb3991 Fix a typo in emacs-lisp-intro.texi d6aa55e Avoid segfaults in replace-buffer-contents with large buffers d22b8d1 Adjust for scaling for mode-line popup menus (Bug#31880) 3d2e3dc Change name of `seqp' argument (Bug#26411) 40e1db8 Change index of ";" to better reflect it's usage (Bug#31623) d289e7e Fix bug of 'mouse-drag-and-drop-region' to detect edges of re... e292c09 Fix #'fun handling inside `labels' (Bug#31792)
| * Fix #'fun handling inside `labels' (Bug#31792)Noam Postavsky2018-06-191-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Don't forget to analyze args of lambda lifted functions (Bug#30872)Noam Postavsky2018-06-161-0/+40
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): New function. (cconv--convert-function): Extracted from here. (cconv-convert): Also use it here, in the lambda lifted case, so that mutated args are properly accounted for. * test/lisp/emacs-lisp/cconv-tests.el: New test.
* | Fix byte compilation of (eq foo 'default)Paul Eggert2018-06-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge from emacs-26Noam Postavsky2018-06-101-0/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3434edc731 Enlarge DUMPED_HEAP_SIZE for 64-bit Windows builds 36bbdfc017 Update Unicode data files to version 11.0.0 of Unicode b7b7a5f4f3 * etc/NEWS: Belatedly call out vc-hg changes in v26.1. (B... 5b6f8b54d1 Clarify the documentation of 'dired-recursive-deletes' 9db97b49cd ; * etc/DEBUG: Add information about debugging libXft prob... 0214ffbe60 Clarify doc string of 'update-glyphless-char-display' ef35d405b1 Clarify subtle issues with 'eq' in byte-compiled code c6ef3c8321 Make cl-print respect print-quoted (bug#31649) 26b52ac40e Fix unexpected jumps of window-point in 'set-window-config... 4af077ab4d * etc/emacs.appdata.xml: Update Emacs screenshot. e5ab25deae Fix cursor movement by 'next-logical-line' after 'next-line' d20beef5f1 Fix prompt in bookmark.el (Bug#24726) c57e7eaae8 Improve documentation of 'empty' whitespace-style # Conflicts: # etc/NEWS
| * Make cl-print respect print-quoted (bug#31649)Gemini Lasswell2018-06-071-0/+10
| | | | | | | | | | | | * 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-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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)
| * Fix cl-print for circular sublists (Bug#31146)Noam Postavsky2018-06-031-0/+10
| | | | | | | | | | | | | | | | | | * 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)
* | Make cl-print respect print-level and print-length (bug#31559)Gemini Lasswell2018-05-271-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Fix cl-print for circular sublists (Bug#31146)Noam Postavsky2018-04-261-0/+10
| | | | | | | | | | | | | | * 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.
* | Add a test suite for text-property-searchLars Ingebrigtsen2018-04-221-0/+113
| |
* | Fix Testcover bug in handling of vectors containing dotted listsGemini Lasswell2018-04-021-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/testcover.el (testcover-analyze-coverage-compose): Handle dotted lists. Fix bug#30909. * test/lisp/emacs-lisp/testcover-resources/testcases.el: (dotted-list-in-vector-bug-30909): New test case. (quotes-within-backquotes-bug-25316, dotted-backquote) (quoted-backquote, backquoted-vector-bug-25316) (vector-in-macro-spec-bug, backquoted-dotted-alist): Change docstrings to mention analyzing code instead of reinstrumenting it.
* | (benchmark-run-compiled): Make it work like 'benchmark-run' againStefan Monnier2018-03-271-7/+13
| | | | | | | | | | * lisp/emacs-lisp/benchmark.el (benchmark-run): Add special case for nil repetitions.
* | * test/lisp/emacs-lisp/bytecomp-tests.elGlenn Morris2018-03-261-0/+33
| | | | | | | | (bytecomp-test-featurep-warnings): New.