emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "R. Michael Weylandt" <michael.weylandt@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Prepare release 8.2.6
Date: Sun, 6 Apr 2014 13:51:52 -0400	[thread overview]
Message-ID: <CAAmySGPk7zniubkeXTUzFsde6Q2RJpPomks1RC=2nfa5uZnY-w@mail.gmail.com> (raw)
In-Reply-To: <87txa760h6.fsf@gmail.com>

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

On Sat, Apr 5, 2014 at 3:27 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Hello,
>
> Would you mind adding a commit message, TINYCHANGE at its end, and send
> it again with "git format-patch"?

Hi Nicolas,

Thanks for taking the time to review my patches (2 attached):
hopefully these are formatted to org standards.

>
>>> 2) Add a key binding C-c C-v k for org-babel-remove result in ob-keys.el. (Discussed on list but I can't find the reference)
>
> [...]
>
>
> Regards,
>
> --
> Nicolas Goaziou

[-- Attachment #2: 0001-ox-latex.el-downcase-language-name-in-minted-blocks.patch --]
[-- Type: application/octet-stream, Size: 1751 bytes --]

From 6521b72a6a6bc8e1e613554ad406f360f927f3c3 Mon Sep 17 00:00:00 2001
From: Michael Weylandt <michael.weylandt@gmail.com>
Date: Sun, 6 Apr 2014 13:26:19 -0400
Subject: [PATCH 1/2] ox-latex.el: downcase language name in minted blocks

* lisp/ox-latex.el (org-latex-export-to-latex): Downcase the language
name when using minted highlighting for src block exports

Minted, by convention, uses all lowercase names for languages.  This
will handle mappings like "R" to "r" or "Python" to "python"
automatically. More complex renamings still need to be handled by
customizing `org-latex-minted-langs.'

Note that the `downcase' is only applied when using the "automatic"
name. Names in `org-latex-minted-langs' still need to be lower-case.

TINYCHANGE
---
 lisp/ox-latex.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 59e6e83..cc5e998 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1476,7 +1476,7 @@ contextual information."
       (let* ((org-lang (org-element-property :language inline-src-block))
 	     (mint-lang (or (cadr (assq (intern org-lang)
 					org-latex-minted-langs))
-			    org-lang))
+			    (downcase org-lang)))
 	     (options (org-latex--make-option-string
 		       org-latex-minted-options)))
 	(concat (format "\\mint%s{%s}"
@@ -2116,7 +2116,7 @@ contextual information."
 		       ("firstnumber" ,(number-to-string (1+ num-start))))
 		     org-latex-minted-options)))
 		 ;; Language.
-		 (or (cadr (assq (intern lang) org-latex-minted-langs)) lang)
+		 (or (cadr (assq (intern lang) org-latex-minted-langs)) (downcase lang))
 		 ;; Source code.
 		 (let* ((code-info (org-export-unravel-code src-block))
 			(max-width
-- 
1.8.3.4 (Apple Git-47)


[-- Attachment #3: 0002-ob-core.el-ob-keys.el-Add-a-keybinding-to-remove-res.patch --]
[-- Type: application/octet-stream, Size: 1929 bytes --]

From 00341c5327b5e72d42252ec9f7106a15c9363853 Mon Sep 17 00:00:00 2001
From: Michael Weylandt <michael.weylandt@gmail.com>
Date: Sun, 6 Apr 2014 13:41:47 -0400
Subject: [PATCH 2/2] ob-core.el, ob-keys.el: Add a keybinding to remove result
 blocks

* ob-core.el: Add a function `org-babel-remove-result-one-or-many'
which wraps `org-babel-remove-result' to map unto all src blocks when
called with a prefix arg
* ob-keys.el: Add a keybinding "org-babel-key-prefix k" which maps
to `org-babel-remove-result-one-or-many.'

TINYCHANGE
---
 lisp/ob-core.el | 9 +++++++++
 lisp/ob-keys.el | 1 +
 2 files changed, 10 insertions(+)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e8943c6..c73c42b 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2166,6 +2166,15 @@ code ---- the results are extracted in the syntax of the source
         (goto-char location) (forward-line 1)
         (delete-region start (org-babel-result-end))))))
 
+(defun org-babel-remove-result-one-or-many (x)
+  "Remove the result of the current source block.
+If called with a prefix argument, remove all result blocks
+in the buffer."
+  (interactive "P")
+  (if x
+      (org-babel-map-src-blocks nil (org-babel-remove-result))
+    (org-babel-remove-result)))
+
 (defun org-babel-result-end ()
   "Return the point at the end of the current set of results."
   (save-excursion
diff --git a/lisp/ob-keys.el b/lisp/ob-keys.el
index 90b5196..dc1f437 100644
--- a/lisp/ob-keys.el
+++ b/lisp/ob-keys.el
@@ -89,6 +89,7 @@ functions which are assigned key bindings, and see
     ("h" . org-babel-describe-bindings)
     ("\C-x" . org-babel-do-key-sequence-in-edit-buffer)
     ("x" . org-babel-do-key-sequence-in-edit-buffer)
+    ("k" . org-babel-remove-result-one-or-many)
     ("\C-\M-h" . org-babel-mark-block))
   "Alist of key bindings and interactive Babel functions.
 This list associates interactive Babel functions
-- 
1.8.3.4 (Apple Git-47)


  parent reply	other threads:[~2014-04-06 17:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03  6:37 Prepare release 8.2.6 Bastien
2014-04-04  9:05 ` Sebastien Vauban
2014-04-04 11:51 ` Michael Weylandt
2014-04-05 16:41   ` R. Michael Weylandt
2014-04-05 19:18     ` Nicolas Goaziou
2014-04-07  1:48       ` R. Michael Weylandt
2014-04-07 10:19         ` Nicolas Goaziou
2014-04-17 19:58           ` Bastien
2014-04-04 14:32 ` Michael Weylandt
2014-04-05 16:45   ` R. Michael Weylandt
2014-04-05 19:27     ` Nicolas Goaziou
2014-04-05 21:48       ` York Zhao
2014-04-06 17:51       ` R. Michael Weylandt [this message]
2014-04-06 18:03         ` Nicolas Goaziou
2014-04-11  2:43         ` Eric Schulte
2014-04-13 17:02           ` R. Michael Weylandt
2014-04-17  6:26             ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2014-04-03  7:53 Bastien
2014-04-03  9:17 ` Alan Schmitt
2014-04-03 10:13 ` KDr2
2014-04-03 11:47 ` Rainer M Krug
2014-04-03 11:47 ` Rainer M Krug
2014-04-18 12:04   ` Bastien
2014-04-28 13:40     ` Rainer M Krug

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='CAAmySGPk7zniubkeXTUzFsde6Q2RJpPomks1RC=2nfa5uZnY-w@mail.gmail.com' \
    --to=michael.weylandt@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).