Commit graph

5442 commits

Author SHA1 Message Date
Gemini Lasswell
4bd43b0352 Increase max-lisp-eval-depth adjustment while in debugger (bug#31919)
* src/eval.c (call_debugger): Increase the amount of extra Lisp
evaluation depth given to the debugger to allow it to call cl-print.
* lisp/emacs-lisp/debug.el (debugger-setup-buffer): Add a comment
to suggest updating call_debugger when changing print-level.
2018-06-30 07:36:11 -07:00
Noam Postavsky
6f6d525683 Detect a non-list package archive content properly (Bug#22311)
* lisp/emacs-lisp/package.el (package--download-one-archive): Use
`read' instead of `read-from-string'; the latter always returns a
cons, so the `listp' check on its return value doesn't make sense.  It
was changed from `read' to `read-from-string' in 2015-04-01 "*
emacs-lisp/package.el: Implement asynchronous refreshing", but that
change was not needed because `read' works fine on strings as well as
buffers.
2018-06-26 19:56:04 -04:00
Noam Postavsky
7488de4f27 * lisp/emacs-lisp/regexp-opt.el (regexp-opt): Fix docstring quotes. 2018-06-24 10:57:54 -04:00
Simen Heggestøyl
3d2e3dc1ca Change name of `seqp' argument (Bug#26411)
* lisp/emacs-lisp/seq.el (seqp): Change argument name.

* doc/lispref/sequences.texi: Update the documentation for seqp.
2018-06-21 20:27:35 -04:00
Noam Postavsky
e292c0973c Fix #'fun handling inside `labels' (Bug#31792)
* 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).
2018-06-19 20:02:16 -04:00
Paul Eggert
e1284341fd Fix byte compilation of (eq foo 'default)
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.
2018-06-16 09:44:05 -07:00
Gemini Lasswell
c6ef3c8321 Make cl-print respect print-quoted (bug#31649)
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Observe
print-quoted when printing quote and its relatives.  Add printing of
'function' as #'.
2018-06-07 08:27:43 -07:00
Gemini Lasswell
5d448ca98c Make cl-print respect print-level and print-length (bug#31559)
* 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 0f48d18fd2)
2018-06-04 08:57:10 -07:00
Eli Zaretskii
16e8541b74 Update doc string of 'rx'
* lisp/emacs-lisp/rx.el (rx): Update the description of some
character classes.
2018-06-03 20:20:52 +03:00
Noam Postavsky
9552485c4d Fix cl-print for circular sublists (Bug#31146)
* 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 b8aa7ecf54)
2018-06-03 12:48:13 -04:00
Damien Cassou
24ba63314f Improve read-multiple-choice docstring (Bug#31628)
* lisp/emacs-lisp/rmc.el (read-multiple-choice): Improve docstring.
2018-05-29 08:17:32 -04:00
Thien-Thi Nguyen
567cb9046d Overhaul pcase documentation
Suggested by Drew Adams (Bug#31311).

* doc/lispref/control.texi (Control Structures):
Add "Pattern-Matching Conditional" to menu, before "Iteration".
(Conditionals): Delete menu.
(Pattern matching case statement): Delete node/subsection,
by actually moving, renaming, and overhauling it to...
(Pattern-Matching Conditional): ...new node/section.
(pcase Macro): New node/subsection.
(Extending pcase): Likewise.
(Backquote Patterns): Likewise.
* doc/lispref/elisp.texi (Top) In @detailmenu, add
"Pattern-Matching Conditional" under "Control Structures"
section and delete "Conditionals" section.
* lisp/emacs-lisp/pcase.el (pcase): Rewrite docstring.
(pcase-defmacro \` (qpat) ...): Likewise.
2018-05-27 17:14:27 +02:00
Thien-Thi Nguyen
4d7e54acff Use EXPVAL in docstrings of patterns defined using pcase-defmacro
Suggested by Drew Adams (Bug#31311).

* lisp/emacs-lisp/cl-macs.el (cl-struct): ...here.
* lisp/emacs-lisp/eieio.el (eieio): Likewise.
* lisp/emacs-lisp/radix-tree.el (radix-tree-leaf): Likewise.
* lisp/emacs-lisp/rx.el (rx): Likewise.
2018-05-27 10:36:35 +02:00
Thien-Thi Nguyen
7e8227ed68 Introduce EXPVAL for pcase, pcase-defmacro docstrings
Suggested by Drew Adams (Bug#31311).

* lisp/emacs-lisp/pcase.el (pcase): Use EXPVAL in
docstring to stand for the result of evaluating EXP.
(pcase-defmacro): Add (fn ...) form in docstring
that includes [DOC], and the EXPVAL convention.
2018-05-27 10:36:35 +02:00
Thien-Thi Nguyen
e6de5b3d51 Ensure pcase doc shows `QPAT first among extensions
* lisp/emacs-lisp/pcase.el (pcase--make-docstring):
Split extensions display into two phases, collection
and display, separated by a reordering step that
ensures backquote is the first.
2018-05-27 10:36:34 +02:00
Noam Postavsky
e3f00f5637 Clarify when to use advice-add vs add-function
* lisp/emacs-lisp/nadvice.el (add-function): Note in docstring that
advice-add should be used for named functions.
2018-05-22 20:08:01 -04:00
Stefan Monnier
80d868ed1c * lisp/emacs-lisp/inline.el: Clarify apparent typos 2018-04-04 21:15:36 -04:00
Philipp Stephani
52501ec3f1 Quote a few backticks in docstrings.
* lisp/emacs-lisp/macroexp.el (macroexp-progn, macroexp-let*)
(macroexp-if): Quote backtick in docstrings.
2018-04-01 23:33:16 +02:00
Noam Postavsky
e50196e8a9 Document return value of pcase (Bug#30425)
* doc/lispref/control.texi (Pattern matching case statement):
* lisp/emacs-lisp/pcase.el (pcase): State that pcase returns nil if no
patterns match.
(pcase-exhaustive): State that an error is signaled if no patterns
match.
2018-03-31 00:50:37 -04:00
Glenn Morris
1b075a9e38 ; Fix some tiny doc typos 2018-03-27 17:02:04 -04:00
Michael Heerdegen
441fe201ea De-obsolete if-let' and when-let'
For the following release it is planned to make `if-let*' and
`when-let*' aliases for `if-let' and `when-let'.  For now we revert
declaring `if-let' and `when-let' obsolete and tweak the docstrings.

* lisp/emacs-lisp/subr-x.el (if-let*, when-let*): Make docstrings
refer to those of `if-let' and `when-let'.
(if-let, when-let): De-obsolete.  Rewrite documentation.
2018-03-27 01:54:22 +02:00
Glenn Morris
86960383cf * lisp/htmlfontify.el (hfy-begin-span-handler): Doc fix. 2018-03-26 16:12:51 -04:00
Eric Abrahamsen
daa9e853bd Improve warning and error messages
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read,
  (eieio-persistent-validate/fix-slot-value): Indicate exactly what
  went wrong.
2018-03-22 10:46:09 +08:00
Eric Abrahamsen
f0cf4dc629 Let eieio-persistent-read read what object-write has written
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value):
  `object-write' may quote lists inside hash tables and vectors, so
  unquote those lists here.

This patch allows the eieio-persistent write/restore process to
perform a clean round trip. It only handles a very specific and
limited range of object structures, but at least the write and read
procedures match.
2018-03-22 10:46:08 +08:00
Eric Abrahamsen
40ad1ff327 Handle possible classtype values in eieio-persistent-read
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value):
  The function `eieio-persistent-slot-type-is-class-p' could return
  either a single class, or a list of classes.
2018-03-22 10:46:08 +08:00
Noam Postavsky
e244fed5e0 Clarify that nil doesn't match itself as a cl-case clause (Bug#30749)
* lisp/emacs-lisp/cl-macs.el (cl-case): Mention that the ATOM
=> (ATOM) short form is only for non-nil ATOMs.
2018-03-10 17:56:04 -05:00
Michael Heerdegen
f6bd7e0686 Revert last commit
This reverts commit af4697faa1.  It's
too late for this to be in the release.
2018-03-06 18:32:04 +01:00
Michael Heerdegen
af4697faa1 Define if-let* and derivatives as aliases for if-let etc
This commit reverts declaring `if-let' and `when-let' obsolete in
favor of the new `if-let*' and `when-let*' versions because of the
compiler warning mess (Bug#30039).  Instead we make foo-let* aliases
for foo-let.  The old single-tuple variable spec case is still
supported for backward compatibility.
* lisp/emacs-lisp/subr-x.el (if-let, when-let): Don't declare
obsolete.  Tweak edebug specs.
(and-let): Renamed from `and-let*' for compatibility with the names
`if-let' and `when-let'.
(if-let*, when-let*, and-let*): Define as aliases for `if-let',
`when-let' and `and-let'.
* test/lisp/emacs-lisp/subr-x-tests.el (if-let-single-tuple-case-test)
(when-let-single-tuple-case-test): New tests for the single-binding
tuple case.
In the whole file, prefer the names without "*".
2018-03-06 15:47:05 +01:00
Eli Zaretskii
adfe2f580f Remove outdated comment in syntax.el
* lisp/emacs-lisp/syntax.el (syntax-ppss-toplevel-pos): Remove
outdated comment.  (Bug#30617)
2018-03-03 14:41:16 +02:00
Paul Eggert
f74ab96483 ; Spelling and grammar fixes. 2018-02-17 09:17:28 -08:00
Eli Zaretskii
d8917eba1c Improve documentation of Profiling features
* doc/lispref/debugging.texi (Profiling): Improve the description
of elp.el.  Improve wording of the rest of the section.  (Bug#30491)

* lisp/emacs-lisp/elp.el (elp-instrument-list): Make the
interactive invocation work.  Doc fix.
2018-02-17 11:59:36 +02:00
Glenn Morris
69107f347b ; Fix doc typos related to indefinite articles 2018-02-16 17:33:57 -05:00
Glenn Morris
66a4e651f3 ; Fix doc typos related to indefinite articles 2018-02-16 15:16:15 -05:00
Robert Cochran
edc06adf96 Make 'byte-compile-error-on-warn' a safe file variable
* lisp/emacs-lisp/bytecomp.el (byte-compile-error-on-warn): Mark
as a safe local variable for boolean values.
2018-02-16 17:51:06 +02:00
Noam Postavsky
607cc4e24a Define cl-type-definition button type as needed (Bug#28899)
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor): Require
`cl-extra' before using the `cl-type-definition' button type.
2018-01-30 22:14:02 -05:00
Philipp Stephani
956807bd1f * lisp/emacs-lisp/rx.el (rx): Fix the definition of 'blank'. 2018-01-30 00:05:58 +01:00
Eli Zaretskii
b603affa1f Revert "Fix tempfile creation when byte compiling"
This reverts commit 4fd446e9f6:
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
2018-01-20 09:48:22 +02:00
Paul Eggert
4fd446e9f6 Fix tempfile creation when byte compiling
This improves on the recent fix for master failing to build
on FreeBSD.  Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
2018-01-19 14:40:56 -08:00
Stefan Monnier
728ded05f6 * lisp/emacs-lisp/bytecomp.el: Tweak last change
(byte-compile-file): Move comment closer to the code it describes.
2018-01-19 11:29:13 -05:00
Eli Zaretskii
c6c05e2aa9 Unbreak building Emacs on FreeBSD
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't create
the temporary file under temporary-file-directory if the file
being compiled is specified by an absolute file name.  This avoids
problems with ACL copying from temporary-file-directory on
FreeBSD.  For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00513.html.
2018-01-19 17:31:54 +02:00
Noam Postavsky
76040d1eae Handle case-insensitive filenames for load-path shadows (Bug#5845)
* lisp/emacs-lisp/shadow.el (load-path-shadows-find): Check for
shadowing with case-insensitive matching for files of case-insensitive
directories (as determined by `file-name-case-insensitive-p').
* test/lisp/emacs-lisp/shadow-tests.el: New test.
* test/lisp/emacs-lisp/shadow-resources/p1/foo.el:
* test/lisp/emacs-lisp/shadow-resources/p2/FOO.el: New test files.
2018-01-18 16:26:52 -05:00
Stefan Monnier
1f7f03742d * lisp/emacs-lisp/generator.el (iter-defun): Add 'doc-string' prop. 2018-01-11 11:24:38 -05:00
Stefan Monnier
dbb4aac212 * lisp/emacs-lisp/syntax.el (syntax-propertize): Fix bug#29767 2018-01-11 10:11:39 -05:00
Alan Mackenzie
b8d74c4578 Fix mark-defun when there's no spaces between successive defuns.
The problem was a parse-partial-sexp call which tried to use the STOPBEFORE
argument to detect non-syntactic WS.  This fails on a "}", which does not
begin a sexp.

* lisp/emacs-lisp/lisp.h (beginning-of-defun--in-emptyish-line-p): Enhance to
handle BOL being in a string.
(beginning-of-defun-comments): Call the above function in place of the call
to parse-partial-sexp.
2018-01-06 11:48:32 +00:00
Paul Eggert
63b04c11d5 Fix copyright years by hand
These are dates that admin/update-copyright did not update, or
updated incorrectly.
2018-01-01 01:02:09 -08:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Eli Zaretskii
34fcfc5c04 * lisp/emacs-lisp/inline.el (define-inline): Add a doc string. 2017-12-22 12:37:19 +02:00
Glenn Morris
471b6c163f ; Replace non-ascii quote characters in doc strings etc 2017-12-20 16:23:11 -05:00
Stefan Monnier
07b7fb98e6 * lisp/subr.el (delayed-after-hook-functions): Rename from ...-forms
(run-mode-hooks): `funcall` the functions instead of `eval`ing the forms.
* lisp/emacs-lisp/derived.el (define-derived-mode): Push functions
rather than forms (bug#29679).
2017-12-18 11:39:17 -05:00
Noam Postavsky
777fe94661 Partially revert "Mention new strictness for &optional, &rest..."
The changes to cl argument parsing are not backwards compatible, and
cause inconvenience when writing macros (e.g., instead of doing '&aux
,@auxargs', some more complicated conditionals would be required).
The `cl-defstruct' macro makes use of this convenience when defining
empty structs (Bug#29728).
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
(cl--do-&aux, cl--do-arglist): Undo strict checking of &rest, &key,
and &aux.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-bad-arglist): Remove
test.
2017-12-15 23:41:20 -05:00