[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] New patches WAS Re: [PATCH] inline src block results can be remo
From: |
Nicolas Goaziou |
Subject: |
Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed |
Date: |
Fri, 23 Jan 2015 00:08:09 +0100 |
"Charles C. Berry" <address@hidden> 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
- [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/12
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Nicolas Goaziou, 2015/01/16
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/18
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Nicolas Goaziou, 2015/01/19
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/19
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Nicolas Goaziou, 2015/01/20
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/21
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed,
Nicolas Goaziou <=
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/24
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Aaron Ecay, 2015/01/24
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/25
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/29
Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Aaron Ecay, 2015/01/16