emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Will Pierce <pierwill@gmail.com>
To: emacs-orgmode@gnu.org
Subject: add org-quote-region
Date: Sat, 4 Aug 2018 17:23:36 -0500	[thread overview]
Message-ID: <CAF-DrMiy=hN3iKXrySyQ-Xm4qfMB6gcnFOp5uBUuF21XJnPMUg@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 170 bytes --]

Adds a function to turn the highlighted region into a block quote for
export ("#+begin_quote...#+end_quote").

As a writer using org-mode I've found this very useful.

W

[-- Attachment #1.2: Type: text/html, Size: 253 bytes --]

[-- Attachment #2: 0001-Add-org-quote-region-function.patch --]
[-- Type: application/octet-stream, Size: 957 bytes --]

From e799ff70965d3ac479eb817687cb02b7fb188c7d Mon Sep 17 00:00:00 2001
From: pierwill <19642016+pierwill@users.noreply.github.com>
Date: Sat, 4 Aug 2018 17:08:39 -0500
Subject: [PATCH] Add org-quote-region function

---
 lisp/org.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 999575d05..b29b3e353 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22643,6 +22643,17 @@ package ox-bibtex by Taru Karttunen."
 	       org--rds (list (list 'bib bib))))))
     (call-interactively 'reftex-citation)))
 
+(defun org-quote-region (start end)
+  "Mark current region as a quotation block. (#+begin_quote)"
+  (interactive "r")
+  (save-restriction
+    (narrow-to-region start end)
+    (goto-char (point-min))
+    (insert "#+begin_quote\n")
+    (goto-char (point-max))
+    (insert "#+end_quote\n")))
+
+
 ;;;; Functions extending outline functionality
 
 (defun org-beginning-of-line (&optional n)
-- 
2.18.0


             reply	other threads:[~2018-08-04 22:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04 22:23 Will Pierce [this message]
2018-08-04 22:27 ` add org-quote-region Will Pierce
2018-08-05  4:28 ` Kyle Meyer
2018-08-05 15:31   ` Will Pierce

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='CAF-DrMiy=hN3iKXrySyQ-Xm4qfMB6gcnFOp5uBUuF21XJnPMUg@mail.gmail.com' \
    --to=pierwill@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).