GNU bug report logs - #26765
25.2; org-babel: Inserting list of cons cells fails

Previous Next

Package: org-mode;

Reported by: Lucas Groenendaal <groenendaal92 <at> gmail.com>

Date: Wed, 3 May 2017 19:30:03 UTC

Severity: normal

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26765 in the body.
You can then email your comments to 26765 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26765; Package emacs. (Wed, 03 May 2017 19:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lucas Groenendaal <groenendaal92 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 03 May 2017 19:30:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lucas Groenendaal <groenendaal92 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; org-babel: Inserting list of cons cells fails
Date: Wed, 3 May 2017 13:57:50 -0500
[Message part 1 (text/plain, inline)]
Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from 'emacs -Q':

First off, I found a fix for this problem.  I wasn't sure how to best
submit that change but a bug report seemed appropriate so I went with
that.  After a short demonstration of the problem comes my diff.
Apologies if anything is missing or confusing, I've never done this
before.

- Start up emacs: emacs -Q
- Put this code into an org mode file:
#+BEGIN_SRC elisp
  (print '((1 . 2)))
#+END_SRC
- Evaluate that code with: C-c C-c
- This will fail when I think it should show the evaluation of the
  code. Here is it's backtrace:
Debugger entered--Lisp error: (wrong-type-argument listp 2)
  mapcar(#[(f) "^HT^P
^H^X^Z\306\n!\204^Y^@\n:\203^Y^@\307\n^H\"\202^Z^@\n*\211^[\203`^@\310\f^M\"\203`^@^K\311\312^M\"\311\313^M\"D^^^N^Z\306\n!\203B^@\314\n^N^N\"\202\\^@\n\203\
O^@\314\315\n^N^N#\202\\^@^N^N\203Z^@^N^N@
\202\\^@^N^N*\202a^@^M^]^N^O^H^X^Z\306\n!\204y^@\n:\203y^@\307\n^H\"\202z^@\n*\206\200^@^N^P^MC^^^N^Z\306\n!\203\223^@\314\n^N^N\"\202\255\
^@\n\203\240^@\314\315\n^N^N#\202\255^@^N^N\203\253^@^N^N@\202\255^@^N^N,\207"
[i *orgtbl-efmt* fmt efmt orgtbl-exp-regexp f functionp plist-get
string-match match-string 1 2 apply\
 format args *orgtbl-fmt* *orgtbl-default-fmt*] 6] (1 . 2))
  orgtbl-format-line((1 . 2))
  orgtbl-format-section(nil)
  orgtbl-to-generic(((1 . 2)) (:remove-newlines t :tstart nil :tend nil
:hline "|---" :sep " | " :lstart "| " :lend " |" :fmt (lambda (cell)
(format "%s" cell))))
  orgtbl-to-orgtbl(((1 . 2)) (:fmt (lambda (cell) (format "%s" cell))))
  org-babel-insert-result(((1 . 2)) ("replace") ("elisp" "(print '((1 .
2)))" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "")
(:noweb . "no") (:tangle . "no") (:e\
xports . "code") (:results . "replace") (:session . "none") (:hlines .
"no") (:result-type . value) (:result-params "replace") (:rowname-names)
(:colname-names)) "" nil 0 #<marker \
at 1 in test.org>) nil 0 "elisp")
  org-babel-execute-src-block(nil)
  org-babel-execute-src-block-maybe()
  org-babel-execute-maybe()
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)

This is my diff for the change:
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el
index cfbcbe6..19b160d 100644
--- a/lisp/org/ob-core.el
+++ b/lisp/org/ob-core.el
@@ -2109,7 +2109,7 @@ code ---- the results are extracted in the syntax of
the source
                  (goto-char beg)
                  (insert (concat (orgtbl-to-orgtbl
                                   (if (org-every
-                                       (lambda (el) (or (listp el) (eq el
'hline)))
+                                       (lambda (el) (or (funcall
proper-list-p el) (eq el 'hline)))
                                        result)
                                       result (list result))
                                   '(:fmt (lambda (cell) (format "%s"
cell)))) "\n"))

Explanation: If a "proper list" (i.e one that ends in "nil") is being
evaluated then emacs will display that "proper list" as a table with one
row for each element if EVERY element in the "proper list" satisfies
"listp".  Later the orgtbl-format-line function is repeatedly called
with successive elements of the "proper list" and does a "mapcar" on the
given element.  This leads to the issue because a cons cell (1 . 2)
satisfies "listp" but will choke "mapcar".

In GNU Emacs 25.2.1 (x86_64-apple-darwin14.5.0)
 of 2017-04-22 built on Yosemite.local
Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/25.2/share/info/emacs
 --prefix=/usr/local/Cellar/emacs/25.2 --without-x --with-xml2
 --without-dbus --without-gnutls --without-imagemagick --without-ns'

Configured features:
NOTIFY ACL LIBXML2 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
regexp-opt rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode
easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils term/xterm xterm
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type tabulated-list newcomment elisp-mode lisp-mode prog-mode
register page menu-bar rfn-eshadow timer select mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
kqueue multi-tty make-network-process emacs)

Memory information:
((conses 16 86431 6722)
 (symbols 48 18779 0)
 (miscs 40 42 113)
 (strings 32 14391 4240)
 (string-bytes 1 414280)
 (vectors 16 9641)
 (vector-slots 8 378348 17602)
 (floats 8 147 542)
 (intervals 56 232 26)
 (buffers 976 19))
[Message part 2 (text/html, inline)]

bug reassigned from package 'emacs' to 'org-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 03 May 2017 19:31:02 GMT) Full text and rfc822 format available.

bug No longer marked as found in versions 25.2. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 03 May 2017 19:31:02 GMT) Full text and rfc822 format available.

Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Sun, 03 Dec 2017 15:31:02 GMT) Full text and rfc822 format available.

Notification sent to Lucas Groenendaal <groenendaal92 <at> gmail.com>:
bug acknowledged by developer. (Sun, 03 Dec 2017 15:31:02 GMT) Full text and rfc822 format available.

Message #14 received at 26765-close <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Lucas Groenendaal <groenendaal92 <at> gmail.com>
Cc: 26765-close <at> debbugs.gnu.org
Subject: Re: bug#26765: 25.2; org-babel: Inserting list of cons cells fails
Date: Sun, 03 Dec 2017 16:30:54 +0100
Hello,

Lucas Groenendaal <groenendaal92 <at> gmail.com> writes:

> Please describe exactly what actions triggered the bug, and
> the precise symptoms of the bug.  If you can, give a recipe
> starting from 'emacs -Q':
>
> First off, I found a fix for this problem.  I wasn't sure how to best
> submit that change but a bug report seemed appropriate so I went with
> that.  After a short demonstration of the problem comes my diff.
> Apologies if anything is missing or confusing, I've never done this
> before.
>
> - Start up emacs: emacs -Q
> - Put this code into an org mode file:
>
> #+BEGIN_SRC elisp
>   (print '((1 . 2)))
> #+END_SRC

I cannot reproduce it, so I guess it was fixed some time ago.

I'm closing this bug report. Please re-open one if you can reproduce it.

Thank you!

Regards,

-- 
Nicolas Goaziou                                                0x80A93738




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Jan 2018 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.