Re: [O] aligning images, html attributes ignored when exporting to html (longish, sorry)

2018-04-22 Thread Nicolas Goaziou
Hello,

Andreas Reuleaux  writes:

> following this tutorial
>
>   https://orgmode.org/worg/org-tutorials/images-and-xhtml-export.html
>
> I am trying to export some sample.org file to html, and have the images
> floated to the right, with no success however.
>
> to that end ATTR_HTML is used in the tutorial and in my sample.org:
> -
> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
> eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
> minim veniam, quis nostrud exercitation ullamco laboris nisi ut
> aliquip ex ea commodo consequat. 
> #+ATTR_HTML: style="float:right;"
> [[./img/org-mode-unicorn.png]]

I think the correct syntax is

  #+ATTR_HTML: :style float:right;

The tutorial is probably outdated.


Regards,

-- 
Nicolas Goaziou



Re: [O] aligning images, html attributes ignored when exporting to html (longish, sorry)

2018-04-22 Thread Andreas Reuleaux
Nicolas Goaziou  writes:

> I think the correct syntax is
>
>   #+ATTR_HTML: :style float:right;
>
> The tutorial is probably outdated.
>
>
> Regards,

Thanks a lot, and yes: I found that out myself already in the meantime.

I had sent another mail to the mailing list is this regard, which hasn't
made it to the list yet (not sure why it's taking that long, but I am in
contact with Bastien already).

Thanks, 
  Andreas





[O] M4 support take#3

2018-04-22 Thread Brad Knotwell
 Thanks for the code review.  With one exception--:prefix-builtins is an option 
not an argument--I've incorporated your feedback.
As far as papers, I've read the information on that link several times and it 
appears the simplest thing to do is for me to put these changes in the public 
domain.  If that works, let me know and I'll remove the license and put in a 
disclaimer to that effect.  If not, it'll need to live in contrib as the 
bureaucracy seems excessive.
Thx.
--Brad
On Friday, April 13, 2018, 1:31:53 PM PDT, Nicolas Goaziou 
 wrote:  
 
 Hello,

Brad Knotwell  writes:

> Given the code review from earlier, I've added a second file with the
> requested changes.

Thank you. Some minor comments follow.

> (defconst org-babel-header-args:m4
>  '((:cmd-line . :any)
>    (:quote . :any)
>    (:unquote . :any)
>    (:list-start . :any)
>    (:list-end . :any)
>    (:prefix-builtins))

Missing allowed type for last header. Maybe :any ?

