emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: Samuel Wales <samologist@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [ascii] box
Date: Tue, 9 Apr 2013 18:42:44 -0400	[thread overview]
Message-ID: <CANU-iVDitLjgaCk2aQ5Hi8vMeGhK=-zHgJ2gMwd6DVKk_vXe+Q@mail.gmail.com> (raw)
In-Reply-To: <CAJcAo8smdD_akOJw87bPANiQMmPt=PNgJ87u3cOQDcS7BHj1yQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]

On Tue, Apr 9, 2013 at 5:28 PM, Samuel Wales <samologist@gmail.com> wrote:

> ASCII boxes for blocks might be more convenient for the
> reader if they do not have any characters to the left of the
> code.
>
> #+BEGIN_SRC emacs-lisp
>   (defun code-for-copy-and-paste ()
>     (makes newcomer use rectangle or unboxing commands :())
> #+END_SRC
>
> Maybe output like this instead:
>
> ,----------
> code
> `----------
>
>
I use message-mark-inserted-region to mark code in email:

--8<---------------cut here---------------start------------->8---
#+name: r-with-ggplot2
#+begin_src R :results output graphics :var tbl=foo :file foo-output.png
:width 400 :height 300
  library(ggplot2)
  res <- ggplot(tbl, aes(a_foo_var))
  res + geom_histogram(aes(y=..density..)) +
  geom_density(weight=2) + xlab("A foo variable")
#+end_src
--8<---------------cut here---------------end--------------->8---

That allows easy cut-and-paste. I use boxquote-region for documentation etc
that I don't expect the reader to cut and paste.

They are bound to C-c m and C-c q resp. using this initialization code:

--8<---------------cut here---------------start------------->8---
(define-key mode-specific-map [?q] 'boxquote-region)
(define-key mode-specific-map [?m] 'message-mark-inserted-region)
--8<---------------cut here---------------end--------------->8---

Nick

[-- Attachment #2: Type: text/html, Size: 3549 bytes --]

  reply	other threads:[~2013-04-09 22:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 21:28 [ascii] box Samuel Wales
2013-04-09 22:42 ` Nick Dokos [this message]
2013-04-09 23:02   ` Samuel Wales
2013-04-09 23:03   ` Thorsten Jolitz

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='CANU-iVDitLjgaCk2aQ5Hi8vMeGhK=-zHgJ2gMwd6DVKk_vXe+Q@mail.gmail.com' \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=samologist@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).