From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Have SRC_BLOCK :padline accept numbers Date: Wed, 29 Mar 2017 14:27:00 +0200 Message-ID: <878tnoqne3.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctCgv-0001sv-L6 for emacs-orgmode@gnu.org; Wed, 29 Mar 2017 08:27:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctCgu-0003Ja-ED for emacs-orgmode@gnu.org; Wed, 29 Mar 2017 08:27:09 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:56350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ctCgu-0003JC-8e for emacs-orgmode@gnu.org; Wed, 29 Mar 2017 08:27:08 -0400 In-Reply-To: (Daniel P. Gomez's message of "Tue, 28 Mar 2017 21:47:42 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Daniel P Gomez Cc: emacs-orgmode@gnu.org Hello, Daniel P Gomez 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 > 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