Re: [O] [PATCH] ob-clojure.el and ob-clojure-literate.el support new header argument :ns

2018-04-15 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> About the compilation warnings. I only did "make test". have not do
> compilation test. Do you mean compile whole org-mode project or compile
> a single file ob-clojure.el with [M-x byte-compile-file]? I will include
> this step in my future patch workflow.

make test shows compilation warnings. For extra care, you can also run
"make single".

> I don't know how to replace `-map` and `-contains-p` functions. Is there
> any suggestions?

`-map' -> `mapcar'

`-contains-p' -> `member', `memq', `cl-member' or even `seq-contains',
 which is fine for "contrib/".

> BTW, I write some documents on Worg about ob-clojure :ns usage,
> ob-clojure-literate.el and ob-js :session usage etc. But I can't push to
> remote. Here is my steps.

I'm Cc'ing Bastien about it.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Weird interaction between ox-extra and include :minlevel

2018-04-15 Thread Nicolas Goaziou
Hello,

Daniel P Gomez  writes:

> I was thinking of #+ignore_tags. as an analog of #+exclude_tags. While
> #+exclude_tags removes a complete subtree from export, #+ignore_tags
> would only ignore headlines and insert the contents.

You may want to read the discussions about this feature on the ML.

I think "only" is not accurate. To make it clear, what would become the
following documents:

--8<---cut here---start->8---
* H

Text

** H2 :ignore:

Text 2

*** H3
--8<---cut here---end--->8---

and

--8<---cut here---start->8---
Text 0

* H :ignore:

Text

** H2

Text 2
--8<---cut here---end--->8---

but also

--8<---cut here---start->8---
- item
* H :ignore:
- new list?
--8<---cut here---end--->8---

and the following convoluted one

--8<---cut here---start->8---
#+begin_example

Something

* H :ignore:

Somethin else
#+end_example
--8<---cut here---end--->8---

> When used in combination, subtree would be excluded no matter what.
>
> #+IGNORE_TAGS: ignore bar
> #+EXLUDE_TAGS: noexport foo

I'm not sure to understand this.

> The idea of ignore_tags, for me, would to allow grouping content
> within the Org file in a manner that differs from the grouping of
> content upon export - without having to resort to filter-hooks. Not
> that hooks are bad, but they are harder to construct without proper
> elisp skills and require knowledge about the Org API.

