From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: New patches WAS Re: [PATCH] inline src block results can be removed Date: Fri, 23 Jan 2015 00:08:09 +0100 Message-ID: <87a91a76sm.fsf@selenimh.mobile.lan> References: <87egt81acy.fsf@gmail.com> <8761ejq9ek.fsf@nicolasgoaziou.fr> <87sihltt3v.fsf@selenimh.mobile.lan> <87zjbqrapy.fsf@nicolasgoaziou.fr> <87lhl2s5zc.fsf@nicolasgoaziou.fr> <87oapuac7g.fsf@nicolasgoaziou.fr> <87egqpxc6o.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEQqF-0007cs-RD for emacs-orgmode@gnu.org; Thu, 22 Jan 2015 18:07:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEQqC-0004D4-KS for emacs-orgmode@gnu.org; Thu, 22 Jan 2015 18:07:11 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:41650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEQqC-0004Cn-BZ for emacs-orgmode@gnu.org; Thu, 22 Jan 2015 18:07:08 -0500 In-Reply-To: (Charles C. Berry's message of "Wed, 21 Jan 2015 19:07:02 -0800") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Charles C. Berry" Cc: Aaron Ecay , Andreas Leha , emacs-orgmode@gnu.org, Ista Zahn , mcg "Charles C. Berry" writes: > I attach 3 patches and a file of usage examples. Thanks. > + (let* ((el (org-element-context)) > + (beg (org-element-property :begin el)) > + (type (org-element-type el))) > + (when (eq type 'inline-babel-call) > + (goto-char beg))) Nitpick: this looks like a lot of bindings for a dubious readability improvement. What about: (let ((datum (org-element-context))) (when (eq (org-element-type datum) 'inline-babel-call) (goto-char (org-element-property :begin datum)))) > + (bad-inline-p > + (when inlinep > + (or > + (and (member "table" result-params) "`:results table'") > + (and (listp result) "list result") > + (and (string-match-p "\n." result) "multiline result") `string-match-p' => `org-string-match-p' > (cond > ;; do nothing for an empty result > ((null result)) > + ;; illegal inline result or params Capital and final dot. > + (when inlinep > + (goto-char inlinep) > + (setq result) (org-macro-escape-arguments result)) (setq result (org-macro-escape-arguments result)) > + (bad-inline-p) ;; do nothing Single semicolon for end-of-line comments, and capital+final dot. > +(defun org-babel-remove-inline-result () > + "Remove the result of the current inline-src-block or babel call. > +The result must be wrapped in a `results' macro to be > + removed. Extraneous leading whitespace is trimmed." > + (let* ((el (org-element-context)) > + (post-blank (org-element-property :post-blank el))) > + (when (memq (org-element-type el) '(inline-src-block inline-babel-call)) > + (org-with-wide-buffer > + (goto-char (org-element-property :end el)) > + (let ((el (org-element-context))) ^^^ spurious space This looks good. I think you can push them into master once the minor issues above are fixed and if all tests pass. Regards, -- Nicolas Goaziou