diff options
| author | Basil L. Contovounesios | 2018-07-09 18:46:33 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-07-09 19:00:43 -0700 |
| commit | 2fde6275b69fd113e78243790bf112bbdd2fe2bf (patch) | |
| tree | f28a04fdabc51d275689066b41b9149422d9f3cb /lisp/org | |
| parent | e4ad2d1a8fad8c8c786b61083b05cfaa1ea5669c (diff) | |
| download | emacs-2fde6275b69fd113e78243790bf112bbdd2fe2bf.tar.gz emacs-2fde6275b69fd113e78243790bf112bbdd2fe2bf.zip | |
Add predicate proper-list-p
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.
Diffstat (limited to 'lisp/org')
| -rw-r--r-- | lisp/org/ob-core.el | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 5d5faaa6fd0..a5449fe35e9 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el | |||
| @@ -2310,10 +2310,9 @@ INFO may provide the values of these header arguments (in the | |||
| 2310 | (lambda (r) | 2310 | (lambda (r) |
| 2311 | ;; Non-nil when result R can be turned into | 2311 | ;; Non-nil when result R can be turned into |
| 2312 | ;; a table. | 2312 | ;; a table. |
| 2313 | (and (listp r) | 2313 | (and (proper-list-p r) |
| 2314 | (null (cdr (last r))) | ||
| 2315 | (cl-every | 2314 | (cl-every |
| 2316 | (lambda (e) (or (atom e) (null (cdr (last e))))) | 2315 | (lambda (e) (or (atom e) (proper-list-p e))) |
| 2317 | result))))) | 2316 | result))))) |
| 2318 | ;; insert results based on type | 2317 | ;; insert results based on type |
| 2319 | (cond | 2318 | (cond |