> (defun org-babel--m4-prefix (params)
>  "Prefix m4_ if :prefix-builtins is set"
>  (if (assq :prefix-builtins params) "m4_" ""))
>
> (defun org-babel--m4-changequote (params)
>  "Declare quoting behavior if start-quote and end-quote are set.  Otherwise, 
>return an empty string."

The line is too long. The second sentence should go onto another line.

>  (let ((prefix (org-babel--m4-prefix params))
>     (start-quote (cdr (assq :quote params)))
>     (end-quote (cdr (assq :unquote params
>    (if (and start-quote end-quote) (format "%schangequote(%s,%s)%sdnl\n" 
>prefix start-quote end-quote prefix) "")))

See above.

> (defun org-babel--variable-assignment:m4_generic (params varname values)
>  "Build the simple macro definitions prepended to the script body."
>  (let ((prefix (org-babel--m4-prefix params)))
>     (format "%sdefine(%s,%s)%sdnl\n" prefix varname values prefix)))

The (format ...) is not correctly indented.

> (defun org-babel--variable-assignment:m4_list (params varname values)
>  "Build the complex macro definitions prepended to the script body."
>  (let ((prefix (org-babel--m4-prefix params))
>     (list-start (or (cdr (assq :list-start params)) "["))
>     (list-end (or (cdr (assq :list-end params)) "]")))
>    (format "%sdefine(%s,%s%s%s)%sdnl\n" prefix varname list-start
>         (mapconcat
>         (lambda (value)
>           ;; value could be a numeric table entry as well as a string
>           (if (= (length value) 1) (format "%s" (car value))
>         (concat list-start (mapconcat (lambda (x) (format "%s" x)) value ",")
>             list-end))) values ",") list-end prefix)))

The line is too long. `values' should be below (lambda ...), so does
",". `list-end' and `prefix' should be below "%sdefine..."

> (defun org-babel--variable-assignments:m4 (params varnames values)
>  "Internal helper that converts parameters to m4 definitions."
>  (pcase values
>    (`(,_ . ,_) (org-babel--variable-assignment:m4_list params varnames 
>values))
>    (_ (org-babel--variable-assignment:m4_generic params varnames values
>
> (defun org-babel-variable-assignments:m4 (params)
>  "Interface function that converts parameters to m4 definitions."
>  (concat (org-babel--m4-changequote params)
>       (apply #'concat (mapcar (lambda (pair) 
> (org-babel--variable-assignments:m4
>                           params (car pair) (cdr pair)))
>                   (org-babel--get-vars params)

(mapcar ...) should be below #'concat.

> ;; Required to make tangling work
> ;; The final "\n" is needed as GNU m4 errors out if a file doesn't end in a 
> newline.
> (defun org-babel-expand-body:m4 (body params)
>  "Expand BODY according to PARAMS, return the expanded body."
>  (concat (org-babel-variable-assignments:m4 params) body "\n"))
>
> (defun org-babel-execute:m4 (body params)
>  "Execute a block of m4 code with Org Babel.
> BODY is the source inside a m4 source block and PARAMS is an
> association list over the source block configurations.  This
> function is called by `org-babel-execute-src-block'."
>  (message "executing m4 source code block")
>  (let* ((result-params (cdr (assq :result-params params)))
>          (cmd-line (cdr (assq :cmd-line params)))
>     (prefix-builtins (assq :prefix-builtins params))
>     (code-file (let ((file (org-babel-temp-file "m4-")))
>                      (with-temp-file file
>             (insert (org-babel-expand-body:m4 body params) file)) file))

Last `file' should be below (let ((file ...))).

>     (stdin (let ((stdin (cdr (assq :stdin params
>           (when stdin
>             (let ((tmp (org-babel-temp-file "m4-stdin-"))
>               (res (org-babel-ref-resolve stdin)))
>               (with-temp-file tmp
>             (insert res))
>               tmp
>          (cmd (mapconcat #'identity
>             (remq nil
>                   (list org-babel-m4-command
>                     cmd-line (if prefix-builtins "-P") "<" code-file))

(and prefix-builtins "-P")

"<" and `code-file' should go below `#'id

Re: [O] Should wip-cite branch be merged to master?

2018-04-22 Thread András Simonyi
Dear All,

thanks for bringing this up. I definitely agree that it'd be too early to merge
the wip-cite branch. In fact, having added (experimental) support for it in
citeproc-org I've been planning to propose some changes/extensions to the syntax
but I wanted to wait until citeproc-org and citeproc-el become available as
MELPA packages which still isn't the case (citeproc-el is already there but
citeproc-org still needs some work before I can submit it). Anyhow, since the
topic has come up, here is how I see the situation (sorry for the length):

>From the citeproc-el/CSL point of view, the current syntax is perfect with the
notable exception of the provided citation commands. Currently only `cite' and
`(cite)' are supported, where the latter seems to be intended to provide the
parenthetical version of a basic citation, e.g. in an author-date style `cite'
would produce something like `Smith 2018` while `(cite)' `(Smith 2018)'. Now I
think that for author-date styles `cite' should produce the parenthetical
version and that `(cite)' probably shouldn't be among the commands at all. The
main reason is that most citation processors (biblatex, CSL processors etc.)
support not only author-date citation styles but footnote-based ones as well,
and the concept of a `parenthetical citation' doesn't really make sense for the
latter. A more abstract characterization which is applicable to all styles is
that normally references are not part of the main text, they are set off either
by brackets or in a note. Since this is the most frequent, basic form, I think
this the one which should be produced by the `cite' syntax, that is, when used
in normal text `cite' should produce something like `(Smith 2018)' for
author-date styles and a note with the reference for note styles.

In addition to `cite', the following additional variants would be very
useful, and would probably cover the majority of use-cases:

- "bare cite": the same as cite, but doesn't separate the reference from
   the main text (no brackets/note);

- "suppress author": removes the author's name from the citation.

- "textual cite": includes the author's name in the main text but sets
  off the rest of the citation.

A proposal for the syntax of the additional forms: bare cite could be indicated
by a `-' suffix, suppress author by a `*' and textual cite by a `t' resulting in
the variants

| command   | result in author-date styles |
|---+--|
| cite  | (Smith 2017) |
| citet | Smith (2017) |
| cite- | Smith 2017   |
| cite* | (2017)   |
| cite*-/cite-* | 2017 |

(omitting some combinatorial possibilities that don't make practical sense). 

It would be a nice extra to also provide commands for adding an item to the list
of references without actually citing it (`nocite' command), and for adding
literal cites (that provide the full text of the citation, and whose sole
function is to let the processor know that a citation occurred at a certain
location) but these are obviously not so important as the ones in the above
table.

The citeproc-el wiki contains a bit more information about this proposal:

https://github.com/andras-simonyi/citeproc-el/wiki/Citation-types-and-commands

I'd be glad to hear your views regarding these issues.

best regards,

András

  >> There is a package which support wip-cite:
  >> https://github.com/andras-simonyi/citeproc-org, should wip-cite
  >> branch be merged to master now?

  > Merging wip-cite branch with master, and integration of citeproc-org
  > into Org core, could be discussed with the author of the library, and,
  > of course, with anyone interested in using the @cite syntax. For
  > example, I need to know if that syntax, along with citeproc-org, covers
  > enough use-cases for citations, if it brings more value than using,
  > e.g., Org Ref, which already exists, how it could be improved, etc.

  > I have the feeling that it is a bit early for Org 9.2. Anyway, I'm
  > Cc'ing András and John for their opinion about it. I'd love to hear from
  > everyone involved in the last round of discussion about the subject,
  > too.



  > Regards,

  > --
  > Nicolas Goaziou



[O] [PATCH 1/4] org-src.el: Fixed dynamic fontification bug

2018-04-22 Thread roberthambrock
From: Robert Hambrock 

* lisp/org-src.el (org-src-font-lock-fontify-block): Fixed temporary
buffer name. Clojure's Cider could not dynamically fontify Clojure
subsections of the buffer. Removing the rogue space from the temporary
buffername fixes this.
---
 lisp/org-src.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index ec32d7bf3..bd76aa5af 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -548,7 +548,7 @@ as `org-src-fontify-natively' is non-nil."
(remove-text-properties start end '(face nil))
(with-current-buffer
(get-buffer-create
-(format " *org-src-fontification:%s*" lang-mode))
+(format "*org-src-fontification:%s*" lang-mode))
  (let ((inhibit-modification-hooks nil))
(erase-buffer)
;; Add string and a final space to ensure property change.
-- 
2.16.3




[O] [PATCH 0/4] Clojure mode patches

2018-04-22 Thread roberthambrock
From: Robert Hambrock 

Dear Org maintainer,

These four patches are independent and can thus be applied individually.

Please let me know if you have any questions.

All the best,
Robert

Robert Hambrock (4):
  org-src.el: Fixed dynamic fontification bug
  ob-clojure.el: Add ClojureScript interface
  ob-clojure.el: Use :ns flag in org-src-edit
  ob-clojure.el: Add ClojureScript tangle language extension

 lisp/ob-clojure.el | 17 ++---
 lisp/org-src.el|  2 +-
 2 files changed, 15 insertions(+), 4 deletions(-)

-- 
2.16.3




[O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface

2018-04-22 Thread roberthambrock
From: Robert Hambrock 

* lisp/ob-clojure.el (org-babel-execute:clojure): Implemented :target,
which allows selection of connection.
* lisp/ob-clojure.el (org-babel-execute:clojurescript): New
ClojureScript interface that uses :target flag to specify `cljs`
evaluation target.
---
 lisp/ob-clojure.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index 93674b552..7f7c24ff1 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -129,7 +129,8 @@ using the :show-process parameter."
   (cider
(require 'cider)
(let ((result-params (cdr (assq :result-params params)))
-(show (cdr (assq :show-process params
+(show (cdr (assq :show-process params)))
+(connection (cider-current-connection (cdr (assq :target 
params)
  (if (member show '(nil "no"))
 ;; Run code without showing the process.
 (progn
@@ -137,7 +138,7 @@ using the :show-process parameter."
 (let ((nrepl-sync-request-timeout
org-babel-clojure-sync-nrepl-timeout))
   (nrepl-sync-request:eval expanded
-   (cider-current-connection
+   connection)))
   (setq result
 (concat
  (nrepl-dict-get response
@@ -171,7 +172,7 @@ using the :show-process parameter."
(nrepl--merge response resp)
;; Update the status of the nREPL output session.
(setq status (nrepl-dict-get response "status")))
- (cider-current-connection))
+ connection)
 
 ;; Wait until the nREPL code finished to be processed.
 (while (not (member "done" status))
@@ -211,6 +212,9 @@ using the :show-process parameter."
   (condition-case nil (org-babel-script-escape result)
(error result)
 
+(defun org-babel-execute:clojurescript (body params)
+  (org-babel-execute:clojure body (cons '(:target . "cljs") params)))
+
 (provide 'ob-clojure)
 
 ;;; ob-clojure.el ends here
-- 
2.16.3




[O] [PATCH 4/4] ob-clojure.el: Add ClojureScript tangle language extension

2018-04-22 Thread roberthambrock
From: Robert Hambrock 

* lisp/ob-clojure.el (org-babel-tangle-langs-exts): Add ClojureScript
to the supported language extensions.
---
 lisp/ob-clojure.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index c59ac96ab..6fc5d043b 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -57,6 +57,7 @@
 
 (defvar org-babel-tangle-lang-exts)
 (add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
+(add-to-list 'org-babel-tangle-lang-exts '("clojurescript" . "cljs"))
 
 (defvar org-babel-default-header-args:clojure '())
 (defvar org-babel-header-args:clojure '((package . :any)))
-- 
2.16.3




[O] [PATCH 3/4] ob-clojure.el: Use :ns flag in org-src-edit

2018-04-22 Thread roberthambrock
From: Robert Hambrock 

* lisp/ob-clojure.el (org-babel-edit-prep:clojure): New function that
sets the buffer's namespace to the value of :ns, if provided.
(org-babel-edit-prep:clojurescript): Alias for
org-babel-edit-prep:clojure.
---
 lisp/ob-clojure.el | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index 7f7c24ff1..c59ac96ab 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -215,6 +215,12 @@ using the :show-process parameter."
 (defun org-babel-execute:clojurescript (body params)
   (org-babel-execute:clojure body (cons '(:target . "cljs") params)))
 
+(defun org-babel-edit-prep:clojure (babel-info)
+  (if-let* ((namespace (cdr (assq :ns (nth 2 babel-info)
+  (setq-local cider-buffer-ns namespace)))
+
+(defalias 'org-babel-edit-prep:clojurescript 'org-babel-edit-prep:clojure)
+
 (provide 'ob-clojure)
 
 ;;; ob-clojure.el ends here
-- 
2.16.3




Re: [O] [PATCH 2/4] ob-clojure.el: Add ClojureScript interface

2018-04-22 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Those patches are great. solve some of my problem.

Does CIDER support ClojureScript natively so ob-clojure can integrate it?

- -- 
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrdSM0ACgkQG13xyVro
msOzQQgAmJ9IJzDNNK1PirXfok2Teq4hSRZ+hNpxhH+p4+Fpd1p+MQXBAhrMsno5
2gV+wyjzshvMus2erk8O061e/ggzYt8ADuoha/NPjU/D3477CFzzuJj4FVaDiKkn
1lJCjHoR56h0xJK3PJxT72KHc1uQMMrsH3PzR2AoxfEEoSI56dlSvz3FgdXOQ8ha
ODyZyHvSxFF5DzGvXUzXoVHH6SxlKzbdWKp0cAo7Ue3E9EcNYW7ASGryPW9KpyIk
HOUYTurKhZIrYr7pG3zYzEWa1P1UFvoqwn1/SeR6sYKoVZo9nL81+Y2P4+h/IHqk
mjlcjMoRNzIdqwNvGO5UP/cokSUJEg==
=zief
-END PGP SIGNATURE-