[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Have SRC_BLOCK :padline accept numbers
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Have SRC_BLOCK :padline accept numbers |
Date: |
Wed, 29 Mar 2017 14:27:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hello,
Daniel P Gomez <address@hidden> writes:
> I've written a small patch (attached here), following the contribution
> guidelines on the org-mode website. The "patched" repository can be found
> here: https://github.com/dangom/org-mode/tree/feature_padline
Thank you.
> Please let me know if there is anything else I should do.
Some comments follow.
> From f5e67856b6cefb7c5e9c1b6bd74321d3b47f1b05 Mon Sep 17 00:00:00 2001
> From: Daniel Gomez <address@hidden>
> Date: Tue, 28 Mar 2017 21:20:23 +0200
> Subject: [PATCH] Add support for :padline with numbers in ob-tangle.
>
You need to add list modified functions here, with the actual
modifiaction, e.g.,
* lisp/ob-tangle.el (the-function-I-modified): Been there, done that.
Also, if you haven't signed FSF papers yet, you need to add "TINYCHANGE"
at the end of the commit message.
> - (unless (or (string= "no" (cdr (assq :padline (nth
> 4 spec))))
> - (= (point) (point-min)))
> - (insert "\n"))
> + (let ((padlines (format "%s" (cdr (assq :padline
> (nth 4 spec))))))
> + (cond
> + ((and (string= "nil" padlines) (not (= (point)
> (point-min))))
(not (= (point) (point-min))) -> (not (bobp))
> + (insert "\n"))
> + ((string= "no" padlines)
> + nil)
> + ((numberp (string-to-int padlines))
(numberp (string-to-int padlines)) -> (string-match-p "\\`[0-9]+\\'" padlines)
> + (dotimes (i (string-to-int padlines)) (insert
> "\n")))
string-to-int -> string-to-number
Regards,
--
Nicolas Goaziou