From: "Berry, Charles" <ccberry@ucsd.edu>
To: akater <nuclearspace@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Some whitespace stripped from emacs-lisp value in src blocks making it unreadable in certain cases
Date: Tue, 10 Sep 2019 17:29:24 +0000 [thread overview]
Message-ID: <16A4335F-9F40-4D7B-A56D-C846B9C3447B@ucsd.edu> (raw)
In-Reply-To: <875zm1c6ld.fsf@gmail.com>
> On Sep 9, 2019, at 5:55 PM, akater <nuclearspace@gmail.com> wrote:
>
> Consider a lisp form that, when evaluated, produces another form. I'm
> used to org printing the resulting form nicely, in lisp blocks. However,
> this is not the case for emacs-lisp src blocks. An example:
>
> 1. The way it should be (and is now the case) with lisp, namely sbcl:
>
> #+begin_src lisp :results value verbatim :wrap example lisp
> (macroexpand '(defun test (a b &optional c) "doc" nil))
> #+end_src
>
> #+RESULTS:
> #+begin_example lisp
> (PROGN
> (EVAL-WHEN (:COMPILE-TOPLEVEL) (SB-C:%COMPILER-DEFUN 'TEST T NIL NIL))
> (SB-IMPL::%DEFUN 'TEST
> (SB-INT:NAMED-LAMBDA TEST
> (A B &OPTIONAL C)
> "doc"
> (BLOCK TEST NIL))))
> T
> #+end_example
>
> 2. The way it is now with emacs-lisp and a src block header that is
> otherwise identical:
>
> #+begin_src emacs-lisp :results value verbatim :wrap example emacs-lisp
> (macroexpand
> '(use-package outline
> :ensure nil
> :bind
> (:map outline-mode-map
> ("<kp-home>" . (lambda nil (interactive) (outline-up-heading 1))))))
> #+end_src
>
Using emacs 26.1 and org 9.2.5, I get
#+RESULTS:
#+begin_example emacs-lisp
(use-package outline :ensure nil :bind (:map outline-mode-map ("<kp-home>" lambda nil (interactive) (outline-up-heading 1))))
#+end_example
I am unclear what the effect of `:wrap example emacs-lisp' is here. AFAICS, the `emacs-lisp' has no effect. Can you point to a place in the code where this has effect?
Using `:results value code :wrap src emacs-lisp' as the header args, I get this:
#+RESULTS:
#+begin_src emacs-lisp
(use-package outline :ensure nil :bind
(:map outline-mode-map
("<kp-home>" lambda nil
(interactive)
(outline-up-heading 1))))
#+end_src
HTH,
Chuck
prev parent reply other threads:[~2019-09-10 21:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 0:55 Some whitespace stripped from emacs-lisp value in src blocks making it unreadable in certain cases akater
2019-09-10 15:43 ` Colin Baxter
2019-09-10 17:29 ` Berry, Charles [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16A4335F-9F40-4D7B-A56D-C846B9C3447B@ucsd.edu \
--to=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
--cc=nuclearspace@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).