The manual gives one example of one such hook, see (info "(org) Advanced
configuration"). There, the filter /only/ removes headlines.

Regards,

-- 
Nicolas Goaziou



[O] bug#26467: 25.2; [Org mode] Call dot babel from elisp generate invalid image

2018-04-15 Thread Nicolas Goaziou
Hello,

wang jinjian  writes:

> Use case is call dot babel from elisp code block. refer to
> http://orgmode.org/worg/org-tutorials/org-dot-diagrams.html
>
> Below is a more minimal example:
>
> #+NAME: nodes
> | From | To | Weight |
>
> |--++|
> | A| B  |  3 |
> | A| C  |  2 |
> | B| D  |  4 |
> | B| E  |  5 |
> | C| F  | 10 |
>
> #+BEGIN_SRC elisp :file a.png :var nodes=nodes
> (defun rowfun(x)
> (format "%s -> %s [label=%s];" (nth 0 x) (nth 1 x) (nth 2 x))
> )
>   (defun dotgen(nodes)
> (let ((dotbegin "digraph {\nnode [shape=circle]\n")
>   (dotend "\n}"))
>   (concat dotbegin
>   (mapconcat #'rowfun nodes "\n")
>   dotend)))
> (setq params (nth 2 (org-babel-get-src-block-info)))
>   (org-babel-execute:dot (dotgen nodes) params)
> #+END_SRC
>
> If run this block with C-c C-c, it will generate a image a.png with
> "nil" string in it. so it's a invalid image file.

I can achieve the desired effect with:

#+name: nodes
| From | To | Weight |
|--++|
| A| B  |  3 |
| A| C  |  2 |
| B| D  |  4 |
| B| E  |  5 |
| C| F  | 10 |

#+begin_src elisp :file /tmp/a.png :var nodes=nodes :results file
(defun rowfun (x)
  (format "%s -> %s [label=%s];" (nth 0 x) (nth 1 x) (nth 2 x)))
(defun dotgen (nodes)
  (format "digraph {\nnode [shape=circle]\n%s\n}"
  (mapconcat #'rowfun nodes "\n")))
(dotgen nodes)
#+end_src

I don't see why you would need to call `org-babel-execute:dot'.

Does it fix your issue?

Regards,

-- 
Nicolas Goaziou0x80A93738





[O] Sectioning from includes gets confused in export

2018-04-15 Thread Jarmo Hurri

Greetings.

Attached are two files:
1. steps.org : main org file
2. step.org : file included twice into main org file

If you export the main file to LaTeX (C-c C-e l o) you will notice that
the correct sectioning level of the level 2 section of step.org is lost
in the export. The level 2 section becomes subordinate to level 3
section.

Feature or bug? Possibility of this being fixed?

As usual, this is a simplified version of something much more
complicated I need to do.

All the best,

Jarmo


* A process
#+include: step.org
*** something more
#+include: step.org
** Step {{{n}}}
*** Short description
   1. a small list
   2. with two items


Re: [O] Sectioning from includes gets confused in export

2018-04-15 Thread Nicolas Goaziou
Hello,

Jarmo Hurri  writes:

> Attached are two files:
> 1. steps.org : main org file
> 2. step.org : file included twice into main org file
>
> If you export the main file to LaTeX (C-c C-e l o) you will notice that
> the correct sectioning level of the level 2 section of step.org is lost
> in the export. The level 2 section becomes subordinate to level 3
> section.
>
> Feature or bug? Possibility of this being fixed?

Feature. See (info "(org) Include files"), in particular :minlevel parameter.

Regards,

-- 
Nicolas Goaziou



Re: [O] Sectioning from includes gets confused in export

2018-04-15 Thread Jarmo Hurri

>> If you export the main file to LaTeX (C-c C-e l o) you will notice
>> that the correct sectioning level of the level 2 section of step.org
>> is lost in the export. The level 2 section becomes subordinate to
>> level 3 section.
>>
>> Feature or bug?
>
> Feature. See (info "(org) Include files"), in particular :minlevel
> parameter.

Thanks, that was a super quick response!

All the best,

Jarmo




Re: [O] [PATCH] org-compat: Allow imenu items without hierarchy

2018-04-15 Thread Nicolas Goaziou
Hello,

Michael Hendricks  writes:

> * lisp/org-compat.el (org-imenu-flat): New custom variable.
> (org-imenu-get-tree): Skip hierarchical item structure if
> org-imenu-flat is true.
>
> Many of my Org files have deep hierarchies, but few total headings.
> For those files, I find that navigating a flat menu structure is more
> effective than navigating many nested menus.
>
> A flat imenu structure also works well with packages, such as idomenu,
> which navigate imenu items via search.

Thank you. However, you don't need to patch Org to have this. Just set
`imenu-create-index-function' to your liking.

Regards,

-- 
Nicolas Goaziou



Re: [O] [OT] org-mode bindings in markdown-mode?

2018-04-15 Thread Matt Price
Thanks to both of you. I guess I will add some bindings, maybe in the form
of a light minor mode.  Unfortunately the markdown mode fun tions just
srent nearly as powerful as the org mode ones, but a little bit if improved
muscle memory will be better than nothing I guess.

On Fri, Apr 13, 2018, 10:48 AM John Kitchin  wrote:

> I think lentic is the wrong tool for this. I think it is most useful with
> mixed markups, e.g. code in some language, and comments in org/md/...
>
> Your best solution in md is probably to create your own key-bindings that
> are similar to what you use in org-mode, but that use functions from
> https://jblevins.org/projects/markdown-mode/ to get something kind of
> close.
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Fri, Apr 13, 2018 at 7:38 AM, Marcin Borkowski  wrote:
>
>>
>> On 2018-04-13, at 15:14, Matt Price  wrote:
>>
>> > Hi eveyrone,
>> >
>> > I'm using markdown more and more in collaborative projects (sigh). I am
>> > getting used to the syntax but it drives me crazy not to be able to edit
>> > document structure with commands like C-return,, M-return, etc.  Does
>> > anyone have a solution for this that works with recent versions of org?
>> I'm
>> > not up to date on the current status of various projects to extend org
>> > bindings outside of org.
>>
>> Just wondering whether the lentic mode
>> (https://github.com/phillord/lentic) with an org->md transformation
>> could help.  (I haven't yet used lentic, so I might be competely wrong.)
>>
>> I'm CC'ing Phillip, who is the right person to comment on this idea.
>>
>> Best,
>>
>> --
>> Marcin Borkowski
>> http://mbork.pl
>>
>>
>


[O] [PATCH] ob-clojure-literate remove dependency on dash

2018-04-15 Thread stardiviner
From 0edc3d8f2b6fe4a99e11286efe7eb49dc3596cbe Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sun, 15 Apr 2018 19:40:12 +0800
Subject: [PATCH] * ob-clojure-literate.el: remove dash dependence.

---
 contrib/lisp/ob-clojure-literate.el | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/contrib/lisp/ob-clojure-literate.el b/contrib/lisp/ob-clojure-literate.el
index 5dec2ad9b..15b0e3745 100644
--- a/contrib/lisp/ob-clojure-literate.el
+++ b/contrib/lisp/ob-clojure-literate.el
@@ -21,7 +21,6 @@

 (require 'ob-clojure)
 (require 'cider)
-(require 'dash)
 
 (defgroup ob-clojure-literate nil
   "Clojure's Org-mode Literate Programming."
@@ -63,17 +62,17 @@ If it is a directory, `ob-clojure-literate' will try to create Clojure project a
 
 (defun ob-clojure-literate-get-session-list ()
   "Return a list of available started CIDER REPL sessions list."
-  (-map 'buffer-name
-	;; for multiple connections case.
-	;; get global value instead of buffer local.
-	(default-value 'cider-connections)
-	))
+  (mapcar 'buffer-name
+	  ;; for multiple connections case.
+	  ;; get global value instead of buffer local.
+	  (default-value 'cider-connections)
+	  ))
 
 (defun ob-clojure-literate-set-session ()
   "Set session name for buffer local."
   ;; if default session is the only one in connections list.
   (if (and (= (length (ob-clojure-literate-get-session-list)) 1)
-   (-contains-p (ob-clojure-literate-get-session-list) ob-clojure-literate-default-session))
+   (member ob-clojure-literate-default-session (ob-clojure-literate-get-session-list)))
   (setq-local ob-clojure-literate-session ob-clojure-literate-default-session)
 ;; if have any connections, choose one from them.
 (if (ob-clojure-literate-any-connection-p)
@@ -129,7 +128,7 @@ If it is a directory, `ob-clojure-literate' will try to create Clojure project a
  (not (null ob-clojure-literate-session)))
   ;; return back to original file.
   (if (not (and (= (length (ob-clojure-literate-get-session-list)) 1)
-(-contains-p (ob-clojure-literate-get-session-list) ob-clojure-literate-default-session)))
+(member ob-clojure-literate-default-session (ob-clojure-literate-get-session-list
   (save-window-excursion
 (find-file (expand-file-name (concat ob-clojure-literate-project-location "ob-clojure/src/ob_clojure/core.clj")))
 (with-current-buffer "core.clj"
@@ -149,7 +148,7 @@ If it is a directory, `ob-clojure-literate' will try to create Clojure project a
 ;; Empty all CIDER connections to avoid `cider-current-connection' return any connection.
 ;; FIXME: when try to enable, `cider-connections' is local and nil.
 ;; (if (and (= (length (ob-clojure-literate-get-session-list)) 1)
-;;  (-contains-p (ob-clojure-literate-get-session-list) ob-clojure-literate-default-session)))
+;;  (member ob-clojure-literate-default-session (ob-clojure-literate-get-session-list
 ;; (unless (local-variable-if-set-p 'cider-connections)
 ;;   (make-local-variable 'cider-connections))
 ;; (setq-local cider-connections '())
-- 
2.17.0


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


signature.asc
Description: PGP signature


Re: [O] 3 manuals fail to export to PO (gnus, idlwave, org)

2018-04-15 Thread Eli Zaretskii
> From: Jean-Christophe Helary 
> Date: Sun, 15 Apr 2018 21:33:18 +0900
> 
> 3 manuals distributed with emacs fail to export to po format when using the 
> following command:
> 
> po4a-gettextize -f texinfo -M utf8 -m name.texi -p name.texi.fr.po
> 
> gnus.texi
> 
> Use of uninitialized value $newfilepath in string eq at 
> /opt/local/lib/perl5/5.24/Locale/Po4a/TeX.pm line 961.
> po4a::tex: Can't find gnus.texi with kpsewhich

I don't understand what this error message means, in terms of the
Texinfo sources.  Can you explain, please?  Taken at face value, it
looks like a bug in TeX.pm, whereby a variable is not initialized.

> idlwave.texi
> 
> idlwave.texi:370: (po4a::tex)
> unmatched end of environment 'html'
> idlwave.texi:1242: (po4a::tex)
> unmatched end of environment 'html'
> idlwave.texi:2964: (po4a::tex)
> unmatched end of environment 'html'
> idlwave.texi:3101: (po4a::tex)
> unmatched end of environment 'html'
> idlwave.texi:3497: (po4a::tex)
> unmatched end of environment 'html'
> idlwave.texi:3559: (po4a::tex)
> unmatched end of environment 'html'
> idlwave.texi:4021: (po4a::tex)
> unmatched end of environment 'html'
> idlwave.texi:4078: (po4a::tex)
> unmatched end of environment 'html'

These all seem bogus, because the source looks correct to me.  Here's
the first instance:

  @html
  
  @end html

I see nothing wrong here; do you?

(Maybe you are using an old version of the manual; I looked in what's
currently on the emacs-26 branch of the Emacs Git repository.)

> idlwave.texi:4088: (po4a::tex)
> un-balanced { in 'Whenever an IDL error occurs or a breakpoint is hit, I get'

Nothing wrong here, either:

  @enumerate

  @item @strong{Whenever an IDL error occurs or a breakpoint is hit, I get
  errors or strange behavior when I try to type anything into some of my
  IDLWAVE buffers.}

The Texinfo manual says it's okay to have multi-line text after @item:

 Write the text of the enumerated list in the same way as an itemized
  list: write a line starting with '@item' at the beginning of each item
  in the enumeration.  It is ok to have text following the '@item', and
  the text for an item can continue for several paragraphs.

Looks like po4a doesn't support this feature of the Texinfo language?

> org.texi
> 
> perl just keeps churning data without outputting anything.

Hard to do anything with this, without more diagnostic data.

> A number of other manuals output errors but are properly exported to po:

These looks bogus as well.  E.g.:

> cmdargs.texi:726: (po4a::tex)
> unmatched end of environment 'vtable'

There's a matching "@vtable @env" on line 674.

So I submit these problems are bugs in po4a, and the Emacs manuals are
OK.

Thanks.



Re: [O] [PATCH] make tags fast selection popup narrower

2018-04-15 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> Here is the patch:
>
> From 7fc28443484f7b8c701d7c076f1c9c4e389651e7 Mon Sep 17 00:00:00 2001
> From: stardiviner 
> Date: Sun, 15 Apr 2018 17:41:44 +0800
> Subject: [PATCH] * org.el: make fast tags selection popup narrower to look
>  better.

Beauty lies in the eye of the beholder, yet, I don't find it to be an
improvement. It breaks the column alignment in most cases. Until we find
a more sensible display, we should preserve that vertical alignment.

Your problem stems from the special characters your are using, e.g.,
"\200". We may need a pixel based alignment to fix that.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] make tags fast selection popup narrower

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


Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> Here is the patch:
>>
>> From 7fc28443484f7b8c701d7c076f1c9c4e389651e7 Mon Sep 17 00:00:00 2001
>> From: stardiviner 
>> Date: Sun, 15 Apr 2018 17:41:44 +0800
>> Subject: [PATCH] * org.el: make fast tags selection popup narrower to look
>>  better.
>
> Beauty lies in the eye of the beholder, yet, I don't find it to be an
> improvement. It breaks the column alignment in most cases. Until we find
> a more sensible display, we should preserve that vertical alignment.
>
> Your problem stems from the special characters your are using, e.g.,
> "\200". We may need a pixel based alignment to fix that.
>
> Regards,

You're right. I will check it out.

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

iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrTdiUACgkQG13xyVro
msMtgQgAvUt33xP3QWAWdmDjl/nzgNd6ENH7lF9dL9HsIbebh5FpYc89TcEGznFq
TxljK1G/CJhLzZs+jc93JdRE8B2lrphEUGd3LyxsrFaRW7tB0Xwc+0QAgxrXmEWv
+5nAj+xo4hEcuLFDneco3qn9ouq+hOYBsC03bmKBuDvriO25uHPfzop7yPGcEwDc
CkzB8AeRscSGByfaccl7RMQoYcrOZhljQG9ls7ofvTtcCeOghV/W4YZv3RQ9FlPB
XhGwOHfrZ04CgEGjnOhTAMpDwq0oMNFsBIPFU0SlfMy+OlB/QudOy8GUtT1ms7TM
69KGeOVcEsiYkjuxD3O5JdKypVZwQw==
=60nf
-END PGP SIGNATURE-



Re: [O] [PATCH] org-capture: Add a custom to control save target file or not.

2018-04-15 Thread tumashu









At 2018-04-14 17:42:27, "tumashu"  wrote:
>
>
>
>
>
>
>
>
>
>
>At 2018-04-14 15:44:00, "Nicolas Goaziou"  wrote:
>>Hello,
>>
>>tumashu   writes:
>>
>>> I do not know why must save-buffer, may be for  information safe :-)
>>
>>If there is no objection, I suggest to simply remove this call to
>>`save-buffer' instead of introducing a new variable.
>>
>
>Agree this idea,  If user want to save-buffer when capture finish, they can
>add save-buffer to org-capture-after-finalize-hook  or just type C-x C-s
>
>>Regards,
>>
>>-- 
>>Nicolas Goaziou0x80A93738


0001-org-capture-Do-not-save-buffer-when-run-org-capture-.patch
Description: Binary data