Re: [PATCH] improve ol-man.el with occur searching

2020-08-31 Thread numbch...@gmail.com
Hi, Nicolas, gentle ping about this patch.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Mon, Aug 17, 2020 at 11:22 AM numbch...@gmail.com 
wrote:

> Thanks for reviewing my code and points. :)
> Fixed in this attached patch.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
>
> On Sun, Aug 16, 2020 at 5:54 PM Nicolas Goaziou 
> wrote:
>
>> Hello,
>>
>> "numbch...@gmail.com"  writes:
>>
>> > With this patch, ol-man.el link type can be a link like this:
>> > ```org
>> > [[man:grep::--extended-regexp][grep --extended-regexp]]
>> > ```
>> > Occur will auto search "--extended-regexp" string in man page buffer.
>>
>> Thanks.
>>
>> > +PATH should be a topic that can be thrown at the man command.
>> > +If PATH contains extra ::STRING which will use `occur' to search
>> > +matched strings in man buffer."
>>
>> > +  (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)
>> > +  (let* ((command (match-string 1 path))
>> > +  (search (match-string 2 path)))
>> > +(funcall org-man-command command)
>> > +(with-current-buffer (concat "*Man " command "*")
>>
>> This should only be called if search is non-empty.
>>
>> > +  (occur search
>>
>> Why occur? Org uses `search-forward' for [[foo.org::text]] text links,
>> and uses `occur' with [[foo.org::/text/]] links.
>>
>> Wouldn't it be more idiomatic to use a regular text search here?
>>
>> Regards,
>> --
>> Nicolas Goaziou
>>
>


[Feature Request] let Org Mode support multiple running clocking instances

2020-08-23 Thread numbch...@gmail.com
I have some situations, need to run multiple clocking to mark different
headline tasks. I remember there is one exist question thread already, but
I can't find it after search in archive. So I propose this feature again
here.

Hope Org Mode can implement it. WDYT?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[SOLVED] Re: [PROBLEM] The commit "e1f09607e0" caused org-mode inline image preview try to convert PDF file link

2020-08-22 Thread numbch...@gmail.com
Thanks Lars. I will wait for new update in Emacs source code, then
re-compile Emacs.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sat, Aug 22, 2020 at 9:03 PM Lars Ingebrigtsen  wrote:

> "numbch...@gmail.com"  writes:
>
> > The commit "e1f09607e0" caused this problem. I confirmed by git
> > checkout a commit before it. And re-eval source code, then the problem
> > is gone. This is because the commit added
> > ~image-converter-file-name-extensions~ in image-convert.el library
> > which includes "pdf" file extension. It uses command "gs" to convert
> > pdf to image which use 100% of CPU.
>
> I think image-converter.el should have a list of types that it shouldn't
> attempt to convert, even if the backend says that it can.  PDF/PS are
> obvious things -- they aren't images, but imagemagick will offer to
> display them anyway.
>
> I'll add that to Emacs 28.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>bloggy blog: http://lars.ingebrigtsen.no
>


[SOLVED] Re: [BUG] The latest commit "f4687993c53a5339e" caused inline image preview try to convert PDF file link

2020-08-17 Thread numbch...@gmail.com
Aha, I checkout that commit again, indeed, pdf exist before. Weird, When I
revert this commit. The issue is gone. This is weird. Do you have same
problem?

Hmm, I tried to pull again, Now with the latest commit. The problem is
gone. I guess I must messed something up when I debug org-link-beautify.
Anyway, It's my fault, I have not confirmed this bug before minimal emacs
config. Sorry about that. Nicolas.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Mon, Aug 17, 2020 at 2:15 PM Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > The latest commit "f4687993c53a5339e" added "pdf" file type into inline
> > image rules.
>
> No, it doesn't. "pdf" was already in the list before this commit.
>
> > This caused org-toggle-inline-image try to convert large PDF
> > into png images. Caused very long time suspend.
>
> You can customize the variable and remove "pdf".
>
> Regards,
> --
> Nicolas Goaziou
>


Re: [PATCH] improve ol-man.el with occur searching

2020-08-16 Thread numbch...@gmail.com
Thanks for reviewing my code and points. :)
Fixed in this attached patch.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sun, Aug 16, 2020 at 5:54 PM Nicolas Goaziou 
wrote:

> Hello,
>
> "numbch...@gmail.com"  writes:
>
> > With this patch, ol-man.el link type can be a link like this:
> > ```org
> > [[man:grep::--extended-regexp][grep --extended-regexp]]
> > ```
> > Occur will auto search "--extended-regexp" string in man page buffer.
>
> Thanks.
>
> > +PATH should be a topic that can be thrown at the man command.
> > +If PATH contains extra ::STRING which will use `occur' to search
> > +matched strings in man buffer."
>
> > +  (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)
> > +  (let* ((command (match-string 1 path))
> > +  (search (match-string 2 path)))
> > +(funcall org-man-command command)
> > +(with-current-buffer (concat "*Man " command "*")
>
> This should only be called if search is non-empty.
>
> > +  (occur search
>
> Why occur? Org uses `search-forward' for [[foo.org::text]] text links,
> and uses `occur' with [[foo.org::/text/]] links.
>
> Wouldn't it be more idiomatic to use a regular text search here?
>
> Regards,
> --
> Nicolas Goaziou
>
From 73b9e6d8e229f46b9d95f666f0bfb1c2a7e3c0af Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 14 Aug 2020 12:37:42 +0800
Subject: [PATCH] ol-man.el: Add searching support in man page buffer

* contrib/lisp/ol-man.el (org-man-open): Support auto searching man page
buffer with search-forward.
---
 contrib/lisp/ol-man.el | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/ol-man.el b/contrib/lisp/ol-man.el
index 5cb7e0155..b21ed9eba 100644
--- a/contrib/lisp/ol-man.el
+++ b/contrib/lisp/ol-man.el
@@ -37,8 +37,17 @@ (defcustom org-man-command 'man
 
 (defun org-man-open (path _)
   "Visit the manpage on PATH.
-PATH should be a topic that can be thrown at the man command."
-  (funcall org-man-command path))
+PATH should be a topic that can be thrown at the man command.
+If PATH contains extra ::STRING which will use `occur' to search
+matched strings in man buffer."
+  (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)
+  (let* ((command (match-string 1 path))
+	 (search (match-string 2 path)))
+(funcall org-man-command command)
+(when search
+  (with-current-buffer (concat "*Man " command "*")
+	(goto-char (point-min))
+	(search-forward search)
 
 (defun org-man-store-link ()
   "Store a link to a README file."
-- 
2.27.0



Re: How to detect current in logbook drawer?

2020-08-16 Thread numbch...@gmail.com
Now I added `save-match-data` in my org-link-beautify. Thanks for tips.

Indeed. I will try this problem later and update here if got any news.

At last, thanks for your helping. Really thanks. :)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Mon, Aug 17, 2020 at 9:50 AM Ihor Radchenko  wrote:

> > I reviewed my org-link-beautify (
> > https://github.com/stardiviner/org-link-beautify) source code, I have
> not
> > use any regexp matching. I guess the function
> > `org-link-beautify--get-element` invoked `(org-element-context)` caused
> > this problem or other similar places. But I use `debug-on-entry` on
> > `org-element-context`. Still have not got stoppoint backtrace.
>
> Judging from source code of `org-element-context`, it does modify match
> data. You can probably send a bug (or patch) fixing this. All is needed
> is to wrap the code into `save-match-data`.
>
> For you package, you can simply wrap all the code in `org-link-beautify`
> into (save-match-data ... ).
>
> > And another step `debug-on-entry` on `org-link-beautify`,
> > `org-agenda-finalize`, `org-activate-links`. I have not got a stoppoint
> > backtrace on any of upper functions when org-agenda initializes. This is
> > weird, because I tested to use `debug-on-entry` on `org-agenda`. It can
> > popup a stoppoint backtrace.
>
> Strange. I had no problem with debugging `org-agenda-finalize` on my
> system.
>
> Best,
> Ihor
>
>
> "numbch...@gmail.com"  writes:
>
> > Ihor, thanks for your detailed help.
> > I followed your steps, the `elp` step, I confirmed `org-link-beautify` is
> > invoked and fall into an infinite loop.
> >
> > ```
> > org-link-beautify  11265   58.586412984  0.0052007468
> > ```
> >
> > And another step `debug-on-entry` on `org-link-beautify`,
> > `org-agenda-finalize`, `org-activate-links`. I have not got a stoppoint
> > backtrace on any of upper functions when org-agenda initializes. This is
> > weird, because I tested to use `debug-on-entry` on `org-agenda`. It can
> > popup a stoppoint backtrace.
> >
> > I reviewed my org-link-beautify (
> > https://github.com/stardiviner/org-link-beautify) source code, I have
> not
> > use any regexp matching. I guess the function
> > `org-link-beautify--get-element` invoked `(org-element-context)` caused
> > this problem or other similar places. But I use `debug-on-entry` on
> > `org-element-context`. Still have not got stoppoint backtrace.
> >
> > Need your more help. Sorry for disturbing you
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> >
> > On Sun, Aug 16, 2020 at 2:39 PM Ihor Radchenko 
> wrote:
> >
> >> > Your suggestion is very useful, I can see what function is invoked
> many
> >> > times. But still can't understand what's the cause.
> >>
> >> Looking at your CPU profiler report I can see that the slow part is
> >> happening while running org-agenda-finalize when agenda buffer is
> >> already populated. Most of time is taken by calling your function. I
> >> suspect that it is simply called many times (maybe infinite loop?).
> >>
> >> You may check the number of times your function is called using
> >>
> >> (require 'elp)
> >> (elp-instrument-function #'org-link-beautify)
> >> ;; run agenda
> >> ;; M-x elp-results
> >>
> >> Another suggestion would be invoking debug-on-entry for you function,
> >> for org-activate-links, and for org-agenda-finalize.
> >>
> >> Best,
> >> Ihor
> >>
> >>
> >>
> >>
> >> "numbch...@gmail.com"  writes:
> >>
> >> > I tried use debug-on-entry on:
> >> >   + org-agenda-list(nil)
> >> > - org-agenda-mode()
> >> >   + org-agenda-set-mode-name()
> >> > - org-update-dblock
> >> >   + org-dblock-write:clocktable
> >> >
> >> > But got no lucky, Then I followed your another suggestion, use
> profiler:
> >> >
> >> > I got a very big message log, (not suitable for paste in email, so I
> >> paste
> >> > it on Gist)
> >> >
&g

[BUG] The latest commit "f4687993c53a5339e" caused inline image preview try to convert PDF file link

2020-08-16 Thread numbch...@gmail.com
RT.

The latest commit "f4687993c53a5339e" added "pdf" file type into inline
image rules. This caused org-toggle-inline-image try to convert large PDF
into png images. Caused very long time suspend.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: How to detect current in logbook drawer?

2020-08-16 Thread numbch...@gmail.com
I figured an temporary workaround solution:

Use `(unless (memq major-mode org-link-beautify-exclude-modes) ...` in
`org-link-beautify` function to exclude `org-agenda-mode`.

But I still wonder what caused this problem.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Mon, Aug 17, 2020 at 8:38 AM numbch...@gmail.com 
wrote:

> Ihor, thanks for your detailed help.
> I followed your steps, the `elp` step, I confirmed `org-link-beautify` is
> invoked and fall into an infinite loop.
>
> ```
> org-link-beautify  11265   58.586412984  0.0052007468
> ```
>
> And another step `debug-on-entry` on `org-link-beautify`,
> `org-agenda-finalize`, `org-activate-links`. I have not got a stoppoint
> backtrace on any of upper functions when org-agenda initializes. This is
> weird, because I tested to use `debug-on-entry` on `org-agenda`. It can
> popup a stoppoint backtrace.
>
> I reviewed my org-link-beautify (
> https://github.com/stardiviner/org-link-beautify) source code, I have not
> use any regexp matching. I guess the function
> `org-link-beautify--get-element` invoked `(org-element-context)` caused
> this problem or other similar places. But I use `debug-on-entry` on
> `org-element-context`. Still have not got stoppoint backtrace.
>
> Need your more help. Sorry for disturbing you
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
>
> On Sun, Aug 16, 2020 at 2:39 PM Ihor Radchenko  wrote:
>
>> > Your suggestion is very useful, I can see what function is invoked many
>> > times. But still can't understand what's the cause.
>>
>> Looking at your CPU profiler report I can see that the slow part is
>> happening while running org-agenda-finalize when agenda buffer is
>> already populated. Most of time is taken by calling your function. I
>> suspect that it is simply called many times (maybe infinite loop?).
>>
>> You may check the number of times your function is called using
>>
>> (require 'elp)
>> (elp-instrument-function #'org-link-beautify)
>> ;; run agenda
>> ;; M-x elp-results
>>
>> Another suggestion would be invoking debug-on-entry for you function,
>> for org-activate-links, and for org-agenda-finalize.
>>
>> Best,
>> Ihor
>>
>>
>>
>>
>> "numbch...@gmail.com"  writes:
>>
>> > I tried use debug-on-entry on:
>> >   + org-agenda-list(nil)
>> > - org-agenda-mode()
>> >   + org-agenda-set-mode-name()
>> > - org-update-dblock
>> >   + org-dblock-write:clocktable
>> >
>> > But got no lucky, Then I followed your another suggestion, use profiler:
>> >
>> > I got a very big message log, (not suitable for paste in email, so I
>> paste
>> > it on Gist)
>> >
>> > - CPU profiler report: https://www.pastery.net/gststf/
>> > - Memory profiler report: https://www.pastery.net/gststf+qzyxaf/#qzyxaf
>> >
>> > The very deepest call stacks seems the output format is not long
>> enough, so
>> > can't display.
>> >
>> > Your suggestion is very useful, I can see what function is invoked many
>> > times. But still can't understand what's the cause.
>> >
>> > [stardiviner] GPG key ID: 47C32433
>> > IRC(freeenode): stardiviner Twitter:  @numbchild
>> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
>> > Blog: http://stardiviner.github.io/
>> >
>> >
>> > On Sat, Aug 15, 2020 at 2:02 PM Ihor Radchenko 
>> wrote:
>> >
>> >> >Here is the backtrace of "toggle-debug-on-quit" when I refresh
>> org-agenda
>> >> >but has long time suspend.
>> >>
>> >> That looks unreadable for me. Also, debug on quit may not show the
>> >> problematic part depending on your luck.
>> >>
>> >> It would be easier to understand your problem if you provided the
>> >> profiler report (M-x profiler-start ... M-x profiler-report).
>> >> Then, you could debug-on-entry using the problematic part according to
>> >> the profiler report.
>> >>
>> >> A blind guess - maybe you are modifying match data somewhere in your
>> 

Re: How to detect current in logbook drawer?

2020-08-16 Thread numbch...@gmail.com
Ihor, thanks for your detailed help.
I followed your steps, the `elp` step, I confirmed `org-link-beautify` is
invoked and fall into an infinite loop.

```
org-link-beautify  11265   58.586412984  0.0052007468
```

And another step `debug-on-entry` on `org-link-beautify`,
`org-agenda-finalize`, `org-activate-links`. I have not got a stoppoint
backtrace on any of upper functions when org-agenda initializes. This is
weird, because I tested to use `debug-on-entry` on `org-agenda`. It can
popup a stoppoint backtrace.

I reviewed my org-link-beautify (
https://github.com/stardiviner/org-link-beautify) source code, I have not
use any regexp matching. I guess the function
`org-link-beautify--get-element` invoked `(org-element-context)` caused
this problem or other similar places. But I use `debug-on-entry` on
`org-element-context`. Still have not got stoppoint backtrace.

Need your more help. Sorry for disturbing you

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sun, Aug 16, 2020 at 2:39 PM Ihor Radchenko  wrote:

> > Your suggestion is very useful, I can see what function is invoked many
> > times. But still can't understand what's the cause.
>
> Looking at your CPU profiler report I can see that the slow part is
> happening while running org-agenda-finalize when agenda buffer is
> already populated. Most of time is taken by calling your function. I
> suspect that it is simply called many times (maybe infinite loop?).
>
> You may check the number of times your function is called using
>
> (require 'elp)
> (elp-instrument-function #'org-link-beautify)
> ;; run agenda
> ;; M-x elp-results
>
> Another suggestion would be invoking debug-on-entry for you function,
> for org-activate-links, and for org-agenda-finalize.
>
> Best,
> Ihor
>
>
>
>
> "numbch...@gmail.com"  writes:
>
> > I tried use debug-on-entry on:
> >   + org-agenda-list(nil)
> > - org-agenda-mode()
> >   + org-agenda-set-mode-name()
> > - org-update-dblock
> >   + org-dblock-write:clocktable
> >
> > But got no lucky, Then I followed your another suggestion, use profiler:
> >
> > I got a very big message log, (not suitable for paste in email, so I
> paste
> > it on Gist)
> >
> > - CPU profiler report: https://www.pastery.net/gststf/
> > - Memory profiler report: https://www.pastery.net/gststf+qzyxaf/#qzyxaf
> >
> > The very deepest call stacks seems the output format is not long enough,
> so
> > can't display.
> >
> > Your suggestion is very useful, I can see what function is invoked many
> > times. But still can't understand what's the cause.
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> >
> > On Sat, Aug 15, 2020 at 2:02 PM Ihor Radchenko 
> wrote:
> >
> >> >Here is the backtrace of "toggle-debug-on-quit" when I refresh
> org-agenda
> >> >but has long time suspend.
> >>
> >> That looks unreadable for me. Also, debug on quit may not show the
> >> problematic part depending on your luck.
> >>
> >> It would be easier to understand your problem if you provided the
> >> profiler report (M-x profiler-start ... M-x profiler-report).
> >> Then, you could debug-on-entry using the problematic part according to
> >> the profiler report.
> >>
> >> A blind guess - maybe you are modifying match data somewhere in your
> >> code. This might cause infinite loop in
> >>
> >> > (while (org-activate-links (point-max)) (goto-char (match-end 0)))
> >>
> >> Best,
> >> Ihor
> >>
> >> "numbch...@gmail.com"  writes:
> >>
> >> > Thanks for replying, Ihor. I will look into this regexp.
> >> >
> >> > Here is the backtrace of "toggle-debug-on-quit" when I refresh
> org-agenda
> >> > but has long time suspend.
> >> >
> >> > ```
> >> > Debugger entered--Lisp error: (quit)
> >> >
> >> >
> >>
> re-search-forward("\\(\\[\\[\\(\\(?:[^][\\]\\|\\(?:\\)*[][]\\|+[^][]\\)+..."
> >> > 17651 t)
> >> >   (while (re-search-forward org-link-any-re limit t) (let* ((start
> >> > (match

Re: How to detect current in logbook drawer?

2020-08-15 Thread numbch...@gmail.com
Also I noticed one thing:

 The problem happens on when link (org-link-beautify enabled) is behind "-"
directly:

 #+begin_src org
 ,* headline
   :LOGBOOK:
   CLOCK: [2020-07-23 Thu 22:05]--[2020-07-23 Thu 22:14] =>  0:09
   - [[file:~/Code/Emacs/org-mode/lisp/org-agenda.el::(defcustom
org-agenda-start-with-clockreport-mode
nil][org-agenda-start-with-clockreport-mode]]
   :END:
 #+end_src

 But no problem when preceding content is not link. For example:

 #+begin_src org
 ,* headline
   :LOGBOOK:
   CLOCK: [2020-07-23 Thu 22:05]--[2020-07-23 Thu 22:14] =>  0:09
   - kk
 [[file:~/Code/Emacs/org-mode/lisp/org-agenda.el::(defcustom
org-agenda-start-with-clockreport-mode
nil][org-agenda-start-with-clockreport-mode]]
   :END:
 #+end_src

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sat, Aug 15, 2020 at 2:02 PM Ihor Radchenko  wrote:

> >Here is the backtrace of "toggle-debug-on-quit" when I refresh org-agenda
> >but has long time suspend.
>
> That looks unreadable for me. Also, debug on quit may not show the
> problematic part depending on your luck.
>
> It would be easier to understand your problem if you provided the
> profiler report (M-x profiler-start ... M-x profiler-report).
> Then, you could debug-on-entry using the problematic part according to
> the profiler report.
>
> A blind guess - maybe you are modifying match data somewhere in your
> code. This might cause infinite loop in
>
> > (while (org-activate-links (point-max)) (goto-char (match-end 0)))
>
> Best,
> Ihor
>
> "numbch...@gmail.com"  writes:
>
> > Thanks for replying, Ihor. I will look into this regexp.
> >
> > Here is the backtrace of "toggle-debug-on-quit" when I refresh org-agenda
> > but has long time suspend.
> >
> > ```
> > Debugger entered--Lisp error: (quit)
> >
> >
> re-search-forward("\\(\\[\\[\\(\\(?:[^][\\]\\|\\(?:\\)*[][]\\|+[^][]\\)+..."
> > 17651 t)
> >   (while (re-search-forward org-link-any-re limit t) (let* ((start
> > (match-beginning 0)) (end (match-end 0)) (visible-start (or
> > (match-beginning 3) (match-beginning 2))) (visible-end (or (match-end 3)
> > (match-end 2))) (style (cond ((eq 60 (char-after start)) 'angle) ((eq 91
> > (char-after ...)) 'bracket) (t 'plain (if (and (memq style
> > org-highlight-links) (not (string-match-p org-element-paragraph-separate
> > (match-string 0))) (not (and (eq style 'plain) (let (...) (if ... ...
> > ...) (progn (let* ((link-object (save-excursion ... ...)) (link
> > (org-element-property :raw-link link-object)) (type (org-element-property
> > :type link-object)) (path (org-element-property :path link-object))
> > (properties (list ... ... ... ... ... ... ... ... ... ... ... t)))
> > (org-remove-flyspell-overlays-in start end) (org-rear-nonsticky-at end)
> (if
> > (not (eq ... style)) (add-text-properties start end properties)
> > (remove-text-properties start end '...) (let (...) (add-text-properties
> > start visible-start hidden) (add-text-properties visible-start
> visible-end
> > properties) (add-text-properties visible-end end hidden)
> > (org-rear-nonsticky-at visible-start) (org-rear-nonsticky-at
> visible-end)))
> > (let ((f ...)) (if (functionp f) (progn ...))) (throw :exit t))
> >   (catch :exit (while (re-search-forward org-link-any-re limit t) (let*
> > ((start (match-beginning 0)) (end (match-end 0)) (visible-start (or
> > (match-beginning 3) (match-beginning 2))) (visible-end (or (match-end 3)
> > (match-end 2))) (style (cond ((eq 60 ...) 'angle) ((eq 91 ...) 'bracket)
> (t
> > 'plain (if (and (memq style org-highlight-links) (not (string-match-p
> > org-element-paragraph-separate (match-string 0))) (not (and (eq style
> ...)
> > (let ... ... (progn (let* ((link-object ...) (link ...) (type ...)
> > (path ...) (properties ...)) (org-remove-flyspell-overlays-in start end)
> > (org-rear-nonsticky-at end) (if (not ...) (add-text-properties start end
> > properties) (remove-text-properties start end ...) (let ... ... ... ...
> ...
> > ...)) (let (...) (if ... ...)) (throw :exit t)) nil)
> >   org-activate-links(17651)
> >   (while (org-activate-links (point-max)) (goto-char (match-end 0)))
> >   (save-excursion (while (org-activate-links (point-max)) (goto-char
> > (match-end 0
> >   (save-excursion (goto-char (point-min)) (save-excursion (while
> > (org-activate-links (point-max)) (goto-char (match-end 0 (if (eq
> &g

Re: How to detect current in logbook drawer?

2020-08-15 Thread numbch...@gmail.com
I tried use debug-on-entry on:
  + org-agenda-list(nil)
- org-agenda-mode()
  + org-agenda-set-mode-name()
- org-update-dblock
  + org-dblock-write:clocktable

But got no lucky, Then I followed your another suggestion, use profiler:

I got a very big message log, (not suitable for paste in email, so I paste
it on Gist)

- CPU profiler report: https://www.pastery.net/gststf/
- Memory profiler report: https://www.pastery.net/gststf+qzyxaf/#qzyxaf

The very deepest call stacks seems the output format is not long enough, so
can't display.

Your suggestion is very useful, I can see what function is invoked many
times. But still can't understand what's the cause.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sat, Aug 15, 2020 at 2:02 PM Ihor Radchenko  wrote:

> >Here is the backtrace of "toggle-debug-on-quit" when I refresh org-agenda
> >but has long time suspend.
>
> That looks unreadable for me. Also, debug on quit may not show the
> problematic part depending on your luck.
>
> It would be easier to understand your problem if you provided the
> profiler report (M-x profiler-start ... M-x profiler-report).
> Then, you could debug-on-entry using the problematic part according to
> the profiler report.
>
> A blind guess - maybe you are modifying match data somewhere in your
> code. This might cause infinite loop in
>
> > (while (org-activate-links (point-max)) (goto-char (match-end 0)))
>
> Best,
> Ihor
>
> "numbch...@gmail.com"  writes:
>
> > Thanks for replying, Ihor. I will look into this regexp.
> >
> > Here is the backtrace of "toggle-debug-on-quit" when I refresh org-agenda
> > but has long time suspend.
> >
> > ```
> > Debugger entered--Lisp error: (quit)
> >
> >
> re-search-forward("\\(\\[\\[\\(\\(?:[^][\\]\\|\\(?:\\)*[][]\\|+[^][]\\)+..."
> > 17651 t)
> >   (while (re-search-forward org-link-any-re limit t) (let* ((start
> > (match-beginning 0)) (end (match-end 0)) (visible-start (or
> > (match-beginning 3) (match-beginning 2))) (visible-end (or (match-end 3)
> > (match-end 2))) (style (cond ((eq 60 (char-after start)) 'angle) ((eq 91
> > (char-after ...)) 'bracket) (t 'plain (if (and (memq style
> > org-highlight-links) (not (string-match-p org-element-paragraph-separate
> > (match-string 0))) (not (and (eq style 'plain) (let (...) (if ... ...
> > ...) (progn (let* ((link-object (save-excursion ... ...)) (link
> > (org-element-property :raw-link link-object)) (type (org-element-property
> > :type link-object)) (path (org-element-property :path link-object))
> > (properties (list ... ... ... ... ... ... ... ... ... ... ... t)))
> > (org-remove-flyspell-overlays-in start end) (org-rear-nonsticky-at end)
> (if
> > (not (eq ... style)) (add-text-properties start end properties)
> > (remove-text-properties start end '...) (let (...) (add-text-properties
> > start visible-start hidden) (add-text-properties visible-start
> visible-end
> > properties) (add-text-properties visible-end end hidden)
> > (org-rear-nonsticky-at visible-start) (org-rear-nonsticky-at
> visible-end)))
> > (let ((f ...)) (if (functionp f) (progn ...))) (throw :exit t))
> >   (catch :exit (while (re-search-forward org-link-any-re limit t) (let*
> > ((start (match-beginning 0)) (end (match-end 0)) (visible-start (or
> > (match-beginning 3) (match-beginning 2))) (visible-end (or (match-end 3)
> > (match-end 2))) (style (cond ((eq 60 ...) 'angle) ((eq 91 ...) 'bracket)
> (t
> > 'plain (if (and (memq style org-highlight-links) (not (string-match-p
> > org-element-paragraph-separate (match-string 0))) (not (and (eq style
> ...)
> > (let ... ... (progn (let* ((link-object ...) (link ...) (type ...)
> > (path ...) (properties ...)) (org-remove-flyspell-overlays-in start end)
> > (org-rear-nonsticky-at end) (if (not ...) (add-text-properties start end
> > properties) (remove-text-properties start end ...) (let ... ... ... ...
> ...
> > ...)) (let (...) (if ... ...)) (throw :exit t)) nil)
> >   org-activate-links(17651)
> >   (while (org-activate-links (point-max)) (goto-char (match-end 0)))
> >   (save-excursion (while (org-activate-links (point-max)) (goto-char
> > (match-end 0
> >   (save-excursion (goto-char (point-min)) (save-excursion (while
> > (org-activate-links (point-max)) (goto-char (match-end 0 (if (eq
> > org-agenda-remove-tags t) nil (org-agenda-align-tags)) (if
> &g

Re: How to detect current in logbook drawer?

2020-08-15 Thread numbch...@gmail.com
a-redo-command 'org-series-cmd org-cmd)) (if (eq
org-agenda-show-log-scoped 'clockcheck) (progn
(org-agenda-show-clocking-issues))) (org-agenda-finalize) (setq
buffer-read-only t) (message "")))
  org-agenda-list(nil nil day nil)
  (let nil (org-agenda-list 'nil nil 'day nil))
  eval((let nil (org-agenda-list 'nil nil 'day nil)))
  org-let(nil (org-agenda-list 'nil nil 'day nil))
  (if series-redo-cmd (eval series-redo-cmd) (org-let lprops redo-cmd))
  (let* ((p (or (and (looking-at "\\'") (1- (point))) (point))) (cpa (if
(eq all t) nil current-prefix-arg)) (org-agenda-doing-sticky-redo
org-agenda-sticky) (org-agenda-sticky nil) (org-agenda-buffer-name (or
org-agenda-this-buffer-name org-agenda-buffer-name)) (org-agenda-keep-modes
t) (tag-filter org-agenda-tag-filter) (tag-preset (get
'org-agenda-tag-filter :preset-filter)) (top-hl-filter
org-agenda-top-headline-filter) (cat-filter org-agenda-category-filter)
(cat-preset (get 'org-agenda-category-filter :preset-filter)) (re-filter
org-agenda-regexp-filter) (re-preset (get 'org-agenda-regexp-filter
:preset-filter)) (effort-filter org-agenda-effort-filter) (effort-preset
(get 'org-agenda-effort-filter :preset-filter))
(org-agenda-tag-filter-while-redo (or tag-filter tag-preset)) (cols
org-agenda-columns-active) (line (org-current-line)) (window-line (- line
(org-current-line (window-start (lprops (get 'org-agenda-redo-command
'org-lprops)) (redo-cmd (get-text-property p 'org-redo-cmd)) (last-args
(get-text-property p 'org-last-args)) (org-agenda-overriding-cmd
(get-text-property p 'org-series-cmd)) (org-agenda-overriding-cmd-arguments
(if (eq all t) nil (cond ((listp last-args) (cons (or cpa ...) (cdr
last-args))) ((stringp last-args) last-args (series-redo-cmd
(get-text-property p 'org-series-redo-cmd))) (put 'org-agenda-tag-filter
:preset-filter nil) (put 'org-agenda-category-filter :preset-filter nil)
(put 'org-agenda-regexp-filter :preset-filter nil) (put
'org-agenda-effort-filter :preset-filter nil) (and cols (org-columns-quit))
(message "Rebuilding agenda buffer...") (if series-redo-cmd (eval
series-redo-cmd) (org-let lprops redo-cmd)) (setq org-agenda-undo-list nil
org-agenda-pending-undo-list nil org-agenda-tag-filter tag-filter
org-agenda-category-filter cat-filter org-agenda-regexp-filter re-filter
org-agenda-effort-filter effort-filter org-agenda-top-headline-filter
top-hl-filter) (message "Rebuilding agenda buffer...done") (put
'org-agenda-tag-filter :preset-filter tag-preset) (put
'org-agenda-category-filter :preset-filter cat-preset) (put
'org-agenda-regexp-filter :preset-filter re-preset) (put
'org-agenda-effort-filter :preset-filter effort-preset) (let ((tag (or
tag-filter tag-preset)) (cat (or cat-filter cat-preset)) (effort (or
effort-filter effort-preset)) (re (or re-filter re-preset))) (if tag (progn
(org-agenda-filter-apply tag 'tag t))) (if cat (progn
(org-agenda-filter-apply cat 'category))) (if effort (progn
(org-agenda-filter-apply effort 'effort))) (if re (progn
(org-agenda-filter-apply re 'regexp (and top-hl-filter
(org-agenda-filter-top-headline-apply top-hl-filter)) (and cols
(called-interactively-p 'any) (org-agenda-columns)) (org-goto-line line)
(recenter window-line))
  org-agenda-redo(t)
  (if exhaustive (let ((--dolist-tail-- (buffer-list)) buffer) (while
--dolist-tail-- (setq buffer (car --dolist-tail--)) (save-current-buffer
(set-buffer buffer) (if (derived-mode-p 'org-agenda-mode) (progn
(org-agenda-redo t (setq --dolist-tail-- (cdr --dolist-tail--
(org-agenda-redo t))
  org-agenda-redo-all(nil)
  funcall-interactively(org-agenda-redo-all nil)
  call-interactively(org-agenda-redo-all nil nil)
  command-execute(org-agenda-redo-all)
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Fri, Aug 14, 2020 at 1:15 PM Ihor Radchenko  wrote:

> > I want to get around this problem. So need to know how to detect
> currently
> > in logbook drawer or something else which used to record clocking note,
> > `org-add-note`, etc.
>
> You may try to use `org-logbook-drawer-re'.
>
> > When I toggle org-log-mode and related options in org-agenda buffer. I
> > found my org-link-beautify will caused long time suspend and no stop.
> After
> > debug, I found org-link-beautify text-property caused this problem.
>
> Could you provide more details how your text property is causing the
> problem in org-agenda? Which function in agenda is slow?
>
> Best,
> Ihor
>
>
> "numbch...@gmail.com"  writes:
>
> > I have a org-mode extension:
> >
> https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L71
> >
> > It will beautify links with text-properties.
> >
> > Wh

Re: How to detect current in logbook drawer?

2020-08-15 Thread numbch...@gmail.com
I tried this helper function.

```elisp
(defun org-link-beautify--in-logbook-drawer-p (position)
  "Detect whether point is in Org logbook drawer using
`org-logbook-drawer-re'."
  (and (> (point)
  (save-excursion
(re-search-backward
 (rx (seq bol (0+ (any "\t ")) ":LOGBOOK:" (0+ (any "\t "))
"\n")
   (< (point)
  (save-excursion
(re-search-forward
 (rx (seq bol (0+ (any "\t ")) ":END:" (0+ (any "\t "))
eol)))
```
But it's logic is wrong. I becomes global buffer scope. Is there any better
correct solution?


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Fri, Aug 14, 2020 at 1:15 PM Ihor Radchenko  wrote:

> > I want to get around this problem. So need to know how to detect
> currently
> > in logbook drawer or something else which used to record clocking note,
> > `org-add-note`, etc.
>
> You may try to use `org-logbook-drawer-re'.
>
> > When I toggle org-log-mode and related options in org-agenda buffer. I
> > found my org-link-beautify will caused long time suspend and no stop.
> After
> > debug, I found org-link-beautify text-property caused this problem.
>
> Could you provide more details how your text property is causing the
> problem in org-agenda? Which function in agenda is slow?
>
> Best,
> Ihor
>
>
> "numbch...@gmail.com"  writes:
>
> > I have a org-mode extension:
> >
> https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L71
> >
> > It will beautify links with text-properties.
> >
> > When I toggle org-log-mode and related options in org-agenda buffer. I
> > found my org-link-beautify will caused long time suspend and no stop.
> After
> > debug, I found org-link-beautify text-property caused this problem.
> >
> > I want to get around this problem. So need to know how to detect
> currently
> > in logbook drawer or something else which used to record clocking note,
> > `org-add-note`, etc.
> >
> > Or maybe org-agenda upstream can do something to work around this
> > text-properties issue?
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
>


How to detect current in logbook drawer?

2020-08-13 Thread numbch...@gmail.com
I have a org-mode extension:
https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L71

It will beautify links with text-properties.

When I toggle org-log-mode and related options in org-agenda buffer. I
found my org-link-beautify will caused long time suspend and no stop. After
debug, I found org-link-beautify text-property caused this problem.

I want to get around this problem. So need to know how to detect currently
in logbook drawer or something else which used to record clocking note,
`org-add-note`, etc.

Or maybe org-agenda upstream can do something to work around this
text-properties issue?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[PATCH] improve ol-man.el with occur searching

2020-08-13 Thread numbch...@gmail.com
With this patch, ol-man.el link type can be a link like this:
```org
[[man:grep::--extended-regexp][grep --extended-regexp]]
```
Occur will auto search "--extended-regexp" string in man page buffer.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
From dcb9246ce948ce5d409c4f1e6d3e0ab53ed2ff4d Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 14 Aug 2020 12:33:51 +0800
Subject: [PATCH] ol-man.el: Add occur searching in man page buffer

* contrib/lisp/ol-man.el (org-man-open): Support auto searching man page
buffer with occur.
---
 contrib/lisp/ol-man.el | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/ol-man.el b/contrib/lisp/ol-man.el
index 5cb7e0155..8ad1fabb2 100644
--- a/contrib/lisp/ol-man.el
+++ b/contrib/lisp/ol-man.el
@@ -37,8 +37,15 @@ (defcustom org-man-command 'man
 
 (defun org-man-open (path _)
   "Visit the manpage on PATH.
-PATH should be a topic that can be thrown at the man command."
-  (funcall org-man-command path))
+PATH should be a topic that can be thrown at the man command.
+If PATH contains extra ::STRING which will use `occur' to search
+matched strings in man buffer."
+  (string-match "\\(.*?\\)\\(?:::\\(.*\\)\\)?$" path)
+  (let* ((command (match-string 1 path))
+	 (search (match-string 2 path)))
+(funcall org-man-command command)
+(with-current-buffer (concat "*Man " command "*")
+  (occur search
 
 (defun org-man-store-link ()
   "Store a link to a README file."
-- 
2.27.0



[SOLVED] Re: [Discuss] separate (recenter window-line) out of org-agenda-redo

2020-07-30 Thread numbch...@gmail.com
This is very useful, thanks Marco.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Wed, Jul 29, 2020 at 4:21 AM Marco Wahl  wrote:

> "numbch...@gmail.com"  writes:
>
> > I try to add an idle timer to auto refresh org agenda views.
> >
> > Here is what I code:
> >
> > #+begin_src emacs-lisp
> > ;;; auto refresh `*Org Agenda*' buffer
> > (defun my/org-agenda-auto-refresh ()
> >   "Rebuild all agenda views buffers."
> >   (org-agenda-redo-all t))
> >
> > (run-with-idle-timer (* 60 20) t #'my/org-agenda-auto-refresh)
> > #+end_src
> >
> >
> > But I got error:
> >
> > #+begin_example
> > Error running timer ‘my/org-agenda-auto-refresh’: (error "‘recenter’ing a
> > window that does not display current-buffer.")
> > #+end_example
>
> Coming back to your original issue. Possibly it's enough to just
> suppress the error.
>
> You could change the function to
>
> --8<---cut here---start->8---
>
> (defun my/org-agenda-auto-refresh-1 ()
>   "Rebuild all agenda views buffers."
>   (ignore-errors (org-agenda-redo-all t)))
>
> --8<---cut here---end--->8---
>
>
> HTH,
> --
> Marco
>


[Help needed] Re: [Discuss] separate (recenter window-line) out of org-agenda-redo

2020-07-27 Thread numbch...@gmail.com
The `recenter` is useful for keeping position. I checked docstring of
`recenter`, have no clue how to implement a better solution. I also thinked
about ways like `with-current-buffer` etc. But can get around the
`recenter`.

Does anybody have any idea?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Mon, Jul 27, 2020 at 3:46 PM Marco Wahl  wrote:

> "numbch...@gmail.com"  writes:
>
> [...]
>
> > I dive into source code of ~org-agenda-redo~ function.
> > Found this error is caused by ~(recenter window-line)~.
> >
> > I'm thinking what about to separate this code out? So function
> > ~org-agenda-redo~ can be used to non-interactive usage?
>
> My gut feeling says this is a good idea.
>
> Do you have a concrete implementation yet?
>
>
> Best regards,
> --
> Marco
>
>


[Discuss] separate (recenter window-line) out of org-agenda-redo

2020-07-26 Thread numbch...@gmail.com
I try to add an idle timer to auto refresh org agenda views.

Here is what I code:

#+begin_src emacs-lisp
;;; auto refresh `*Org Agenda*' buffer
(defun my/org-agenda-auto-refresh ()
  "Rebuild all agenda views buffers."
  (org-agenda-redo-all t))

(run-with-idle-timer (* 60 20) t #'my/org-agenda-auto-refresh)
#+end_src

But I got error:

#+begin_example
Error running timer ‘my/org-agenda-auto-refresh’: (error "‘recenter’ing a
window that does not display current-buffer.")
#+end_example

I dive into source code of ~org-agenda-redo~ function.
Found this error is caused by ~(recenter window-line)~.

I'm thinking what about to separate this code out? So function
~org-agenda-redo~ can be used to non-interactive usage?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


How to improve my extension source code don't generate so many timers?

2020-07-17 Thread numbch...@gmail.com
I write an extension org-link-beautify (
https://github.com/stardiviner/org-link-beautify). It use text-property to
display all-the-icons icon for links.
When I use `list-timers`, I found many timers like this:

#+begin_example
1179.80  -#f(compiled-function () # [#
("-1003358868.jpg" :v-adjust 0.01) remhash])
1179.80  -#f(compiled-function () # [#
("1004068059.jpg" :v-adjust 0.01) remhash])
1179.80  -#f(compiled-function () # [#
("-1004540555.jpg" :v-adjust 0.01) remhash])
1179.80  -#f(compiled-function () # [#
("-1010525956.jpg" :v-adjust 0.01) remhash])
1179.80  -#f(compiled-function () # [#
("-1011541969.jpg" :v-adjust 0.01) remhash])
1179.80  -#f(compiled-function () # [#
("1011587546.jpg" :v-adjust 0.01) remhash])
1179.80  -#f(compiled-function () # [#
("1012116218.jpg" :v-adjust 0.01) remhash])
1179.80  -#f(compiled-function () # [#
("1013965598.jpg" :v-adjust 0.01) remhash])
1179.81  -#f(compiled-function () # [#
("-1014809589.jpg" :v-adjust 0.01) remhash])
1179.81  -#f(compiled-function () # [#
("-1017207950.jpg" :v-adjust 0.01) remhash])
1179.81  -#f(compiled-function () # [#
("1018964381.jpg" :v-adjust 0.01) remhash])
1179.81  -#f(compiled-function () # [#
("1019711419.jpg" :v-adjust 0.01) remhash])
1179.81  -#f(compiled-function () # [#
("-1019920854.jpg" :v-adjust 0.01) remhash])
1179.91  -#f(compiled-function () # [#
("-1162442495.jpg" :v-adjust 0.01) remhash])
#+end_example

I'm wandering is there someplace I write wrong in my source code:
https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el

Or maybe this is an mechanism in Org Mode?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [PATCH] Fix ob-python.el initiate session error with py-shell

2020-02-18 Thread numbch...@gmail.com
Yes, Jack, as Bastien said, you can format my commit, because my home
network is broken, I'm using Mobile Phone's 4G network to get online. Can't
get update immediately.
And thanks for tips about `python-mode' is deprecated. I didn't know that.
I will migrate to `python.el'.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Wed, Feb 19, 2020 at 1:18 AM Jack Kamm  wrote:

> Hi stardiviner,
>
> Sorry for the noise, I have some additional comments below:
>
> When I run "make compile", I get the following message:
>
> In org-babel-python-initiate-session-by-key:
> ob-python.el:211:12:Warning: py-shell called with 9 arguments, but accepts
> only 0-1
>
> I think this is because the "(declare-function py-shell)" no longer
> matches the signature of the upstream py-shell function you're using.
>
> Also, I now see that the commit does have a changelog entry, but not a
> commit message. Unless it is standard to take the subject line as the
> commit message? I am still a little new to merging patches from email,
> and might not have all the proper tooling setup for it.
>
> When you update the patch, please mention that this is specifically for
> python-mode.el in the commit message and changelog entry.
>


Re: [O] org-notify dbus send message to KDE/Plasma caused desktop suspend

2019-09-13 Thread numbch...@gmail.com
Yes, my "suspend" means some part of the Plasma UI is freezing and causing
high CPU usage. :)

I will try to reproduce this bug with command `dbus-send`. And file a issue
report to KDE.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Thu, Sep 12, 2019 at 5:52 AM Adam Porter  wrote:

> "numbch...@gmail.com"  writes:
>
> > org-notify dbus send message to KDE/Plasma caused desktop suspend and
> high CPU,memory resources.
> >
> > Here is my config:
> > ```elisp
> > (setq org-notify-audible nil)
> > (org-notify-add 'default
> > '(:time "1h" :period "1h" :duration 8
> > :actions (-ding -notify/window)
> > :audible t))
> > (org-notify-start (* 60 2))
> > ```
> >
> > When I have about 10 deadline tasks to be reminded at once, dbus suspend
> desktop soon because send dbus message too fast?
> >
> > Maybe add a sequence delay to improve this situation?
>
> That workaround might be helpful, but it sounds like a bug somewhere
> else in the Plasma/dbus/etc. stack.  I recommend trying to reproduce it
> with e.g. the notify-send shell command; if you can, you'll know the bug
> isn't with Emacs/Org.
>
> I recommend filing a bug report with KDE, or perhaps with your Linux
> distro as a first step.
>
> By the way, I'm not sure what you mean by "desktop suspend."  The word
> "suspend" is typically used to mean putting the system into a low-power
> sleep state, but I'm guessing you mean that some part of the Plasma UI
> is freezing and causing high CPU usage.
>
>
>


[O] org-notify dbus send message to KDE/Plasma caused desktop suspend

2019-09-10 Thread numbch...@gmail.com
org-notify dbus send message to KDE/Plasma caused desktop suspend and high
CPU,memory resources.

Here is my config:
```elisp
(setq org-notify-audible nil)
(org-notify-add 'default
'(:time "1h" :period "1h" :duration 8
:actions (-ding -notify/window)
:audible t))
(org-notify-start (* 60 2))
```

When I have about 10 deadline tasks to be reminded at once, dbus suspend
desktop soon because send dbus message too fast?

Maybe add a sequence delay to improve this situation?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] ob-clojure can't cross source block handle :var in :noweb source block

2019-08-27 Thread numbch...@gmail.com
I have bellowing example:
```org
#+NAME: read-in-wxid
#+begin_src clojure :var cwd=(file-truename "~/Documents/WeChat/wxid/")
(require '[clojure.java.io :as io])

(def directory (io/file cwd))
(def files (filter #(.isFile %) (file-seq directory)))
#+end_src

#+RESULTS[<2019-08-28 09:12:24> 84a1210d836742ca71c776aaebba0e0224af]:
read-in-wxid
: #'user/files

#+begin_src clojure :noweb yes :results pp
<>
(take 3 files)
#+end_src

#+RESULTS[<2019-08-28 09:12:30> 9bbcd9f779f72bdd9b7bb8fb85aa36bbdfee7e3c]:
: class clojure.lang.Compiler$CompilerExceptionclass
clojure.lang.Compiler$CompilerExceptionSyntax error compiling at (*Org Src
Code.org[ clojure ]*:3:16).
: Unable to resolve symbol: cwd in this context
```

You can see it can't resole first source block's `:var` definition.

I'm using:
- GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8) of
2019-04-13
- Org mode version 9.2.1 (release_9.2.1-274-ge3b7c3.dirty @
/home/stardiviner/Code/Emacs/org-mode/lisp/)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Helm + Org-mode 9.2.5: Problem with org-set-tags

2019-08-13 Thread numbch...@gmail.com
Seems newly added a package which seems is separated from helm.el.

https://github.com/emacs-helm/helm-org

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sun, Aug 11, 2019 at 7:33 AM Nathan Neff  wrote:

> I think I found the problem and have a fix!
>
> Long story short, I modified my helm-completing-read-handlers-alist
> and added an entry:
> (add-to-list 'helm-completing-read-handlers-alist
> `(org-set-tags-command . helm-org-completing-read-tags)
> )
>
> I have all the gory details here:
> https://github.com/emacs-helm/helm/issues/2183
>
> Thanks all for your help, hope this helps someone else too :)
> --Nate
>
>
>
> On Sat, Aug 10, 2019 at 4:01 PM Nathan Neff  wrote:
>
>>
>>
>> On Sat, Aug 10, 2019 at 3:44 PM Nathan Neff 
>> wrote:
>>
>>> Hello all,
>>>
>>> I created a VM, installed Emacs 26.2 fresh, and installed various
>>> versions
>>> of org-mode using the tar.gz files from https://orgmode.org/
>>>
>>> I replaced org-mode in /usr/share/emacs/26.2/lisp/org with various older
>>> versions until I found the version of org-mode that breaks the helm tags
>>> completion.
>>>
>>> I found that the latest version of org where the feature works is
>>> Org-mode version 9.1.9.
>>>
>>
>> Oops - my aplogies - I assumed that the org-versions stopped at 9.1.9.  I
>> tested Org 9.1.14 which (to
>> my knowledge) is the last of the 9.1.X versions, and Org 9.1.14 works
>> correctly.
>>
>> I tested Org version 9.2 and Org version 9.2 is the version that breaks
>> the tags functionality
>> from Helm.
>>
>>
>>
>>> I will spelunk around in the code to see what might have changed the
>>> behavior - if anyone has
>>> suggestions or doesn't have this problem with an older version of org,
>>> please let me know - it could
>>> easily be something that I have set incorrectly.
>>>
>>> Thanks,
>>> --Nate
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Aug 9, 2019 at 4:28 PM Nathan Neff 
>>> wrote:
>>>
 Hello all,

 I'm hitting this problem with Org-mode 9.2.5:
 https://groups.google.com/forum/#!topic/emacs-helm/tA6cn6TUdRY

 Problem synopsis:  When I use org-set-tags on a heading
 with no tags, Helm gives me the correct prompt w/a list of all my tags.
 After I have entered a single tag, then no more Helm suggestions are
 offered.  This is the bug, and it was fixed at some point.

 Helm + org-mode *work correctly* when I run emacs using
 the elpa/helm-20190726/emacs-helm.sh script which comes with Helm
 for debugging purposes.  I notice that the org-version in the *working*
 example
 is 9.1.9 (which is, I presume) the stock org-mode that comes with Emacs.

 I have reproduced this problem on both Linux and OSX.

 Can anyone suggest a next step to take?

 Thanks,
 --Nate




Re: [O] coderef link should support external file path link.

2018-08-24 Thread numbch...@gmail.com
Maybe I forgot it. Could be another suggestion because I have not found it
in my recorded issues. (addded it now)
Hmm. Recently I don't have time to check it out. If I got time to do this,
I will update it here. It's not urgent, if you don't have time too, leave
it opened is fine.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Wed, Aug 22, 2018 at 8:46 PM Nicolas Goaziou 
wrote:

> Hello,
>
> stardiviner  writes:
>
> > When I use ~org-store-link~ in an opened src block to create a coderef
> > link, then I ~org-insert-link-global~ in another Org file, but it only
> > has "~(use formdata to send url with params)~" in link source (without
> > file path). It should contains the source file path like following. (I
> > have to manually fix this long path to make it work correctly).
> >
> > #+begin_src org
> >
> [[file:~/Org/Wiki/Web%20Scraping.org::(use%20formdata%20to%20send%20url%20with%20params)][use
> formdata to send url with params]]
> > #+end_src
>
> You suggested the very same idea some time ago. I answered I was open to
> patches in this direction. Do you feel like implementing it?
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] buffer-file-name in [* Org src *] buffers

2018-03-11 Thread numbch...@gmail.com
I agree, should compatible with situations like `flycheck` need to use
buffer-file-name.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Mar 12, 2018 at 6:56 AM, Clément Pit-Claudel 
wrote:

> Hi all,
>
> TL;DR: why does org-src-mode-configure-edit-buffer set buffer-file-name
> to a non-nil value?  https://code.orgmode.org/bzg/org-mode/commit/
> 4b6988bf36cb458c9d113ee4332e016990c1eb04#diff-
> ea848b037ba2c0bf95915700bb6f4e539d80d8cR486
>
> Background information: I'm reviewing a patch (
> https://github.com/flycheck/flycheck/pull/1426) to enable Flycheck in
> temporary buffers created by org-mode while editing a code snippet with
> org-edit-src-code (among others).  The patch teaches Flycheck to append an
> checker-appropriate extension to the temporary files that it creates: for
> example, when editing a Python snippet from an Org file, Flycheck would now
> create a file named /tmp/.py instead of /tmp/
> (which would make Python happy).
>
> We're thinking of enabling this automatic suffix addition behavior only
> for buffers that do not have a buffer-file-name currently set (in the ones
> that do, Flycheck already derives file names for its temporary files from
> the buffer's  file name), but we were surprised to find that [* Org src *]
> actually have a buffer-file-name.
>
> Why is that?
>
> Thanks,
> Clément.
>
>
>
>


[O] [ORG] [FEATURE] ob-js.el support :session for all existing JS packages

2018-03-10 Thread numbch...@gmail.com
After add more code, not it supports `js-comint`, `skewer-mode`, `Indium`.

Waited many days, still no response. Anyone want to review this code?

Recently view Org-mode mailing list, many threads has response. Why my post
does not have any response?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Mar 8, 2018 at 5:41 PM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> ​I pushed code at this branch:
> ​
> https://code.orgmode.org/stardiviner/org-mode/src/ob-js-skewer
>
> Hope someone can review it. and merge it.
> (I found https://code.orgmode.org/ does not have the create PR button
> now. Is it disabled?)
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>


[O] [FEATURE] ob-js.el support :session with skewer-mode

2018-03-08 Thread numbch...@gmail.com
​I pushed code at this branch:
​
https://code.orgmode.org/stardiviner/org-mode/src/ob-js-skewer

Hope someone can review it. and merge it.
(I found https://code.orgmode.org/ does not have the create PR button now.
Is it disabled?)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] org-babel-execute-src-block does not insert inline image with `master` branch source code Org

2018-03-05 Thread numbch...@gmail.com
After `git bisect`, found that commit 122bf2997 caused this problem.
@Nicolas, can you fix this commit?


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Mar 4, 2018 at 9:54 PM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> With following example:
> ```
> #+begin_src gnuplot :session :results graphics :file "data/images/sin.png"
> :cache no
> set term png
> set grid
> plot sin(x), cos(x)
> #+end_src
> ```
> If I use Org-mode ELPA version. then it works fine.
> But when I use `master` branch version, then it does not have any result.
> Tried to check out git log of recently commits, and `ob-core.el` file
> recent git log commits, and `ob-gnuplot.el`'s. But does not found any
> suspicious commits yet.
>
> Environment info:
> - Arch Linux
> - Emacs version: GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+
> Version 3.22.26) of 2018-02-10
> - Org-mode version: Org mode version 9.1.7 (9.1.7-elpaplus @ mixed
> installation! /home/stardiviner/.emacs.d/elpa/org-plus-contrib-20180226/
> and /home/stardiviner/Code/Emacs/org-mode/lisp/)
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>


[O] org-babel-execute-src-block does not insert inline image with `master` branch source code Org

2018-03-04 Thread numbch...@gmail.com
With following example:
```
#+begin_src gnuplot :session :results graphics :file "data/images/sin.png"
:cache no
set term png
set grid
plot sin(x), cos(x)
#+end_src
```
If I use Org-mode ELPA version. then it works fine.
But when I use `master` branch version, then it does not have any result.
Tried to check out git log of recently commits, and `ob-core.el` file
recent git log commits, and `ob-gnuplot.el`'s. But does not found any
suspicious commits yet.

Environment info:
- Arch Linux
- Emacs version: GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+
Version 3.22.26) of 2018-02-10
- Org-mode version: Org mode version 9.1.7 (9.1.7-elpaplus @ mixed
installation! /home/stardiviner/.emacs.d/elpa/org-plus-contrib-20180226/
and /home/stardiviner/Code/Emacs/org-mode/lisp/)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Bug: [ob-clojure] Surprising evaluation result [9.1.6 (release_9.1.6-491-g70b029 @ /Users/xcy/src/org-mode/lisp/)]

2018-03-02 Thread numbch...@gmail.com
No, it's not expected result. It should be caused by my commit here
https://code.orgmode.org/bzg/org-mode/pulls/5
Don't know how to workaround this.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Mar 1, 2018 at 11:50 PM, Xu Chunyang  wrote:

> Hello all,
>
> I run the following Clojure code with CIDER as the backend. The result
> is surprising to me:
>
> #+begin_src clojure
> (* 6 7)
> (= nil ())
> #+end_src
>
> #+RESULTS:
> : 42false
>
> As you can see, the result is the concatenation of the value of each
> expression. Is it expected? I would like to get only the value of the
> last expression, i.e., false.
>
>
> --
> Org   release_9.1.7-440-g5e8fa1361
> CIDER v0.16.0-83-g88f4fcf
> Emacs 27.0.50
>
>


[O] How to pass `format` result string to org-babel-execute:clojure function?

2018-02-14 Thread numbch...@gmail.com
I try add advice as I posted at here
https://emacs.stackexchange.com/questions/38818/how-to-write-this-advice-for-inject-code-into-let-binding

And here is my final code (some lines commented out for easy debug):

```elisp

;;; Support header arguments  :results file :file "image.png"
(defun ob-clojure-literate-inject-code (args)
  "Inject Clojure code into `BODY' in `ARGS'.

This can be used as :filter-args advice of `org-babel-expand-body:clojure'.
It is used to change Clojure currently working directory and generate
graphics image file result."
  (let* ((body (nth 0 args))
 (params (nth 1 args))
 (dir (cdr (assq :dir params)))
 (default-directory (and (buffer-file-name) (file-name-directory
(buffer-file-name
 (directory (and dir (file-name-as-directory (expand-file-name
dir
 (result-type (cdr (assq :results params)))
 (out-file (cdr (assq :file params)))
 (add-to-body (lambda (code)
(setq body (concat code "\n" body
 (append-to-body (lambda (code)
   (setq body (concat body "\n" code
 )
(unless (file-directory-p (expand-file-name directory))
  (warn (format "ob-clojure-literate directory %s does not exist,
please create it." dir)))
;; (when directory
;;   (funcall add-to-body (format "(System/setProperty \"user.dir\"
\"%s\")" directory)))
(when (string-match-p (regexp-opt '("graphics" "file")) result-type)
  ;; (member "graphics" (cdr (assq :result-params params)))
  ;; (funcall add-to-body "(import 'java.io.FileOutputStream)")
  ;; use static global variable `ob-clojure-literate-incanter-plot' as
convention.
  ;; (funcall append-to-body
  ;;(format "(def ob-clojure-literate-incanter-plot-file
(FileOutputStream. \"%s\"))"
  ;;(concat directory out-file)))
  ;; (funcall append-to-body
  ;;"(save ob-clojure-literate-incanter-plot
ob-clojure-literate-incanter-plot-file)")
  )
(when out-file
  ;; (funcall append-to-body
  ;;(format "(view ob-clojure-literate-incanter-plot)"))

  (funcall append-to-body
 (format "(save ob-clojure-literate-incanter-plot \"%s\")"
 (concat directory out-file)))
  )
(list body params) ; return modified argument list
))

(advice-add 'org-babel-expand-body:clojure :filter-args
#'ob-clojure-literate-inject-code)
```

When I add upper advice code. And execute the following org-babel src block:
```org
#+begin_src clojure :cache no :dir "data/images" :results graphics :file
"ob-clojure-literate.png"
(use '(incanter core stats datasets charts io pdf))
(def ob-clojure-literate-incanter-plot (histogram (sample-normal 1000)))

;; (save ob-clojure-literate-incanter-plot
"/home/stardiviner/Org/Wiki/Computer Technology/Programming/Programming
Languages/Clojure/Data/Clojure
Packages/data/images/ob-clojure-literate.png")
#+end_src
```

Emacs reports error:
```
Not a PNG file: ‘/home/stardiviner/Org/Wiki/Computer
Technology/Programming/Programming Languages/Clojure/Data/Clojure
Packages/data/images/ob-clojure-literate.png’ [4 times]
```

But I execute the literate Clojure code:
```clojure
(save ob-clojure-literate-incanter-plot
"/home/stardiviner/Org/Wiki/Computer Technology/Programming/Programming
Languages/Clojure/Data/Clojure
Packages/data/images/ob-clojure-literate.png")
```
in CIDER REPL buffer is fine. The plot image is generated correctly.

I tried to Edebug the advice function. But can't find out where is wrong.
Please someone can help me out. Thanks in advance.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Two ob-lua versions

2018-02-14 Thread numbch...@gmail.com
I created a PR now https://code.orgmode.org/bzg/org-mode/pulls/4 . Really
sorry for this. @Nicolas , can you merge it now?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Feb 14, 2018 at 6:18 PM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> Hi, sorry for this. I have not noticed that. I will create an PR to remove
> my `ob-lua.el` as soon as fast.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Wed, Feb 14, 2018 at 9:28 AM, Satoru KURASHIKI <lur...@gmail.com>
> wrote:
>
>> hi,
>>
>> On Sun, Feb 11, 2018 at 6:22 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
>> wrote:
>> > Hello,
>> >
>> > Thibault Marin <thibault.ma...@gmx.com> writes:
>> >
>> >> I noticed that a recent change added an ob-lua.el file to
>> contrib/lisp/.
>> >> Since there is already an ob-lua.el in lisp/, I was wondering if the
>> new
>> >> version was adding functionality not supported by the one in lisp/ (it
>> >> does not seem to be the case on casual inspection) and if so, whether
>> >> they could/should be merged.
>> >
>> > I just realized that, too. It seems wrong. I'm Cc'ing stardiviner so we
>> > can have some insight about it.
>>
>> Anyway this breaks installation with package.el in org-plus-contrib case.
>> because of conflicting "ob-lua.el" filename.
>>
>> > stardiviner, would you mind explaining why you need to create an
>> > "ob-lua.el" library in "contrib/" ?
>>
>> It has to be fixed, so please revert that merge, until stardiviner will
>> notice
>> this thread and retry PR...
>>
>> regards,
>> --
>> KURASHIKI Satoru
>>
>>
>


Re: [O] Two ob-lua versions

2018-02-14 Thread numbch...@gmail.com
Hi, sorry for this. I have not noticed that. I will create an PR to remove
my `ob-lua.el` as soon as fast.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Feb 14, 2018 at 9:28 AM, Satoru KURASHIKI  wrote:

> hi,
>
> On Sun, Feb 11, 2018 at 6:22 PM, Nicolas Goaziou 
> wrote:
> > Hello,
> >
> > Thibault Marin  writes:
> >
> >> I noticed that a recent change added an ob-lua.el file to contrib/lisp/.
> >> Since there is already an ob-lua.el in lisp/, I was wondering if the new
> >> version was adding functionality not supported by the one in lisp/ (it
> >> does not seem to be the case on casual inspection) and if so, whether
> >> they could/should be merged.
> >
> > I just realized that, too. It seems wrong. I'm Cc'ing stardiviner so we
> > can have some insight about it.
>
> Anyway this breaks installation with package.el in org-plus-contrib case.
> because of conflicting "ob-lua.el" filename.
>
> > stardiviner, would you mind explaining why you need to create an
> > "ob-lua.el" library in "contrib/" ?
>
> It has to be fixed, so please revert that merge, until stardiviner will
> notice
> this thread and retry PR...
>
> regards,
> --
> KURASHIKI Satoru
>
>


Re: [O] Smart archiving of subtrees with parent headlines

2018-02-09 Thread numbch...@gmail.com
I like this idea.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Feb 10, 2018 at 12:42 AM, Mark Edgington  wrote:

> Hello all,
>
> I have looked at a few threads related to the archiving of subtrees,
> but haven't found anything that matches what I think would be a very
> sensible archiving behavior.  I already posted this as a question on
> the emacs stack-exchange site
> (https://emacs.stackexchange.com/questions/38530/how-to-
> archive-an-org-mode-subtree-along-with-its-parent-headlines),
> but realize that the mailing list is probably more likely to get some
> feedback from people.  So here's what I'm trying to figure out how to
> do:
>
> Say I start with an org-file that looks like:
>
> #+ARCHIVE: ::* Archived
>
> * Foo
>   * Tasks
> * Task1
>   * Thoughts
> * Thought1
> * Thought2
>
> * Archived
>
> Now I put the point (i.e. cursor) on Thought1 and run
> org-super-archive (the magical command I'm hoping to find). The result
> should be:
>
> #+ARCHIVE: ::* Archived
>
> * Foo
>   * Tasks
> * Task1
>   * Thoughts
> * Thought2
>
> * Archived
>   * Foo
> * Thoughts
>   * Thought1
>
> Now I move the point to Thought2 and again run org-super-archive,
> which should give me:
>
> #+ARCHIVE: ::* Archived
>
> * Foo
>   * Tasks
> * Task1
>   * Thoughts
>
> * Archived
>   * Foo
> * Thoughts
>   * Thought1
>   * Thought2
>
> So the basic operation I'm seeking is the ability to archive a subtree
> to whatever target location is specified with #+ARCHIVE (or
> org-archive-location) where (1) the full path of the archived subtree
> is mirrored beneath that target location, and (2) the subtree will be
> merged into an existing path under the target if an appropriate path
> already exists (e.g. a path consisting of all of the subtree's parent
> headlines, regardless of the content of the bodies of these
> headlines).
>
> As an added bonus, it would be nice if it were possible to choose
> whether or not the "full path" of a subtree to be archived will
> include the org-file name as the root of the path. This would be
> useful in cases where you archive from multiple org-files to a single
> archive.org file.
>
> Any thoughts on this -- has it already been done, or would it be easy to
> do?
>
>


[O] Org-mode new website accept PR like GitHub?

2018-02-07 Thread numbch...@gmail.com
Can I send PR to add contrib support at new Org-mode source code website
like this: https://code.orgmode.org/bzg/org-mode/pulls/1

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] org-eldoc error on shell src blocks

2018-02-03 Thread numbch...@gmail.com
After some dive in deeper

- [X] emacs minimal init test, confirmed issue in org-mode.
- [X] from the error log, seems `org-eldoc` try to call `(progn (funcall
mode-func) ...`. This caused `shell-mode()`.
- [ ] check out `org-eldoc.el` source code, have not found any solution or
options.

Hope some org-mode hacker can help to fix this issue?
And this might be a unit test in Org-mode testing?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Feb 2, 2018 at 9:32 AM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> When I enable `eldoc-mode` in org-mode.
> eldoc timer running when on `shell` src blocks like:
>
> #+begin_src shell
>   git log $rev..origin/emacs-25 -- lisp/org doc/misc/org.texi \
> etc/refcards/orgcard.tex etc/ORG-NEWS etc/org \
> etc/schema/od-manifest-schema-v1.2-os.rnc \
> etc/schema/od-schema-v1.2-os.rnc
> #+end_src
>
> I got the following error.
>
> #+begin_example
> Debugger entered--Lisp error: (wrong-type-argument processp nil)
>   process-command(nil)
>   shell-mode()
>   funcall(shell-mode)
>   (progn (funcall mode-func) (setq doc-func (and
> eldoc-documentation-function (symbol-value 'eldoc-documentation-function)))
> (puthash lang doc-func org-eldoc-local-functions-cache))
>   (unwind-protect (progn (funcall mode-func) (setq doc-func (and
> eldoc-documentation-function (symbol-value 'eldoc-documentation-function)))
> (puthash lang doc-func org-eldoc-local-functions-cache)) (and
> (buffer-name temp-buffer) (kill-buffer temp-buffer)))
>   (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
> (funcall mode-func) (setq doc-func (and eldoc-documentation-function
> (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func
> org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
> (kill-buffer temp-buffer
>   (let ((temp-buffer (generate-new-buffer " *temp*")))
> (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
> (funcall mode-func) (setq doc-func (and eldoc-documentation-function
> (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func
> org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
> (kill-buffer temp-buffer)
>   (progn (let ((temp-buffer (generate-new-buffer " *temp*")))
> (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
> (funcall mode-func) (setq doc-func (and eldoc-documentation-function
> (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func
> org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
> (kill-buffer temp-buffer) doc-func)
>   (if (fboundp mode-func) (progn (let ((temp-buffer (generate-new-buffer "
> *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect
> (progn (funcall mode-func) (setq doc-func (and eldoc-documentation-function
> (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func
> org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
> (kill-buffer temp-buffer) doc-func))
>   (if (eq 'empty cached-func) (if (fboundp mode-func) (progn (let
> ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer
> (set-buffer temp-buffer) (unwind-protect (progn (funcall mode-func) (setq
> doc-func (and eldoc-documentation-function (symbol-value
> 'eldoc-documentation-function))) (puthash lang doc-func
> org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
> (kill-buffer temp-buffer) doc-func)) cached-func)
>   (let ((cached-func (gethash lang org-eldoc-local-functions-cache
> 'empty)) (mode-func (intern-soft (format "%s-mode" lang))) doc-func) (if
> (eq 'empty cached-func) (if (fboundp mode-func) (progn (let ((temp-buffer
> (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer
> temp-buffer) (unwind-protect (progn (funcall mode-func) (setq doc-func (and
> eldoc-documentation-function (symbol-value 'eldoc-documentation-function)))
> (puthash lang doc-func org-eldoc-local-functions-cache)) (and
> (buffer-name temp-buffer) (kill-buffer temp-buffer) doc-func))
> cached-func))
>   org-eldoc-get-mode-local-documentation-function("shell")
>   (let ((doc-fun (org-eldoc-get-mode-local-documentation-function lang)))
> (if (functionp doc-fun) (progn (funcall doc-fun
>   (cond ((or (string= lang "emacs-lisp") (string= lang "elisp")) (if
> (fboundp 'elisp-eldoc-documentation-function) 
> (elisp-eldoc-documentation-function)
> (let (eldoc-documentation-function) (eldoc-print-current-symbol-info
> ((or (string= lang "c") (string= lang 

Re: [O] org-mode source code repo make error

2018-02-02 Thread numbch...@gmail.com
I did'nt use `make -C lisp compile`. I just use `make` and `make compile`.
Check out my original email, it's the output from command `make`.

I did a search, found this `make -C lisp compile` is from `mk/targets.mk`.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Feb 2, 2018 at 12:18 PM, Yasushi SHOJI <yasushi.sh...@gmail.com>
wrote:

> Hi,
>
> On Fri, Feb 2, 2018 at 10:24 AM, numbch...@gmail.com
> <numbch...@gmail.com> wrote:
> > When I try to compile with command `make`, but got this output:
> [...]
> > make -C lisp compile
>
> just do `make compile`.
>
> you can't use `-C` in org-mode source tree.
> In my case with `-C`, I get:
>
> $ make -C lisp compile
> make: Entering directory '/home/yashi/src/org-mode/lisp'
> Makefile:4: *** This make needs to be started as a sub-make from the
> toplevel directory..  Stop.
> make: Leaving directory '/home/yashi/src/org-mode/lisp'
>
> $ git describe
> release_9.1.6-419-g4b2006db3
>
>
> `make help` for more option.
> --
>yashi
>


[O] org-eldoc error on shell src blocks

2018-02-01 Thread numbch...@gmail.com
When I enable `eldoc-mode` in org-mode.
eldoc timer running when on `shell` src blocks like:

#+begin_src shell
  git log $rev..origin/emacs-25 -- lisp/org doc/misc/org.texi \
etc/refcards/orgcard.tex etc/ORG-NEWS etc/org \
etc/schema/od-manifest-schema-v1.2-os.rnc \
etc/schema/od-schema-v1.2-os.rnc
#+end_src

I got the following error.

#+begin_example
Debugger entered--Lisp error: (wrong-type-argument processp nil)
  process-command(nil)
  shell-mode()
  funcall(shell-mode)
  (progn (funcall mode-func) (setq doc-func (and
eldoc-documentation-function (symbol-value 'eldoc-documentation-function)))
(puthash lang doc-func org-eldoc-local-functions-cache))
  (unwind-protect (progn (funcall mode-func) (setq doc-func (and
eldoc-documentation-function (symbol-value 'eldoc-documentation-function)))
(puthash lang doc-func org-eldoc-local-functions-cache)) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(funcall mode-func) (setq doc-func (and eldoc-documentation-function
(symbol-value 'eldoc-documentation-function))) (puthash lang doc-func
org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer
(set-buffer temp-buffer) (unwind-protect (progn (funcall mode-func) (setq
doc-func (and eldoc-documentation-function (symbol-value
'eldoc-documentation-function))) (puthash lang doc-func
org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer)
  (progn (let ((temp-buffer (generate-new-buffer " *temp*")))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(funcall mode-func) (setq doc-func (and eldoc-documentation-function
(symbol-value 'eldoc-documentation-function))) (puthash lang doc-func
org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer) doc-func)
  (if (fboundp mode-func) (progn (let ((temp-buffer (generate-new-buffer "
*temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect
(progn (funcall mode-func) (setq doc-func (and eldoc-documentation-function
(symbol-value 'eldoc-documentation-function))) (puthash lang doc-func
org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer) doc-func))
  (if (eq 'empty cached-func) (if (fboundp mode-func) (progn (let
((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer
(set-buffer temp-buffer) (unwind-protect (progn (funcall mode-func) (setq
doc-func (and eldoc-documentation-function (symbol-value
'eldoc-documentation-function))) (puthash lang doc-func
org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer) doc-func)) cached-func)
  (let ((cached-func (gethash lang org-eldoc-local-functions-cache 'empty))
(mode-func (intern-soft (format "%s-mode" lang))) doc-func) (if (eq 'empty
cached-func) (if (fboundp mode-func) (progn (let ((temp-buffer
(generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn (funcall mode-func) (setq doc-func (and
eldoc-documentation-function (symbol-value 'eldoc-documentation-function)))
(puthash lang doc-func org-eldoc-local-functions-cache)) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer) doc-func)) cached-func))
  org-eldoc-get-mode-local-documentation-function("shell")
  (let ((doc-fun (org-eldoc-get-mode-local-documentation-function lang)))
(if (functionp doc-fun) (progn (funcall doc-fun
  (cond ((or (string= lang "emacs-lisp") (string= lang "elisp")) (if
(fboundp 'elisp-eldoc-documentation-function)
(elisp-eldoc-documentation-function) (let (eldoc-documentation-function)
(eldoc-print-current-symbol-info ((or (string= lang "c") (string= lang
"C")) (if (require 'c-eldoc nil t) (progn
(c-eldoc-print-current-symbol-info ((string= lang "css") (if (require
'css-eldoc nil t) (progn (css-eldoc-function ((string= lang "php") (if
(require 'php-eldoc nil t) (progn (php-eldoc-function ((or (string=
lang "go") (string= lang "golang")) (if (require 'go-eldoc nil t) (progn
(go-eldoc--documentation-function (t (let ((doc-fun
(org-eldoc-get-mode-local-documentation-function lang))) (if (functionp
doc-fun) (progn (funcall doc-fun))
  (let ((lang (org-eldoc-get-src-lang))) (cond ((or (string= lang
"emacs-lisp") (string= lang "elisp")) (if (fboundp
'elisp-eldoc-documentation-function) (elisp-eldoc-documentation-function)
(let (eldoc-documentation-function) (eldoc-print-current-symbol-info
((or (string= lang "c") (string= lang "C")) (if (require 'c-eldoc nil t)
(progn (c-eldoc-print-current-symbol-info ((string= lang "css") (if
(require 'css-eldoc nil t) (progn (css-eldoc-function ((string= lang
"php") (if (require 'php-eldoc nil t) (progn (php-eldoc-function ((or
(string= lang "go") (string= lang "golang")) (if (require 'go-eldoc nil t)
(progn 

[O] org-mode source code repo make error

2018-02-01 Thread numbch...@gmail.com
When I try to compile with command `make`, but got this output:
```
make -C doc clean;  make -C lisp clean;
make[1]: Entering directory '/home/stardiviner/Code/Emacs/org-mode/doc'
rm -f org *.pdf *.html *_letter.tex org-version.inc org-version.tex \
  *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \
  *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
make[1]: Leaving directory '/home/stardiviner/Code/Emacs/org-mode/doc'
make[1]: Entering directory '/home/stardiviner/Code/Emacs/org-mode/lisp'
rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc
org-install.elc
rm -f *.elc
make[1]: Leaving directory '/home/stardiviner/Code/Emacs/org-mode/lisp'
make -C lisp compile
make[1]: Entering directory '/home/stardiviner/Code/Emacs/org-mode/lisp'
rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc
org-install.elc
org-version: 9.1.5 (release_9.1.5-434-ge490d2)
Loading /home/stardiviner/Code/Emacs/org-mode/lisp/org-compat.el (source)...
Loading /home/stardiviner/Code/Emacs/org-mode/mk/org-fixup.el (source)...
End of file during parsing
make[1]: *** [Makefile:72: org-version.el] Error 255
make[1]: Leaving directory '/home/stardiviner/Code/Emacs/org-mode/lisp'
make: *** [mk/targets.mk:95: compile] Error 2
```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] Why the new structure template engine not in Org ELPA package?

2018-01-28 Thread numbch...@gmail.com
RT.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] [feature] prepend comment char before org-babel-ref

2018-01-28 Thread numbch...@gmail.com
Thanks. @Nicolas

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Jan 27, 2018 at 6:58 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:
>
> > Hello,
> >
> > "numbch...@gmail.com" <numbch...@gmail.com> writes:
> >
> >> Because it is not good for tangling.
> >> For example, tangle the bellowing src block, the tangled source code
> file
> >> will has `(ref:hello)` too.
> >> ```
> >>
> >> #+begin_src emacs-lisp :tangle "data/code/src-coderef.el"
> >> (message "hello, world") (ref:hello)
> >> #+end_src
> >
> > You need to add "-r" switch so Org knows you want to remove coderefs:
> >
> >   #+begin_src emacs-lisp :tangle "data/code/src-coderef.el"
> >   (message "hello, world") (ref:hello)
> >   #+end_src
>
> I meant
>
>   #+begin_src emacs-lisp -r :tangle "data/code/src-coderef.el"
> 
>


Re: [O] [feature] prepend comment char before org-babel-ref

2018-01-26 Thread numbch...@gmail.com
Sorry, I miss typed my header argument `:dir "data/code/src-coderef.rb"`.
It should be `:tangle`.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Jan 26, 2018 at 8:34 PM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> Because it is not good for tangling.
> For example, tangle the bellowing src block, the tangled source code file
> will has `(ref:hello)` too.
> ```
> #+begin_src emacs-lisp :tangle "data/code/src-coderef.el"
> (message "hello, world") (ref:hello)
> #+end_src
> ```
> The tangled source code file looks like this:
> ```
> (message "hello, world") (ref:hello)
> ```
> This absolutely is not a good idea.
>
>
>
> And after a test, I found I can't tangle the bellowing src block:
> ```
> #+begin_src ruby :dir "data/code/src-coderef.rb"
> puts "hello, world" (ref:hello)
> #+end_src
> ```
> Even with a comment char prefix:
> ```
> #+begin_src ruby :dir "data/code/src-coderef.rb"
> puts "hello, world" # (ref:hello)
> #+end_src
>
> ```
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Fri, Jan 26, 2018 at 4:19 AM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
> wrote:
>
>> Hello,
>>
>> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>>
>> > I see. Seems current ob-core.el can filter out the `src-coderef`.
>> > Like the following:
>>
>> [...]
>>
>> > My wanted feature is simple, just `(insert (concat comment-char
>> > coderef-format))`
>>
>> Per the above, may I ask why you do need it?
>>
>> Regards,
>>
>> --
>> Nicolas Goaziou0x80A93738
>>
>
>


Re: [O] [feature] prepend comment char before org-babel-ref

2018-01-26 Thread numbch...@gmail.com
Because it is not good for tangling.
For example, tangle the bellowing src block, the tangled source code file
will has `(ref:hello)` too.
```
#+begin_src emacs-lisp :tangle "data/code/src-coderef.el"
(message "hello, world") (ref:hello)
#+end_src
```
The tangled source code file looks like this:
```
(message "hello, world") (ref:hello)
```
This absolutely is not a good idea.



And after a test, I found I can't tangle the bellowing src block:
```
#+begin_src ruby :dir "data/code/src-coderef.rb"
puts "hello, world" (ref:hello)
#+end_src
```
Even with a comment char prefix:
```
#+begin_src ruby :dir "data/code/src-coderef.rb"
puts "hello, world" # (ref:hello)
#+end_src

```

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Jan 26, 2018 at 4:19 AM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > I see. Seems current ob-core.el can filter out the `src-coderef`.
> > Like the following:
>
> [...]
>
> > My wanted feature is simple, just `(insert (concat comment-char
> > coderef-format))`
>
> Per the above, may I ask why you do need it?
>
> Regards,
>
> --
> Nicolas Goaziou0x80A93738
>


Re: [O] [feature] prepend comment char before org-babel-ref

2018-01-25 Thread numbch...@gmail.com
I see. Seems current ob-core.el can filter out the `src-coderef`.
Like the following:

#+begin_src emacs-lisp
(prin1 "hello, world!") (ref:hello)
#+end_src

#+RESULTS[<2018-01-25 20:28:40> 16eccfedcc87d3ca0c7024b2637c646d4708ec42]:
: hello, world!

#+begin_src ruby :results output
puts "hello, world!" (ref:hello)
#+end_src

#+RESULTS[<2018-01-25 20:46:21> e1e8632ccedf7cc3c676be0c89841a885bbcc7d9]:
: hello, world!

But about your questions:
> What it the comment syntax is not properly defined?
I think almost all programming language has comments. About some other
babels which don't have comment. I think `org-babel` can check whether
babel language has comment.
> What if the coderef format already contains comment syntax?
`org-babel` already use current coderef format. Keep current coderef format
is fine. If coderef format is like `#ref:label`. and Ruby language use
comment `#` too. Then after prepending comment char, it becomes `#
#ref:label`. It is fine. Right?
> What if the language does not support inline comments and you're in the
middle of a line?
It is fine too. Current coderef already support insert coderef format at
right align even I'm in the middle of a line. I tested.

All your questions solved.

My wanted feature is simple, just `(insert (concat comment-char
coderef-format))`

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Jan 24, 2018 at 9:40 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > I think this function should be in Org-mode itself.
> > Because when you're editing the source code, will not want this
> src-coderef
> > like `(ref:example)` be editable. It should be in comment.
>
> Thank you for the suggestion. However I have some doubts about this.
>
> What it the comment syntax is not properly defined? What if the coderef
> format already contains comment syntax? What if the language does not
> support inline comments and you're in the middle of a line (e.g.,
> FORTRAN)?
>
> I'm wondering if this is really a panacea. The current situation, albeit
> imperfect, is simple and easy to understand.
>
> WDYT?
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] [feature] prepend comment char before org-babel-ref

2018-01-23 Thread numbch...@gmail.com
I'm currently using this advice:
```elisp
;;; prepend comment char ahead of `org-babel-ref'.
;; auto prefix with comment char when create code ref in src block with
`org-store-link'.
(defun org-babel-ref-prepend-comment-char (arg  interactive?)
  "Prepend comment chart in Org-mode src code block."
  (when (org-src-edit-buffer-p)
(comment-dwim nil)
(insert " ")))

(advice-add 'org-store-link :before #'org-babel-ref-prepend-comment-char)
```

There is another solution but not work:
```elisp
;;; Another implement solution.
(defun org-src-coderef-format ( element)
  (cond
   ((and element (org-element-property :label-fmt element)))
   ((org-src-edit-buffer-p) (org-src-do-at-code-block
(org-src-coderef-format)))
   ((org-element-property :label-fmt (org-element-at-point)))
   (t org-coderef-label-format)))

(defun org-src-coderef-prepend-comment-char (args)
  "Prepend comment chart in Org-mode src code block."
  (when (org-src-edit-buffer-p)
(comment-dwim nil)
(insert " ")))

(advice-add 'org-src-coderef-format :filter-return
#'org-src-coderef-prepend-comment-char)
```

I think this function should be in Org-mode itself.
Because when you're editing the source code, will not want this src-coderef
like `(ref:example)` be editable. It should be in comment.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] compatible issue between MELPA org and source code org

2018-01-23 Thread numbch...@gmail.com
After check your source code, I finally and with your theory:

> Org doesn't load automatically.. it autoloads only if you open an Org
file or call an org-loading function. After emacs -Q, if you do M-:
(featurep 'org), you will get nil. So the user does get a change to set the
load path as they want before any package gets loaded.

I finally understand how it works. Yesterday, I use a crude way: delete
Emacs built-in org/ directory. This works too. But I still take your
method. Your method is the correct way. Thanks very much.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Jan 24, 2018 at 12:15 AM, Kaushal Modi <kaushal.m...@gmail.com>
wrote:

> On Tue, Jan 23, 2018 at 11:09 AM numbch...@gmail.com <numbch...@gmail.com>
> wrote:
>
>> Thanks for your advice. After your code inspiration. I got an idea. After
>> test, it works fine. I try to load `use-package` and `(use-package org :pin
>> manaul ..)` ahead of `(package-initialize)`. Half of the problem is solved.
>>
>
>
>> The another half of the problem is that Emacs still will load built-in
>> org-mode in lisp/org/. I think I can't solve this problem essentially.
>> Because I can't load before Emacs built-in library. Oops.
>>
>
> Org doesn't load automatically.. it autoloads only if you open an Org file
> or call an org-loading function. After emacs -Q, if you do M-: (featurep
> 'org), you will get nil. So the user does get a change to set the load path
> as they want before any package gets loaded.
>
> That's way, I tweak the load-path in the :preface section[1] in the org
> use-package form. The load-path would be set exactly as I want before org
> gets (auto)loaded.
>
> [1]: https://github.com/kaushalmodi/.emacs.d/blob/
> master/setup-files/setup-org.el
>
>
> --
>
> Kaushal Modi
>


Re: [O] compatible issue between MELPA org and source code org

2018-01-23 Thread numbch...@gmail.com
Thanks for your advice. After your code inspiration. I got an idea. After
test, it works fine. I try to load `use-package` and `(use-package org :pin
manaul ..)` ahead of `(package-initialize)`. Half of the problem is solved.
The another half of the problem is that Emacs still will load built-in
org-mode in lisp/org/. I think I can't solve this problem essentially.
Because I can't load before Emacs built-in library. Oops.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jan 23, 2018 at 8:26 PM, Kaushal Modi <kaushal.m...@gmail.com>
wrote:

> On Mon, Jan 22, 2018, 4:41 AM numbch...@gmail.com <numbch...@gmail.com>
> wrote:
>
>>
>> Does anybody have a perfect solution to use latest source code Org in
>> Emacs way?
>>
>
> I've been using a solution that's working perfectly for me. Unfortunately,
> the only way is to:
>
> 1. Uninstall all the Org installations that you don't want to use
> (example: delete the Org Elpa installed version if you plan to use the git
> cloned version).
> 2. Advice a package.el function that never auto-installs Org as
> dependency.
> 3. Another advice to never update Org using the package manager (as you
> would be managing the updates yourself using git).
>
> Basically the update/dependency-check should not install Org.
>
> A while back, I did a detailed write-up on this setup:
> https://scripter.co/building-org-development-version/. With that setup,
> and modi/org-version-select set to 'dev, I don't have to worry about other
> Org versions getting auto-installed.
>
>> --
>
> Kaushal Modi
>


Re: [O] change in calling remote code blocks?

2018-01-22 Thread numbch...@gmail.com
I agree. use `file::name` is better.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jan 23, 2018 at 3:24 AM, Nicolas Goaziou 
wrote:

> Nicolas Goaziou  writes:
>
> > Fixed. Thank you. I also updated documentation and added tests.
>
> As a side note, file:name syntax is a bit weak. It prevents using colons
> in a name, as reported by the linter. I don't know if the feature is
> used extensively but it may be worth considering changing references
> syntax to, e.g, "file::name".
>
>


[O] compatible issue between MELPA org and source code org

2018-01-22 Thread numbch...@gmail.com
Because some MELPA package requires `org`. So Emacs will **force** install
`org` package from MELPA. But it is delay with source code Org.
I use source code org with use-package like this:
```
(use-package org
  :load-path "~/Code/Emacs/org-mode/lisp/"
  :pin manual
  ;; :mode (("\\.org$" . org-mode))
  :config
  (use-package org-plus-contrib
:load-path "~/Code/Emacs/org-mode/contrib/lisp/"
:no-require t
:pin manual)
  )
```
But Emacs still will load MELPA org with `(package-initialize)`.
In currently latest MELPA org package. It defines
`org-structure-template-alist` Like this:
```
(defcustom org-structure-template-alist
  '(("s" "#+BEGIN_SRC ?\n\n#+END_SRC")
("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE")
("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE")
("v" "#+BEGIN_VERSE\n?\n#+END_VERSE")
("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM")
("c" "#+BEGIN_CENTER\n?\n#+END_CENTER")
("C" "#+BEGIN_COMMENT\n?\n#+END_COMMENT")
("l" "#+BEGIN_EXPORT latex\n?\n#+END_EXPORT")
("L" "#+LaTeX: ")
("h" "#+BEGIN_EXPORT html\n?\n#+END_EXPORT")
("H" "#+HTML: ")
("a" "#+BEGIN_EXPORT ascii\n?\n#+END_EXPORT")
("A" "#+ASCII: ")
("i" "#+INDEX: ?")
("I" "#+INCLUDE: %file ?"))
  "Structure completion elements.
This is a list of abbreviation keys and values.  The value gets inserted
if you type `<' followed by the key and then press the completion key,
usually `TAB'.  %file will be replaced by a file name after prompting
for the file using completion.  The cursor will be placed at the position
of the `?' in the template.
There are two templates for each key, the first uses the original Org
syntax,
the second uses Emacs Muse-like syntax tags.  These Muse-like tags become
the default when the /org-mtags.el/ module has been loaded.  See also the
variable `org-mtags-prefer-muse-templates'."
  :group 'org-edit-structure
  :type '(repeat
  (list
   (string :tag "Key")
   (string :tag "Template")))
  :version "26.1"
  :package-version '(Org . "8.3"))
```
But in source code `master` branch. It is updated to use new templates.
So after Emacs finished launching.
It becomes like this:
```
 (("Q" "#+BEGIN_SRC sql-mode ?

 ,#+END_SRC" "#+BEGIN_SRC sql-mode ?

 ,#+END_SRC")
  ("n" "#+BEGIN_NOTES
 ?
 ,#+END_NOTES")
  (116 . "translate")
  ("s" "#+BEGIN_SRC ?

 ,#+END_SRC")
  ("e" "#+BEGIN_EXAMPLE
 ?
 ,#+END_EXAMPLE")
  ("q" "#+BEGIN_QUOTE
 ?
 ,#+END_QUOTE")
  ("v" "#+BEGIN_VERSE
 ?
 ,#+END_VERSE")
  ("V" "#+BEGIN_VERBATIM
 ?
 ,#+END_VERBATIM")
  ("c" "#+BEGIN_CENTER
 ?
 ,#+END_CENTER")
  ("C" "#+BEGIN_COMMENT
 ?
 ,#+END_COMMENT")
  ("l" "#+BEGIN_EXPORT latex
 ?
 ,#+END_EXPORT")
  ("L" "#+LaTeX: ")
  ("h" "#+BEGIN_EXPORT html
 ?
 ,#+END_EXPORT")
  ("H" "#+HTML: ")
  ("a" "#+BEGIN_EXPORT ascii
 ?
 ,#+END_EXPORT")
  ("A" "#+ASCII: ")
  ("i" "#+INDEX: ?")
  ("I" "#+INCLUDE: %file ?"))
 Original value was
 ((97 . "export ascii")
  (99 . "center")
  (67 . "comment")
  (101 . "example")
  (69 . "export")
  (104 . "export html")
  (108 . "export latex")
  (113 . "quote")
  (115 . "src")
  (118 . "verse"))
```

Does anybody have a perfect solution to use latest source code Org in Emacs
way? Please tell me thanks.
And question two: I don't know how to fix this issue. I think might org
should update MELPA org package? (I know package `org` updated recently)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] unhex org-link for shell command

2018-01-17 Thread numbch...@gmail.com
Thanks very much.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jan 18, 2018 at 5:40 AM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > I'm developing an Emacs package
> > https://github.com/stardiviner/org-send-ebook .
> > I found Org-mode hex spaces in filename with "%20", So I reverse this
> with
> > function `(url-unhex-string (org-element-property :path
> > (org-element-context)))`. But this only works for English filename. If it
> > is Chinese filename. this will caused error.
>
> You can use `org-link-unescape'.
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] unhex org-link for shell command

2018-01-17 Thread numbch...@gmail.com
I'm developing an Emacs package
https://github.com/stardiviner/org-send-ebook .
I found Org-mode hex spaces in filename with "%20", So I reverse this with
function `(url-unhex-string (org-element-property :path
(org-element-context)))`. But this only works for English filename. If it
is Chinese filename. this will caused error.

Is there Org-mode built-in function which return the file path with out
hexing spaces '%20' ?
Or Does Emacs has functions can unhex '%20' correctly on Chinese?

Here is the test case:
org link:
[[file:Data/Books/%E6%80%8E%E6%A0%B7%E8%AF%BB%E4%B9%A6.mobi][怎样读书 (mobi)]]
And there is the result of `(org-element-property :path
(org-element-context))`:
"Data/Books/%E6%80%8E%E6%A0%B7%E8%AF%BB%E4%B9%A6.mobi"

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] How to apply function on org-capture template substitute variable %i?

2018-01-13 Thread numbch...@gmail.com
I have a org-capture template like this:
```
(setq org-capture-templates
(append '(("w" "org-drill [w]ords"
   entry (file my-org-drill-words-file)
   "* %i :drill:
:PROPERTIES:
:DRILL_CARD_TYPE: %^{Drill Difficulty|simple|twosided|multisided|hide1cloze}
:END:

%?

%c
"
   :empty-lines 1
   ))
org-capture-templates))
```
I want to apply a function on `%i` to make it lowercase.
Like `(lowercase %i)` ?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Orgmode repeater intervals with end date

2018-01-12 Thread numbch...@gmail.com
You can try this:
```
* Test repeat time range with end date
DEADLINE: <2018-01-01 Mon 12:00 .+2d>--<2018-01-13 Sat>
```
This will repeat, and end on the day 13. Also deadline works fine.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jan 11, 2018 at 7:37 PM,  wrote:

> On 2018-01-10 18:24, ed...@openmail.cc wrote:
>
>> Message: 8
>>> Date: Tue, 09 Jan 2018 22:16:56 -0700
>>> From: torys.ander...@gmail.com (Tory S. Anderson)
>>> To: orgmode list 
>>> Subject: [O] Orgmode repeater intervals with end date
>>> Message-ID: <87incamgxj@byu.edu>
>>> Content-Type: text/plain; format=flowed
>>>
>>> Hi all,
>>>
>>> When repeater intervals are set on on org dates (eg =<2018-01-10
>>> Wed 16:00 +2w>=) the
>>> output is exported nicely to ical and appears
>>> nicely in agenda. Is there anyway to put an end-date on org dates
>>> so that the +2w will not just continue forever?
>>>
>>> I could use org-class, but then it wouldn't be exported to ical
>>> nicely. I was hopefully with <2018-01-10 Wed 16:00
>>> +2w>--<2018-04-10 Wed 16:00 +2w> but this just put the range as
>>> counting every day in the interim. Is there an existing way to
>>> have an end-date on a repeating cycle?
>>>
>>> - Tory
>>>
>>
>> Have you tried with DEADLINE:? I seem to remember to have read
>> something like that somewhere. Don't trust me. If it helps, I am glad,
>> but I am not sure.
>>
>>
> Have a look at https://www.gnu.org/software/e
> macs/manual/html_node/emacs/Sexp-Diary-Entries.html However, I am not
> sure if you can use an Emacs sexp to specify an end date.
>
> Ian.
>
>


Re: [O] I created a package ob-clojure-literate for Clojure Literate Programming in Org-mode

2018-01-04 Thread numbch...@gmail.com
After @bbatsov's explaination. I think he is right. I'm considering to
improve my solution. Might will be available soon.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jan 4, 2018 at 7:39 PM, Bastien Guerry <b...@gnu.org> wrote:

> Thanks!
>
> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > No, I asked Clojure ML, and posted an issue on clojure-mode GitHub
> > issues. I need to find a workaround on myself.
> > You can check out the discussion here https://github.com/
> > clojure-emacs/clojure-mode/pull/465.
>
> I posted a comment too -- I still think a change in CIDER would be
> better.
>
> --
>  Bastien
>


Re: [O] I created a package ob-clojure-literate for Clojure Literate Programming in Org-mode

2018-01-04 Thread numbch...@gmail.com
If you got any problem after use and test, GitHub issues and PR welcome.
Thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jan 4, 2018 at 6:55 PM, Bastien Guerry <b...@gnu.org> wrote:

> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > https://github.com/stardiviner/ob-clojure-literate
>
> Thanks for sharing this.
>
> About this part:
>
> (defun ob-clojure-cider-do-not-find-ns ()
>   "Fix the issue that `cider-current-ns' try to invoke
> `clojure-find-ns' to extract ns from buffer."
>   (setq-local cider-buffer-ns "user"))
>
> I'm not entirely sure what is the problem here, but it
> looks like something that can be fixed directly un CIDER.
>
> Is it so?
>
> --
>  Bastien
>


Re: [O] I created a package ob-clojure-literate for Clojure Literate Programming in Org-mode

2018-01-04 Thread numbch...@gmail.com
No, I asked Clojure ML, and posted an issue on clojure-mode GitHub issues.
I need to find a workaround on myself.
You can check out the discussion here
https://github.com/clojure-emacs/clojure-mode/pull/465.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jan 4, 2018 at 6:55 PM, Bastien Guerry <b...@gnu.org> wrote:

> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > https://github.com/stardiviner/ob-clojure-literate
>
> Thanks for sharing this.
>
> About this part:
>
> (defun ob-clojure-cider-do-not-find-ns ()
>   "Fix the issue that `cider-current-ns' try to invoke
> `clojure-find-ns' to extract ns from buffer."
>   (setq-local cider-buffer-ns "user"))
>
> I'm not entirely sure what is the problem here, but it
> looks like something that can be fixed directly un CIDER.
>
> Is it so?
>
> --
>  Bastien
>


[O] [SOLVED] Re: How to get a list of all TODO keywords from defined variable `org-todo-keywords`?

2018-01-04 Thread numbch...@gmail.com
This works great. Thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jan 4, 2018 at 10:23 AM, Adam Porter  wrote:

> This might do:
>
> (completing-read "Todo keyword: " org-todo-keywords-for-agenda nil t)
>
>
>


[O] I created a package ob-clojure-literate for Clojure Literate Programming in Org-mode

2018-01-04 Thread numbch...@gmail.com
I created a package ob-clojure-literate for Clojure Literate Programming in
Org-mode. Welcome to use it and add PR.

https://github.com/stardiviner/ob-clojure-literate

I still have two features not implemented. Hope someone will PR. Thanks
very much.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


[O] How to get a list of all TODO keywords from defined variable `org-todo-keywords`?

2018-01-03 Thread numbch...@gmail.com
 I'm trying to select TODO keyword when doing org-capture.

Like this:

(setq org-capture-templates
'(("c" "[C]apture"
entry (file "")
;; HACK: select todo keyword interactively from `org-todo-keywords'.
;; 1. command `org-todo'
"* %(completing-read \"Todo keyword: \" (mapcar #'list
org-todo-keywords-1) nil t) %^{Capture}\n\n%i\n%a\n\n%?"
:prepend t
:empty-lines 1
)
...
))


But it is not working as I expected. I borrow this snippet code from
command `org-todo`.

hope someone can provide a good solution for my purpose.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] ob-python specify :session error

2017-12-29 Thread numbch...@gmail.com
 After Edebug:
I found the problem location:

  - [ ] org-babel-execute:python

#+begin_src emacs-lisp
(session (org-babel-python-initiate-session
  (cdr (assq :session params
#+end_src

- [ ] org-babel-python-initiate-session
  - [ ] org-babel-python-session-buffer

BTW: I'm using latest `master` branch source code.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Dec 29, 2017 at 7:28 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> stardiviner <numbch...@gmail.com> writes:
>
> > I have following org content:
> >
> > I define variable in Python inferior REPL (launched by [M-x run-python])
> >
> > Python> name = "chris"
> >
> > #+begin_src python :session "*Python*"
> > print(name)
> > #+end_src
> >
> > But I got error:
> >
> >  > org-babel-python-evaluate-session: Buffer *Python-*Python** does not
> > exist or has no process
>
> Try this:
>
> #+begin_src python :session *Python* :results output
> print(name)
> #+end_src
>
> #+RESULTS:
> : chris
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] ob-python specify :session error

2017-12-29 Thread numbch...@gmail.com
 Still get same error:
> org-babel-python-evaluate-session: Buffer *Python-*Python** does not
exist or has no process

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Dec 29, 2017 at 7:28 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> stardiviner <numbch...@gmail.com> writes:
>
> > I have following org content:
> >
> > I define variable in Python inferior REPL (launched by [M-x run-python])
> >
> > Python> name = "chris"
> >
> > #+begin_src python :session "*Python*"
> > print(name)
> > #+end_src
> >
> > But I got error:
> >
> >  > org-babel-python-evaluate-session: Buffer *Python-*Python** does not
> > exist or has no process
>
> Try this:
>
> #+begin_src python :session *Python* :results output
> print(name)
> #+end_src
>
> #+RESULTS:
> : chris
>
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] babel header argument :var is not expanded when tangling

2017-12-25 Thread numbch...@gmail.com
I see. I will use noweb style for now.
But should tangle expand :var variables when tangling? I think this is the
correct behaviour.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sun, Dec 24, 2017 at 11:40 PM, Grant Rettke 
wrote:

> > Here is a quick test:
> >
> > * Test tangle will auto expand and substitute :var
> >
> > #+begin_src js :tangle kk.js
> > console.log("hello, world!");
> > #+end_src
> >
> > #+begin_src js :var name="chris" :tangle require-kk.js
> > // require("kk.js");
> > console.log("Hi, ", name);
> > #+end_src
> >
> > #+RESULTS:
> > : Hi,  chris
> >
> > #+NAME: check whether tangle expand and substitute :var
> > #+begin_src shell
> > cat require-kk.js
> > #+end_src
> >
> > #+RESULTS: check whether tangle expand and substitute :var
> > : var name="chris";
> > : console.log("Hi, ", name);
> >
> > The upper result should be: ~console.log("Hi, ", "chris");~.
>
> Here are your two source blocks. They each do literate programming,
> one with Variable style and the other with Noweb style. When you
> evaluate them you get an identical result. When you tangle them you
> get two different pieces of code, that generate the same result. You
> can peek at what the tangled code will look like by calling
> org-babel-expand-src-block inside the source block. That is how it
> will look in the tangled file. I think that want Noweb style.
>
> When I use the Variable approach like this
>
> #+begin_src js :var name="chris" :tangle kk.js
> console.log("Hi, ", name);
> #+end_src
>
> I get this in the tangled output file
>
> var name="chris";
> console.log("Hi, ", name);
>
> When I use the the Noweb approach like this
>
> #+NAME: name
> #+BEGIN_SRC emacs-lisp
> chris
> #+END_SRC
>
> #+NAME: org_gcr_2017-12-23_mara_3D887FDD-163D-4BE1-80E8-464BF29DABEA
> #+BEGIN_SRC js :tangle noweb-kk.js :comments no
> console.log("Hi, ", "«name»");
> #+END_SRC
>
> I get this in the tangled  output file
>
> console.log("Hi, ", "chris");
>
> WDYT?
>


[O] babel header argument :var is not expanded when tangling

2017-12-23 Thread numbch...@gmail.com
Here is a quick test:

* Test tangle will auto expand and substitute :var

#+begin_src js :tangle kk.js
console.log("hello, world!");
#+end_src

#+begin_src js :var name="chris" :tangle require-kk.js
// require("kk.js");
console.log("Hi, ", name);
#+end_src

#+RESULTS:
: Hi,  chris

#+NAME: check whether tangle expand and substitute :var
#+begin_src shell
cat require-kk.js
#+end_src

#+RESULTS: check whether tangle expand and substitute :var
: var name="chris";
: console.log("Hi, ", name);

The upper result should be: ~console.log("Hi, ", "chris");~.



[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] Hope ob-js can support :session feature

2017-12-23 Thread numbch...@gmail.com
e to open
> the org file, go to any section and running  any source code block without
> having to remember the sequence of dependencies between them. Worst case,
> all I have to do is run org-babel-tangle to update the tangled files. This
> has also the added benefit that it forces me to structure my blocks
> correctly, from a code architecture point of view.
>
> I hope this makes it clearer for you.
>
>
> Martin
>
> On Fri, Dec 22, 2017 at 8:07 PM numbch...@gmail.com <numbch...@gmail.com>
> wrote:
>
>>
>> Can you describe how do you do this in detailed?
>> Like:
>> > but since I am using docker containers to run node, I always mount the
>> current directory as a volume in /app inside the container, so that works
>> out fine.
>> > I also think that this way forces me to separate the code in modular
>> blocks, which is already a good practice in itself.
>> How to do this? About this: > With sessions you have to make sure to
>> execute the blocks in the correct order to build the "state" that your
>> current block needs.
>> I think have to use `noweb` reference here.
>> (If you have a blog article describe this whole JS literate programming
>> setup, that will be useful.)
>> Finally, thanks you provide this paradigm.
>>
>> [stardiviner] GPG key ID: 47C32433
>> IRC(freeenode): stardiviner Twitter:  @numbchild
>> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
>> Blog: http://stardiviner.github.io/
>>
>> On Sat, Dec 23, 2017 at 2:32 AM, Martin Alsinet <mar...@alsinet.com.ar>
>> wrote:
>>
>>> Hello stardiviner,
>>>
>>> On Fri, Dec 22, 2017 at 6:57 AM stardiviner <numbch...@gmail.com> wrote:
>>>
>>>>
>>>> I wish to do JavaScript Literate Programming in Org-mode.
>>>>
>>>> So the :session header argument is very necessary.
>>>>
>>>>
>>> I do Literate Programming in Javascript with Org-mode, and I have found
>>> a workaround using a combination of tangled files and require.
>>>
>>> I separate the logic in source code blocks which then I tangle into js
>>> files and I require those js files in other source blocks.
>>>
>>> Example:
>>>
>>> #+BEGIN_SRC js :tangle src/parser.js
>>> const fs = require('fs');
>>> const parse = require('csv-parse')
>>>
>>> function columns(line){
>>> return line.map(s => s.toLowerCase());
>>> }
>>> parse_csv = function(filename, fn, limit){
>>> fs.readFile(filename, "utf8", function (err, fileData) {
>>> var opts = {columns: columns, trim: true};
>>> if (limit) {
>>> opts.to = limit;
>>> }
>>> parse(fileData, opts, (err, rows) => fn(rows));
>>> });
>>> }
>>> module.exports = parse_csv;
>>> #+END_SRC
>>>
>>> So, I tangle that source block into a js file, and then I can use it
>>> from other blocks, without needing sessions at all:
>>>
>>> #+BEGIN_SRC
>>> const parser = require("/app/src/parser.js");
>>> const inputFile = './data/records.csv';
>>> parse_csv(inputFile, console.log);
>>> #+END_SRC
>>>
>>> The only drawback is that you have to use absolute paths requiring the
>>> js files, but since I am using docker containers to run node, I always
>>> mount the current directory as a volume in /app inside the container, so
>>> that works out fine.
>>> I also think that this way forces me to separate the code in modular
>>> blocks, which is already a good practice in itself.
>>> With sessions you have to make sure to execute the blocks in the correct
>>> order to build the "state" that your current block needs.
>>> This way source blocks function as standalone units that can be run at
>>> any time, I just run *org-babel-tangle* and then hit *C-c *inside the
>>> js block.
>>>
>>> I hope that helps you.
>>>
>>>
>>> Martin
>>>
>>
>>


Re: [O] Hope ob-js can support :session feature

2017-12-22 Thread numbch...@gmail.com
Can you describe how do you do this in detailed?
Like:
> but since I am using docker containers to run node, I always mount the
current directory as a volume in /app inside the container, so that works
out fine.
> I also think that this way forces me to separate the code in modular
blocks, which is already a good practice in itself.
How to do this? About this: > With sessions you have to make sure to
execute the blocks in the correct order to build the "state" that your
current block needs.
I think have to use `noweb` reference here.
(If you have a blog article describe this whole JS literate programming
setup, that will be useful.)
Finally, thanks you provide this paradigm.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Dec 23, 2017 at 2:32 AM, Martin Alsinet <mar...@alsinet.com.ar>
wrote:

> Hello stardiviner,
>
> On Fri, Dec 22, 2017 at 6:57 AM stardiviner <numbch...@gmail.com> wrote:
>
>>
>> I wish to do JavaScript Literate Programming in Org-mode.
>>
>> So the :session header argument is very necessary.
>>
>>
> I do Literate Programming in Javascript with Org-mode, and I have found a
> workaround using a combination of tangled files and require.
>
> I separate the logic in source code blocks which then I tangle into js
> files and I require those js files in other source blocks.
>
> Example:
>
> #+BEGIN_SRC js :tangle src/parser.js
> const fs = require('fs');
> const parse = require('csv-parse')
>
> function columns(line){
> return line.map(s => s.toLowerCase());
> }
> parse_csv = function(filename, fn, limit){
> fs.readFile(filename, "utf8", function (err, fileData) {
> var opts = {columns: columns, trim: true};
> if (limit) {
> opts.to = limit;
> }
> parse(fileData, opts, (err, rows) => fn(rows));
> });
> }
> module.exports = parse_csv;
> #+END_SRC
>
> So, I tangle that source block into a js file, and then I can use it from
> other blocks, without needing sessions at all:
>
> #+BEGIN_SRC
> const parser = require("/app/src/parser.js");
> const inputFile = './data/records.csv';
> parse_csv(inputFile, console.log);
> #+END_SRC
>
> The only drawback is that you have to use absolute paths requiring the js
> files, but since I am using docker containers to run node, I always mount
> the current directory as a volume in /app inside the container, so that
> works out fine.
> I also think that this way forces me to separate the code in modular
> blocks, which is already a good practice in itself.
> With sessions you have to make sure to execute the blocks in the correct
> order to build the "state" that your current block needs.
> This way source blocks function as standalone units that can be run at any
> time, I just run *org-babel-tangle* and then hit *C-c *inside the js
> block.
>
> I hope that helps you.
>
>
> Martin
>


Re: [O] [UPDATE] Re: ob-clojure evaluate error when Org-mode buffer has ns clojure code

2017-12-21 Thread numbch...@gmail.com
Finally found a solution. really hard. spend a lot of time on this issue.
The discussion is at here:
https://github.com/clojure-emacs/clojure-mode/pull/465 Here is my final
source code. paste here as a copy. Hope can help someone want same thing.

;; auto start CIDER REPL session in a complete Leiningen project
environment for Org-mode Babel by jack-in.
(add-to-list 'org-babel-default-header-args:clojure
 '(:session . "*cider-repl ob-clojure*"))
(progn
  (find-file (expand-file-name
"~/.emacs.d/Org-mode/ob-clojure/src/ob_clojure/core.clj"))
  (cider-jack-in))

(defun ob-clojure-cider-do-not-find-ns ()
  "Fix the issue that `cider-current-ns' try to invoke
`clojure-find-ns' to extract ns from buffer."
  (with-current-buffer "*cider-repl ob-clojure*"
(defvar ob-clojure-cider-repl-ns cider-buffer-ns)
(setq-local cider-buffer-ns ob-clojuure-cider-repl-ns)))
(add-hook 'org-mode-hook #'ob-clojure-cider-do-not-find-ns)



[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Dec 19, 2017 at 5:54 PM, stardiviner <numbch...@gmail.com> wrote:

> I got new update on this issue.
>
> I think it is caused by `(clojure-find-ns)`.
> Here is my found:
>
> I created a simple clojure project for used by all org-babel-clojure src
> blocks.
> ```elisp
> (progn
>   (find-file (expand-file-name "~/.emacs.d/Org-mode/ob-clojur
> e/src/ob_clojure/core.clj"))
>   (cider-jack-in))
> ```
>
> I edebug the `org-babel-execute:clojure` process,
>
> `org-babel-execute:clojure' has a step: ~(clojure-find-ns)~ .
> This is from ~clojure-mode~. It will find current clojure buffer possible
> clojure namespace (even in org-mode). When I the following example org-mode
> buffer, it will return "namespace-not-found" error in nrepl response dict.
> Then src blcok has no error, not results.
>
> ```org
> #+BEGIN_SRC clojure :session
> (in-ns 'user-kk)
> or
> (ns user-kk)
> #+END_SRC
>
> #+BEGIN_SRC clojure :results output
> (print "hi")
> #+END_SRC
> ```
>
> Here is a part of function `clojure-find-ns`:
>
>   #+begin_src emacs-lisp
>   (when (or (re-search-backward clojure-namespace-name-regex nil t)
> ;; Or any form at all.
> (and (goto-char (point-min))
>  (re-search-forward clojure-namespace-name-regex nil
> t)))
> (match-string-no-properties 4))
>   #+end_src
>
> So I created an PR to disable find namespace in Org-mode buffer:
> https://github.com/clojure-emacs/clojure-mode/pull/465
>


Re: [O] How to include diary anniversary entries into default org-agenda?

2017-12-20 Thread numbch...@gmail.com
Sorry. I try to edit it in Emacs. but it is messed up by Gmail format.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Dec 21, 2017 at 10:40 AM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> Sorry
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Thu, Dec 21, 2017 at 10:40 AM, numbch...@gmail.com <numbch...@gmail.com
> > wrote:
>
>> I tried %%(org-anniversary 2016 12 21) Test anniversary. But this seems
>> does not work. I tested with variable diary-file default value point to
>> ~/.emacs.d/diary file. and has following content:
>>
>> %%(diary-anniversary 10 21 2016) my first child
>> <%%(diary-anniversary 10 21 2016)> my first child
>> %%(org-anniversary 2016 12 21) Test anniversary
>>
>>
>> Then I try to change diary file to an org-mode file. Has following
>> content:
>>
>> * Holiday
>>
>> %%(org-calendar-holiday)
>>
>> ** Valentine's Day
>>
>> <%%(diary-anniversary 2 14 2017)>
>>
>>
>> * Birthday
>>
>> ** My Birthday
>>
>> <%%(diary-anniversary 3 24 1990)> I'm %d%s years old today!!!
>>
>> * Anniversary
>>
>> ** my first child anniversary
>>
>> <%%(diary-anniversary 10 26 2017)>
>>
>>
>>
>> Then org-agenda shows all headlines which has anniversary entry. Like: -
>> Valentine's Day - My Birthday - my first child anniversary Without
>> considering whether the anniversary date is a day past one year? (I think
>> anniversary is by default repeat one year. Like org-mode timestamp repeat.
>> <2017-12-21 Thu +1y>) I know there are other diary anniversary syntax like:
>> - ~%%(diary-anniversary 3 24 2014)~ diary anniversary - ~%%(diary-cyclic 2
>> 7 26 2014)~ repeated diary. - ~%%(diary-block 7 26 2014 8 26 2020)~ diary
>> block - ~%%(diary-float t 5 1)~ happens every 1st Friday of the month. I
>> checked out them in Org-mode Info diary node.
>>
>> [stardiviner] GPG key ID: 47C32433
>> IRC(freeenode): stardiviner Twitter:  @numbchild
>> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
>> Blog: http://stardiviner.github.io/
>>
>> On Wed, Dec 20, 2017 at 11:40 PM, Robert Horn <rjhorn...@gmail.com>
>> wrote:
>>
>>>
>>> stardiviner writes:
>>>
>>> > I have an org-mode file:
>>> >
>>> > #+begin_src org
>>> > ,* Anniversary
>>> >
>>> > ,** my first child anniversary
>>> >
>>> > %%(diary-anniversary 10 26 2017)
>>> >
>>> > ,** Funeral Arrangement
>>> >
>>> > ,*** kk
>>> >
>>> > %%(diary-anniversary 12 8 2007)
>>> > #+end_src
>>> >
>>> > How to include and show them in default org-agenda day view by
>>> > configuring org-mode?
>>>
>>> Try org-anniversary.  The line
>>>
>>> %%(org-anniversary 2016 12 20) Test anniversary
>>>
>>> Generates an anniversary in the agenda.  In the default daily agenda it
>>> is mixed in with the tasks and deadlines, so it may be easy to miss.
>>>
>>> Note the order of the date elements is year, month, day and all three
>>> are needed.  There is an option final element of type MARK what could be
>>> used to adjust fonts and the like.
>>>
>>> R Horn
>>>
>>
>>
>


Re: [O] How to include diary anniversary entries into default org-agenda?

2017-12-20 Thread numbch...@gmail.com
Sorry

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Dec 21, 2017 at 10:40 AM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> I tried %%(org-anniversary 2016 12 21) Test anniversary. But this seems
> does not work. I tested with variable diary-file default value point to
> ~/.emacs.d/diary file. and has following content:
>
> %%(diary-anniversary 10 21 2016) my first child
> <%%(diary-anniversary 10 21 2016)> my first child
> %%(org-anniversary 2016 12 21) Test anniversary
>
>
> Then I try to change diary file to an org-mode file. Has following
> content:
>
> * Holiday
>
> %%(org-calendar-holiday)
>
> ** Valentine's Day
>
> <%%(diary-anniversary 2 14 2017)>
>
>
> * Birthday
>
> ** My Birthday
>
> <%%(diary-anniversary 3 24 1990)> I'm %d%s years old today!!!
>
> * Anniversary
>
> ** my first child anniversary
>
> <%%(diary-anniversary 10 26 2017)>
>
>
>
> Then org-agenda shows all headlines which has anniversary entry. Like: -
> Valentine's Day - My Birthday - my first child anniversary Without
> considering whether the anniversary date is a day past one year? (I think
> anniversary is by default repeat one year. Like org-mode timestamp repeat.
> <2017-12-21 Thu +1y>) I know there are other diary anniversary syntax like:
> - ~%%(diary-anniversary 3 24 2014)~ diary anniversary - ~%%(diary-cyclic 2
> 7 26 2014)~ repeated diary. - ~%%(diary-block 7 26 2014 8 26 2020)~ diary
> block - ~%%(diary-float t 5 1)~ happens every 1st Friday of the month. I
> checked out them in Org-mode Info diary node.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Wed, Dec 20, 2017 at 11:40 PM, Robert Horn <rjhorn...@gmail.com> wrote:
>
>>
>> stardiviner writes:
>>
>> > I have an org-mode file:
>> >
>> > #+begin_src org
>> > ,* Anniversary
>> >
>> > ,** my first child anniversary
>> >
>> > %%(diary-anniversary 10 26 2017)
>> >
>> > ,** Funeral Arrangement
>> >
>> > ,*** kk
>> >
>> > %%(diary-anniversary 12 8 2007)
>> > #+end_src
>> >
>> > How to include and show them in default org-agenda day view by
>> > configuring org-mode?
>>
>> Try org-anniversary.  The line
>>
>> %%(org-anniversary 2016 12 20) Test anniversary
>>
>> Generates an anniversary in the agenda.  In the default daily agenda it
>> is mixed in with the tasks and deadlines, so it may be easy to miss.
>>
>> Note the order of the date elements is year, month, day and all three
>> are needed.  There is an option final element of type MARK what could be
>> used to adjust fonts and the like.
>>
>> R Horn
>>
>
>


Re: [O] How to include diary anniversary entries into default org-agenda?

2017-12-20 Thread numbch...@gmail.com
 I tried %%(org-anniversary 2016 12 21) Test anniversary. But this seems
does not work. I tested with variable diary-file default value point to
~/.emacs.d/diary file. and has following content:

%%(diary-anniversary 10 21 2016) my first child
<%%(diary-anniversary 10 21 2016)> my first child
%%(org-anniversary 2016 12 21) Test anniversary


Then I try to change diary file to an org-mode file. Has following content:

* Holiday

%%(org-calendar-holiday)

** Valentine's Day

<%%(diary-anniversary 2 14 2017)>


* Birthday

** My Birthday

<%%(diary-anniversary 3 24 1990)> I'm %d%s years old today!!!

* Anniversary

** my first child anniversary

<%%(diary-anniversary 10 26 2017)>



Then org-agenda shows all headlines which has anniversary entry. Like: -
Valentine's Day - My Birthday - my first child anniversary Without
considering whether the anniversary date is a day past one year? (I think
anniversary is by default repeat one year. Like org-mode timestamp repeat.
<2017-12-21 Thu +1y>) I know there are other diary anniversary syntax like:
- ~%%(diary-anniversary 3 24 2014)~ diary anniversary - ~%%(diary-cyclic 2
7 26 2014)~ repeated diary. - ~%%(diary-block 7 26 2014 8 26 2020)~ diary
block - ~%%(diary-float t 5 1)~ happens every 1st Friday of the month. I
checked out them in Org-mode Info diary node.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Dec 20, 2017 at 11:40 PM, Robert Horn  wrote:

>
> stardiviner writes:
>
> > I have an org-mode file:
> >
> > #+begin_src org
> > ,* Anniversary
> >
> > ,** my first child anniversary
> >
> > %%(diary-anniversary 10 26 2017)
> >
> > ,** Funeral Arrangement
> >
> > ,*** kk
> >
> > %%(diary-anniversary 12 8 2007)
> > #+end_src
> >
> > How to include and show them in default org-agenda day view by
> > configuring org-mode?
>
> Try org-anniversary.  The line
>
> %%(org-anniversary 2016 12 20) Test anniversary
>
> Generates an anniversary in the agenda.  In the default daily agenda it
> is mixed in with the tasks and deadlines, so it may be easy to miss.
>
> Note the order of the date elements is year, month, day and all three
> are needed.  There is an option final element of type MARK what could be
> used to adjust fonts and the like.
>
> R Horn
>


Re: [O] [BUG] Re: header argument :noweb-ref seems can't be resolved

2017-12-20 Thread numbch...@gmail.com
 problem solved, Thanks very much. @Nicolas and @Berry.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Dec 20, 2017 at 8:23 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> "Berry, Charles"  writes:
>
> > Looks pretty clean. I've not had time to try it out, however.
>
> Thank you.
>
> OK. I applied it on master. Since there was some differences with maint,
> I didn't backport it there, though. Instead, I bound
> `org-babel-current-sourced-block-location' to the current block.
>
> Hopefully, the problem is now solved.
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


[O] use a src block's result as input of another src block report error: the input device is not a TTY

2017-12-19 Thread numbch...@gmail.com
Here is my example:

#+NAME: get-container-name
#+begin_src shell :results output
echo $(docker ps --format="{{.Names}}")
#+end_src

#+RESULTS: get-container-name
: elastic_thompson

#+begin_src shell :var container_name=get-container-name :noweb yes
docker exec -it $container_name pwd
# docker exec -it <> pwd
#+end_src

#+RESULTS:

But I got error:

#+begin_example
the input device is not a TTY
#+end_example


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] header argument :noweb-ref seems can't be resolved

2017-12-18 Thread numbch...@gmail.com
You're right, I searched this function through source code and dived into
them. Did not found any obvious places which might cause this issue neither.

Hope someone can help here.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Dec 19, 2017 at 12:46 AM, Berry, Charles <ccbe...@ucsd.edu> wrote:

>
>
> > On Dec 17, 2017, at 8:28 PM, stardiviner <numbch...@gmail.com> wrote:
> >
> > I can't find `org-babel-noweb-ref-resolve` in any of org-mode `master`
> branch source code.
>
>
> Sorry. I was off my medication when I wrote that. I suffer from CDD
> (Caffeine Deficit Disorder). Now I am back on my meds and can say that I
> should have typed:
>
> (org-babel-expand-noweb-references info)
>
> Is there an emoji for chagrin?
>
> Chuck
>


Re: [O] Emacs sagmentation fault error on a big org-mode file movement

2017-12-17 Thread numbch...@gmail.com
I'm doing it try to reproduce this sagment fault. but can't reproduce it
for now.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Dec 16, 2017 at 6:58 PM, Neil Jerram <n...@ossau.homelinux.net>
wrote:

> I would suggest (but without detailed knowledge of current emacs practice):
>
> 1. Report your exact emacs version.
>
> 2. Install a corresponding debug symbols package, if your distro provides
> that.  That should add a lot more interesting detail to the backtrace.
>
> 3. To go further, repro under GDB, ideally with corresponding source
> code.  Then you could explore the immediate cause of the segfault.
>
> Neil
>
> On 16/12/17 04:27, numbch...@gmail.com wrote:
>
> I have a big org-mode file which is overview at startup. When I navigate
> around with [C-v] and [M-v]. The Emacs crashed.
>
> Here is the output from command-line:
> ```
> Fatal error 11: Segmentation fault
> Backtrace:
> emacs[0x51195e]
> emacs[0x4f739a]
> emacs[0x50fe3e]
> emacs[0x510058]
> emacs[0x5100dc]
> /usr/lib/libpthread.so.0(+0x11da0)[0x7fcb1cdcada0]
> emacs[0x4caa74]
> emacs[0x45b2b5]
> emacs[0x4613e9]
> emacs[0x41eb42]
> emacs[0x42087c]
> emacs[0x42157a]
> emacs[0x421567]
> emacs[0x421567]
> emacs[0x42351d]
> emacs[0x458015]
> emacs[0x501893]
> emacs[0x50465a]
> emacs[0x5061dc]
> emacs[0x56c85e]
> emacs[0x4f7754]
> emacs[0x56c7cd]
> emacs[0x4f76eb]
> emacs[0x4fc313]
> emacs[0x4fc636]
> emacs[0x41b302]
> /usr/lib/libc.so.6(__libc_start_main+0xea)[0x7fcb1bf30f4a]
> emacs[0x41c01a]
> [1]17259 segmentation fault (core dumped)  emacs --debug-init
> ```
> Is there a way to debug this?
> I know it is not possible to invoke edebug on anything internal Emacs.
> So is there any system (Linux)  solution?
> Like system process dump or traceback.
>
> I'm using latest version `master` branch source code Org-mode.
> Emacs is from compiled `master` branch  source code too.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
>
>


Re: [O] Emacs sagmentation fault error on a big org-mode file movement

2017-12-16 Thread numbch...@gmail.com
That's very helpful . Thanks very much.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Dec 16, 2017 at 4:38 PM, Eli Zaretskii <e...@gnu.org> wrote:

> > From: "numbch...@gmail.com" <numbch...@gmail.com>
> > Date: Sat, 16 Dec 2017 12:27:58 +0800
> >
> > Is there a way to debug this?
>
> Run Emacs under a debugger, trigger the crash, and produce a more
> helpful backtrace by typing the "bt" command at GDB prompt.
>
> Please report all of that to the Emacs issue tracker using the command
> report-emacs-bug.  If you can attach the file which causes the crash,
> please do.  Further discussion of this should be on the bug list, not
> here (many Emacs developers don't read this list).
>
> Thanks.
>


[O] Emacs sagmentation fault error on a big org-mode file movement

2017-12-15 Thread numbch...@gmail.com
I have a big org-mode file which is overview at startup. When I navigate
around with [C-v] and [M-v]. The Emacs crashed.

Here is the output from command-line:
```
Fatal error 11: Segmentation fault
Backtrace:
emacs[0x51195e]
emacs[0x4f739a]
emacs[0x50fe3e]
emacs[0x510058]
emacs[0x5100dc]
/usr/lib/libpthread.so.0(+0x11da0)[0x7fcb1cdcada0]
emacs[0x4caa74]
emacs[0x45b2b5]
emacs[0x4613e9]
emacs[0x41eb42]
emacs[0x42087c]
emacs[0x42157a]
emacs[0x421567]
emacs[0x421567]
emacs[0x42351d]
emacs[0x458015]
emacs[0x501893]
emacs[0x50465a]
emacs[0x5061dc]
emacs[0x56c85e]
emacs[0x4f7754]
emacs[0x56c7cd]
emacs[0x4f76eb]
emacs[0x4fc313]
emacs[0x4fc636]
emacs[0x41b302]
/usr/lib/libc.so.6(__libc_start_main+0xea)[0x7fcb1bf30f4a]
emacs[0x41c01a]
[1]17259 segmentation fault (core dumped)  emacs --debug-init
```
Is there a way to debug this?
I know it is not possible to invoke edebug on anything internal Emacs.
So is there any system (Linux)  solution?
Like system process dump or traceback.

I'm using latest version `master` branch source code Org-mode.
Emacs is from compiled `master` branch  source code too.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] [patch] structure snippet completions

2017-12-09 Thread numbch...@gmail.com
error report when I `(require 'org-tempo)`

Debugger entered--Lisp error: (error "Format specifier doesn’t match
argument type")
  format("<%c" "Q")
  (closure (t) (pair) (format "<%c" (car pair)))(("Q" "#+BEGIN_SRC sql-mode
?\n\n#+END_SRC" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC"))
  mapcar((closure (t) (pair) (format "<%c" (car pair))) (("Q" "#+BEGIN_SRC
sql-mode ?\n\n#+END_SRC" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC") ("n"
"#+BEGIN_NOTES\n?\n#+END_NOTES") (116 . "translate") (97 . "export ascii")
(99 . "center") (67 . "comment") (101 . "example") (69 . "export") (104 .
"export html") (108 . "export latex") (113 . "quote") (115 . "src") (118 .
"verse") (76 . "latex") (72 . "html") (65 . "ascii") (105 . "index")))
  (let ((keys (mapcar (function (lambda (pair) (format "<%c" (car pair
(append org-structure-template-alist org-tempo-keywords-alist (if (>
(length keys) (length (delete-dups keys))) (progn (warn "Duplicated keys in
`org-structure-template-alist' and `org-tempo-keywords-alist'"))) (mapc
(function (lambda (key) (if (assoc-string key org-tempo-tags) (setq
org-tempo-tags (delete (assoc-string key org-tempo-tags)
org-tempo-tags) keys) (mapc (function org-tempo-add-block)
org-structure-template-alist) (mapc (function org-tempo-add-keyword)
org-tempo-keywords-alist))
  org-tempo-add-templates()
  org-tempo-setup()
  (progn (org-tempo-setup))
  (if (eq major-mode 'org-mode) (progn (org-tempo-setup)))
  eval-buffer(# nil
"/home/stardiviner/Code/Emacs/org-mode/lisp/org-tempo.el" nil t)  ; Reading
at buffer position 5019

load-with-code-conversion(#1="/home/stardiviner/Code/Emacs/org-mode/lisp/org-tempo.el"
#1# nil t)
  require(org-tempo)


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Dec 9, 2017 at 5:20 AM, Rasmus  wrote:

> "Berry, Charles"  writes:
>
> >> On Dec 7, 2017, at 3:37 PM, Rasmus  wrote:
> >>
> >> I have also pushed the code.  " >> enabled by requiring org-tempo.
> >>
> >
> > Thanks. I was in a deep funk without " now.
>
> I am happy that I am able to help you for once!
>
> >> Let me know about any issues.
> >>
> >
> > Maybe make `tempo-match-finder' be "^ *\\(<[[:word:]]+\\)" so it will
> > match things like " > the user customize it.
>
> At the moment snippets with more than one character isn’t supported.  Note
> that the car of org-structure-template-alist elements is now a character.
> "Snippet-strings" (like "la") will be re-added soon cf. the email from
> Eric earlier on in this thread.
>
>
> > A minor gotcha: if you `(require 'org-tempo)' after an org buffer has
> > been created you will need to (org-mode-restart) the buffer to enable
> > completions.  I got stuck trying to add custom templates until I
> > realized this.
>
> It shouldn’t do that since this is near the bottom of org-tempo:
>
> (when (eq major-mode 'org-mode) (org-tempo-setup))
>
> On my system it works in the first buffer where I require org-tempo, even
> without reloading.
>
> Which version of Emacs are you using?
>
> Rasmus
>
> --
> A clever person solves a problem. A wise person avoids it
>
>
>


Re: [O] Want help for a helper function which send current link file under point to Kindle path.

2017-12-01 Thread numbch...@gmail.com
Does anyone knows how to get the link at the point in Org-mode?
For example:
Get the "Data/Books/kk.epub" part of [[file:Data/Books/kk.epub][kk.epub]]

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jul 13, 2017 at 8:29 AM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> I want to write a helper function to send the link file (usually ebooks)
> under the point to Kindle path like (/run/media/username/Kindle/
> documents/).
> Hope this function can provide the following functionalities:
>
> - check whether the source file (ebook) exist in Kindle?
> - check the source file format, if not Kindle supported, then convert it
> with command `ebook-convert` which is comes from program "Calibre".
>
> I wander how to get the link actual path under the point?
> For example, org link like this:
>
> [[file:Data/Books/kk.epub][kk.epub]]
> [[file+sys:/home/username/Documents/kk2.mobi][kk2.mobi]]
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>


Re: [O] What about a space when inserting a src-block?

2017-12-01 Thread numbch...@gmail.com
+1, aggreed, I wish a better keybinding too.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Dec 2, 2017 at 2:47 AM, Matt Lundin  wrote:

> Marco Wahl  writes:
>
> > My impression is that one always types a blank after calling
> > `org-insert-structure-template' {C-c C-x w s} for creating a src block.
> >
> > Suggestion: Realize the insert of a space after "#+begin_src" in
> > `org-insert-structure-template'.
> >
> > WDYT?
>
> +1
>
> Also, before this becomes part of an official release, might I also
> suggest that we consider changing the default keybinding. I am finding
> the "C-c C-x w" binding a bit too close to "C-c C-x C-w," which calls
> org-cut-special. I've accidentally lost a couple of subtrees without
> noticing.
>
> Matt
>
>
>


Re: [O] ob-shell and remote shells

2017-11-28 Thread numbch...@gmail.com
Off the topic, I'm curious what is the `:session` in `ob-shell` ?

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Nov 28, 2017 at 4:45 PM, Michael Welle  wrote:

> Hello,
>
> I want to execute shell blocks like follows:
>
> #+BEGIN_SRC shell :session n42 :dir /127.0.0.1: :shebang "#!/bin/bash"
> echo los
> echo $SHELL
> echo $BASH
> echo ready
> #+end_src
>
> The trouble is that the shebang property doesn't work in this case. The
> script is executed with the login shell of the user and fails because of
> syntax errors (for instance, if bashisms are used in the script).
>
> With my minimal and dangerous knowledge about Org's source code ;), I
> think the following might work (from ob-shell.el):
>
> (defun org-babel-sh-initiate-session ( session _params)
>   "Initiate a session named SESSION according to PARAMS."
>   (when (and session (not (string= session "none")))
> (save-window-excursion
>   (or (org-babel-comint-buffer-livep session)
>   (progn
> (let ((explicit-shell-file-name (xxx)))
> (shell session))
> ;; Needed for Emacs 23 since the marker is initially
> ;; undefined and the filter functions try to use it without
> ;; checking.
> (set-marker comint-last-output-start (point))
> (get-buffer (current-buffer)))
>
>
> Note the let form. Further tasks that have to be done is to add the
> shebang key to _params, which I hope is available at all places where
> o-b-s-i-s is evaluated. Further at (xxx) a regexp etc. is needed to
> transform the shebang line to a shell path suitable for e-s-f-n.
>
> Any opinions, please? Depending on the opinions I will implement the
> approach this week and see if it works as expected.
>
> Regards
> hmw
>
>


Re: [O] Possible bug: Headings greater than level 2 stars not showing -- unable to navigate with normal commands

2017-11-26 Thread numbch...@gmail.com
Yes, I have same issue too.
- [ ] org-indent-mode display the 3rd level asterisk as bold
- [ ] I can't =[C-c C-f]=
And confirmed it is caused by commit ed06b159c | * Small fix to emphasis
fontification.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Nov 27, 2017 at 12:11 PM, Kyle Meyer  wrote:

> "Samuel W. Flint"  writes:
>
> >> Samuel W Flint writes:
> >
> >> Kyle Meyer writes:
> > KM> "Samuel W. Flint"  writes:
> > >>> Any idea what might be causing this?  I checked
> > >>> org-bullets-mode, but that doesn't seem to be it.
> >
> > KM> No, sorry.  Hopefully others might have a hunch.  I'd suggest
> > KM> that you first verify that you don't see the issue when you use
> > KM> Org without your configuration.  Assuming the problem depends on
> > KM> your config, you could then do a bisect-like debugging of your
> > KM> config to try to pinpoint the problematic part.
> >
> > SF> Well, hopefully it doesn't come to that (too damn large a
> > SF> config).
> >
> > And it didn't quite!  Turns out that setting org-hide-emphasis-markers
> > to a non-nil value was the problem.
>
> Nice, glad you found it.  I can reproduce the issue with 'emacs -Q' when
> I set org-hide-emphasis-markers to a non-nil value.
>
> Bisecting the repo, I think ed06b159c (Small fix to emphasis
> fontification, 2017-11-18) is to blame.  That patch resulted from the
> discussion at 
> .
>
> --
> Kyle
>
>


Re: [O] Public TODO agendas

2017-11-21 Thread numbch...@gmail.com
Maybe just use an auto sync solution like Dropbox, WebDAV etc?
And add a hook on `after-save-hook` to auto export org file to HTML, then
sync HTML files.
Somewhere hosting those HTML files can be viewed. and editing those
original org files directly.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Nov 21, 2017 at 5:07 AM, Tim Cross <theophil...@gmail.com> wrote:

>
> I don't think tramp will work in this way, at least not without some
> sort of special client running on the remote http server and
> modifications to tramp to work with that client. The HTTP protocol will
> not easily fit with tramp - in fact, it is such a big 'disconnect'
> between tramp and http, you really would be trying to push a round peg
> into a square hole. It would be far easier to use other built-in bits of
> Emacs functionality along with some sort of remote http service agent to
> satisfy this use case (assuming you want bi-directional updates
> i.e. pull down an org file, update and push back up - just pulling down
> the file and appending it would be easy enough, but going the other way
> adds a lot of additional complexity).
>
> Perhaps this is more something which could fit in with mobile org
> efforts?
>
> Tim
>
>
>
> Eric S Fraga <esfli...@gmail.com> writes:
>
> > On Monday, 20 Nov 2017 at 21:13, numbch...@gmail.com wrote:
> >> I have similar function requirement. Based on your TRAMP method, I think
> >> remote file are just can be transported through any protocols like HTTP,
> >> for example remote file like http://example.org/test.org can be
> downloaded,
> >> then append to org-agenda files list. This is just an rough idea.
> >
> > I am not sure this is possible.  If I try http: as the protocol, tramp
> > tells me that only localhost is allowed.  Maybe I do not have tramp
> > configured properly?
>
>
> --
> Tim Cross
>


Re: [O] Public TODO agendas

2017-11-20 Thread numbch...@gmail.com
I have similar function requirement. Based on your TRAMP method, I think
remote file are just can be transported through any protocols like HTTP,
for example remote file like http://example.org/test.org can be downloaded,
then append to org-agenda files list. This is just an rough idea.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Nov 20, 2017 at 3:54 AM, Eric S Fraga  wrote:

> On Sunday, 19 Nov 2017 at 11:10, David Arroyo Menendez wrote:
> > Hello Colin,
> >
> > org-secretary seems designed to manage teams. I want read agendas of
> > org-mode users, friends ... In Barcelona Supercomputing Center all
> > people is sharing the agendas to stimulate to the people to collaborate
> > in good ideas, I like this methodology, but I prefer use org-mode. Many
> > people in org-mode is connected with the science or creative
> > programming, perhaps is a good idea share the agenda between us.
>
> I guess one approach could be to make specific agenda files available on
> a remote server and use tramp syntax to add these files to the
> org-agenda-files variable?  (untested)  Of course, this would be limited
> to those access methods defined for tramp, i.e. ssh in practice, which
> might be quite limiting.
>
> A more general approach would be to export your agenda to Google's
> calendar or equivalent and share that and import any shared calendar
> using an ical access to these.  This is possible (my wife and I share our
> calendars that way) but not purely org.
>
>
> --
> : Eric S Fraga via Emacs 27.0.50, Org release_9.1.3-162-gde289d
>


Re: [O] function for inserting a block

2017-11-17 Thread numbch...@gmail.com
Ok, I see, Just I have to replace all uppercased babels and example blocks
to lowercase to keep same.
I have a lot of org files. Huge for me.
I can take with the lower-case tag.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Nov 18, 2017 at 3:14 AM, Eric Abrahamsen <e...@ericabrahamsen.net>
wrote:

> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > Yeah, I misunderstand your code. Anyway, It should be like this:
> >
> > #+BEGIN_SRC python
> > ...
> > #+END_SRC
> >
> > #+BEGIN_EXAMPLE
> > ...
> > #+END_EXAMPLE
> >
> > etc
>
> If you look back up this (admittedly very long) thread, you'll see the
> general consensus is to move to lower-case tags. I've intentionally left
> things lowercase, and now will have to handle "example" specially, based
> on the value of `org-babel-uppercase-example-markers'.
>
>
>


Re: [O] function for inserting a block

2017-11-17 Thread numbch...@gmail.com
Yeah, I misunderstand your code. Anyway, It should be like this:

#+BEGIN_SRC python
...
#+END_SRC

#+BEGIN_EXAMPLE
...
#+END_EXAMPLE

etc

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Nov 16, 2017 at 12:24 AM, Eric Abrahamsen <e...@ericabrahamsen.net>
wrote:

> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > I think the function `org-insert-structure-template' also should
> respect the `org-babel-uppercase-example-markers'.
> > Besides, your new diff does not have a condition on
> `org-babel-uppercase-example-markers', you just use `upcase-initials` by
> default. Then the new `tempo` snippets
> > will be uppercase, but the `org-insert-structure-template` inserted
> templates will be different.
>
> I'm not entirely understanding you here -- it is
> `org-insert-structure-template' that respects
> `org-babel-uppercase-example-markers', not the tempo snippet (which was
> an omission). And none of the code is using `upcase-initials'.
>
> As far as I can see, the bug is that EXAMPLE is uppercased but the
> "begin" and "end" aren't, and also that the tempo snippet doesn't
> capitalize at all...
>


Re: [O] ob-haskell evaluation needs inf-haskell but it does not exist

2017-11-17 Thread numbch...@gmail.com
I setted `haskell-process-type` to 'ghci.
I evaluated a simple haskell src block, but it reports I need have a
`*haskell*` inferior. Then I executed command [M-x run-haskell].
Then I get error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  locate-dominating-file(nil "cabal.sandbox.config")
  haskell-process-type()
  haskell-program-name-with-args()
  inferior-haskell-start-process()
  inferior-haskell-process()
  run-haskell()
  funcall-interactively(run-haskell)
  call-interactively(run-haskell record nil)
  command-execute(run-haskell record)
  #f(compiled-function (cmd) #)("run-haskell")
  ivy-call()
  ivy-read("M-x " [special-lispy-clone
  
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Nov 15, 2017 at 11:35 PM, Nick Dokos <ndo...@gmail.com> wrote:

> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > I checked out your answer, I have meet all your said requirements. GHCi,
> inf-haskell (after I installed package haskell-mode) and setting
> `haskell-program-name`, I found there is no
> > `defcustom` variable option named `haskell-program-name` at all.
>
> You probably need to set haskell-process-type to ghci. If that works,
> please let me know and I'll update the answer on SO.
>
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> > On Wed, Nov 15, 2017 at 9:17 PM, numbch...@gmail.com <
> numbch...@gmail.com> wrote:
> >
> > I required `(require 'inf-haskell)` But have not found the command
> `inf-haskell` to start inferior process.
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> > On Mon, Nov 13, 2017 at 11:43 PM, Nick Dokos <ndo...@gmail.com>
> wrote:
> >
> > stardiviner <numbch...@gmail.com> writes:
> >
> > > When I execute the following Haskell src block:
> > >
> > > ```
> > >
> > > #+BEGIN_SRC haskell :session :tangle "Data/Code/hello_world.hs"
> > > main :: IO ()
> > > main = do
> > >   putStrLn "Hello, World!"
> > > #+END_SRC
> > >
> > > ```
> > >
> > > It reports error:
> > >
> > > ```
> > >
> > > Debugger entered--Lisp error: (file-missing "Cannot open load
> file" "No
> > > such file or directory" "inf-haskell")
> > >   require(inf-haskell)
> >
> > See my answer to this SO question:
> >
> >   https://stackoverflow.com/questions/42081379/how-to-set-
> up-org-babel-for-haskell-with-stack
> >
> > for some details on setting up the environment.
> >
> > --
> > Nick
> >
>
> --
> Nick
>
>
>


Re: [O] ob-haskell evaluation needs inf-haskell but it does not exist

2017-11-15 Thread numbch...@gmail.com
I checked out your answer, I have meet all your said requirements. GHCi,
inf-haskell (after I installed package haskell-mode) and setting
`haskell-program-name`, I found there is no `defcustom` variable option
named `haskell-program-name` at all.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Nov 15, 2017 at 9:17 PM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

> I required `(require 'inf-haskell)` But have not found the command
> `inf-haskell` to start inferior process.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Mon, Nov 13, 2017 at 11:43 PM, Nick Dokos <ndo...@gmail.com> wrote:
>
>> stardiviner <numbch...@gmail.com> writes:
>>
>> > When I execute the following Haskell src block:
>> >
>> > ```
>> >
>> > #+BEGIN_SRC haskell :session :tangle "Data/Code/hello_world.hs"
>> > main :: IO ()
>> > main = do
>> >   putStrLn "Hello, World!"
>> > #+END_SRC
>> >
>> > ```
>> >
>> > It reports error:
>> >
>> > ```
>> >
>> > Debugger entered--Lisp error: (file-missing "Cannot open load file" "No
>> > such file or directory" "inf-haskell")
>> >   require(inf-haskell)
>>
>> See my answer to this SO question:
>>
>>   https://stackoverflow.com/questions/42081379/how-to-set-up-
>> org-babel-for-haskell-with-stack
>>
>> for some details on setting up the environment.
>>
>> --
>> Nick
>>
>>
>>
>


Re: [O] ob-haskell evaluation needs inf-haskell but it does not exist

2017-11-15 Thread numbch...@gmail.com
I required `(require 'inf-haskell)` But have not found the command
`inf-haskell` to start inferior process.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Nov 13, 2017 at 11:43 PM, Nick Dokos <ndo...@gmail.com> wrote:

> stardiviner <numbch...@gmail.com> writes:
>
> > When I execute the following Haskell src block:
> >
> > ```
> >
> > #+BEGIN_SRC haskell :session :tangle "Data/Code/hello_world.hs"
> > main :: IO ()
> > main = do
> >   putStrLn "Hello, World!"
> > #+END_SRC
> >
> > ```
> >
> > It reports error:
> >
> > ```
> >
> > Debugger entered--Lisp error: (file-missing "Cannot open load file" "No
> > such file or directory" "inf-haskell")
> >   require(inf-haskell)
>
> See my answer to this SO question:
>
>   https://stackoverflow.com/questions/42081379/how-to-set-
> up-org-babel-for-haskell-with-stack
>
> for some details on setting up the environment.
>
> --
> Nick
>
>
>


Re: [O] function for inserting a block

2017-11-15 Thread numbch...@gmail.com
I think the function `org-insert-structure-template' also should respect
the `org-babel-uppercase-example-markers'.
Besides, your new diff does not have a condition on
`org-babel-uppercase-example-markers', you just use `upcase-initials` by
default. Then the new `tempo` snippets will be uppercase, but the
`org-insert-structure-template` inserted templates will be different.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Nov 15, 2017 at 5:36 AM, Eric Abrahamsen 
wrote:

> "Thomas S. Dye"  writes:
>
> > Eric Abrahamsen writes:
> >
> >> Rasmus  writes:
> >>
> >>> Hi Eric,
> >>>
> >>> Eric Abrahamsen  writes:
> >>>
> > Also, Eric, it seems that org-structure-template-alist only supports
> a
> > single letter for short-hands (the car of an entry in
> > org-structure-template-alist is a char).  I used to have blocks like
> " > expanding to an "abstract" special-block, which I guess isn’t
> possible
> > anymore?
> 
>  I hadn't thought of that. Really, all I ever wanted was to wrap things
>  in blocks...
> 
>  I don't see any reason why org-structure-template-alist couldn't go
> back
>  to using string keys. Then we could use read-string, and wouldn't have
>  to have special  behavior -- a string that didn't exist in the
>  alist could just be used literally to make a block.
> >>>
> >>> I’d prefer that.  For some special blocks, a few characters might
> makes it
> >>> more intuitive, e.g. "def" → "definition", "hyp" → "hypothesis" etc.
> >>
> >> Here's the simplest solution.
> >>
> >> There still remains the fact that `org-structure-template-alist' has
> >> changed format, and `org-try-structure-completion' no longer exists.
> >> That may still annoy some people who were using the internals of the
> >> process, but...
> >
> > Would something like this work?
> >
> > (defun org-try-structure-completion ()
> >   (tempo-complete-tag))
>
> Here's the newest version!
>
> It incorporates Rasmus' org-tempo.el file, with modifications, and
> Thomas' suggestion to re-instate `org-try-structure-completion', and,
> erm, stardiviner's request to honor
> `org-babel-uppercase-example-markers'.
>
> Remaining issues:
>
> 1. The "org-include" tempo template doesn't work, for reasons I don't
>understand (I've never used tempo before). Nothing happens when I hit
>.
> 2. Now it seems like there should be completion when prompting for a
>string key. Feature creep! But likely worthwhile feature creep.
> 3. I've rather rashly renamed the relevant customization options
>`org-structure-block-alist' (for blocks added via
>`org-insert-structure-template') and `org-structure-keyword-alist'
>(for keywords insertable via the tempo system). Perhaps this was a
>bad idea. If it's not a bad idea, maybe
>`org-insert-structure-template' should be renamed `org-insert-block'
>or something like that.
> 3. Docs need to be updated.
>
> Comments welcome!
>
> Eric
>
>


Re: [O] Org-mode link returned path is truncated when contains space

2017-11-11 Thread numbch...@gmail.com
sorry for delay reply. I'm cleaning up my Org tasks, found this task. this
issue seems fixed.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jun 6, 2017 at 6:49 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr>
wrote:

> Hello,
>
> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > I checked Org-mode package version with `org-version`, get `9.0.7`, still
> > have this issue. I updated to latest org-mode ELPA version.
>
> Odd. You may have better luck with Org 9.0.8 then. In particular, commit
> 2d29269bb1b9af08011e091913798b6598e4b156 should prevent path from being
> truncated.
>
> Please report back if it works better (or not).
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] function for inserting a block

2017-11-11 Thread numbch...@gmail.com
+1 I added a snippet for ` wrote:

> Carsten Dominik  writes:
>
> > I have always come down on the side of NOT breaking backward
> > compatibility unless we really HAVE TO in order to make progress. The
> > reason for this bias is because most Org users are not reading this
> > maling list and just want the system to function and to continue to
> > function the way they are used to, while it is hopefully improving. It
> > will stop them from upgrading if such breakage happens too often.
> >
> > So I would support reimplement the expansion (including
> > org-try-structure-completion for people who use that in custom code),
> > if possible of course on the back of one of the built-in expansion
> > systems in Emacs, before pushing this change out in a release. I would
> > certainly reimplement this in some way for myself, because using these
> > abbreviations is already hardcoded in my spine, I think.
>
> I agree. I support removing redundant code behind the scenes, but I also
> think we should preserve backwards compatibility in the user interface.
> A fair number of people around here have been using Org Mode for more
> than a decade, and, for better or for worse, everything about the user
> interface is now hardwired in their brains.
>
> In short, we have a time-saving expansion system that works well for
> lots of people. I support re-implementing it on top of another snippet
> engine but also leaving it in place until a suitable replacement is
> ready.
>
> Matt
>
>
>


[O] The new function org-insert-structure-template is not following option org-babel-capitalize-example-region-markers

2017-11-09 Thread numbch...@gmail.com
RT.
Hope Org-mode can fix this issue.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] [RFC] Remove Org Struct mode

2017-08-20 Thread numbch...@gmail.com
I agree too, because the OrgStruct mode functions is so limited for basic
Org-mode viewing/editing/navigating etc.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Aug 21, 2017 at 6:06 AM, Tim Cross  wrote:

>
> One of the reasons I moved to using mu4e for email was because I was
> told I could use orgStruct mode and write my email using org structured
> editing.
>
> The reality has been somewhat disappointing. One of the main things I
> wanted was better handling of lists and this is one area of orgstruct
> mode which certainly doesn't work correctly.
>
> So, given what you say and the fact the mode isn't working as
> advertised, I tend to agree. Just adding a note to my org task list to
> look at outshine.el, which I wasn't aware of. If I really need org
> structural editing for writing an email, I'll write it in an org-mode
> file and then transfer it to a message buffer - as you point out, there
> is lots in org mode which makes no sense in an email buffer anyway!
>
> Tim
>
> Nicolas Goaziou writes:
>
> > Hello,
> >
> > I would like to remove Org Struct minor mode from Org code base. Here is
> > the rationale:
> >
> > 1. It is broken. It might look like using Org in another buffer, but it
> >is not. In particular, it just cannot cope with lists, indentation,
> >filling in, e.g., Message mode, as soon as we try something
> >non-trivial. Really, that's a poor-man's Org mode.
> >
> > 2. Its implementation is very hackish. In particular, it is not modular
> >at all. It rewrites some core functions according to the major mode
> >in use. For example `org-fill-function' tries to handle specially
> >text in a Message mode buffer, basically short-circuiting regular
> >behaviour. There no support for other major modes. If we want some,
> >we need to hard-code it.
> >
> > 3. Due to previous point, some basic Org functions are sub-optimal
> >because they preserve compatibility with Org Struct mode. For example
> >`org-forward-heading-same-level' must process every headline past the
> >current one and check their level until an appropriate one is found.
> >It would be faster to go looking for the next headline according to
> >the number of stars we want.
> >
> > 4. It is somewhat outside Org mode's scope to provide such a feature. It
> >is tempting to provide everything we can think of, but we should
> >focus on the main task: handle Org files, i.e., files written in Org
> >compatible syntax.
> >
> > 5. There are alternatives. E.g., outshine.el, outline-minor-mode, ...
> >
> > I _do_ use `orgstruct++-mode'. But it is broken beyond repair.
> > Alternatives, which do not need to pay a technical debt, are certainly
> > better, or, at least, a saner ground for improvement.
> >
> > I'm not opposed to an Org struct mode living in ELPA. But, as pointed
> > out, it is difficult to extract from code base without rewriting it
> > completely. If alternatives are serious enough, that would be
> > re-inventing the wheel, too.
> >
> > The only thing that would be missing, AFAIK, is plain list handling.
> > However, I'm quite certain it is possible to re-use most code from
> > "org-list.el", using a dumbed down `org-list-struct' function. Indeed,
> > currently, `org-list-struct' requires to know about inlinetasks,
> > drawers, blocks... i.e., most of the Org syntax. This is not an option
> > in foreign buffers. Once `org-list-struct' (and maybe `org-in-item-p')
> > are simplified, other functions in "org-list.el" can be used as is.
> >
> > I'm not talking about OrgTbl mode (yet). OrgTbl mode is different: it
> > doesn't suffer from points 1, 3 end 5. It is easier to extract it as an
> > external library, which someone should ultimately do.
> >
> > To sum it up, I offer to remove `orgstruct-mode' (and
> > `orgstruct++-mode') from the code base. I can also offer my help to
> > anyone willing to extract some `list-minor-mode' and `table-minor-mode'
> > from Org.
> >
> > WDYT?
> >
> >
> > Regards,
>
>
> --
> Tim Cross
>
>


Re: [O] [Feature Request] Provide a way to jump to noweb reference definition under point

2017-08-16 Thread numbch...@gmail.com
@Thanks Berry, and Nicolas.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Aug 14, 2017 at 1:02 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> "Berry, Charles"  writes:
>
> > However, there is a bug in either ~org-next-block~ or
> > ~org-babel-src-block-names~ that causes failure of
> > `org-babel-src-block-names' to pick up the first block when it starts
> > in the first line of a buffer or at ~(point-min)~.
>
> Fixed. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] [Feature Request] Provide a way to jump to noweb reference definition under point

2017-08-13 Thread numbch...@gmail.com
For example I have an Org buffer like this:

```org
#+NAME: define food-journal
#+BEGIN_SRC clojure
(def food-journal
  [{:month 1 :day 1 :human 5.3 :critter 2.3}
   {:month 1 :day 2 :human 5.1 :critter 2.0}
   {:month 2 :day 1 :human 4.9 :critter 2.1}
   {:month 2 :day 2 :human 5.0 :critter 2.5}
   {:month 3 :day 1 :human 4.2 :critter 3.3}
   {:month 3 :day 2 :human 4.0 :critter 3.8}
   {:month 4 :day 1 :human 3.7 :critter 3.9}
   {:month 4 :day 2 :human 3.7 :critter 3.6}])
#+END_SRC

#+BEGIN_SRC clojure
<>

(take-while #(< (:month %) 3) food-journal)
#+END_SRC
```

The point is at `<>`. Hope org-mode can provide and
shortcut to jump to noweb reference definition `#+NAME: define
food-journal`.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: [O] ob-clojure will error result when contains comment

2017-07-13 Thread numbch...@gmail.com
I run the both blocks fine in CIDER REPL, that's weird.
I have the following special settings for ob-clojure.
```elisp
(add-to-list 'org-babel-default-header-args:clojure
 '(:eval . "yes"))
(add-to-list 'org-babel-default-header-args:clojure
 '(:results . "value pp"))
(add-to-list 'org-babel-default-header-args:clojure ; for Clojure `dotimes'
etc.
 '(:show-process . "no"))
(add-to-list 'org-babel-default-header-args:clojure
 '(:noweb . "yes"))
```


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jul 13, 2017 at 4:48 PM, Tim Cross <theophil...@gmail.com> wrote:

>
> I think there is something wrong with your environment and your second
> block is not legal code. If you run your second block directly in a
> clojure repl, you will get the same errors, which means it isn't an org
> issue.
>
> Executing your examples with org from master branch I get
>
> #+BEGIN_SRC clojure
> (+ 1 1) ;=> 2
> #+END_SRC
>
> #+RESULTS:
> : 2
>
> #+BEGIN_SRC clojure :results value
> (def sum1 #(reduce + %))
> (def avg1 #(/ (sum %) (count %)))
>
> (defn stats
>   [numbers]
>   (map #(% numbers) [sum1 count avg1]))
>
> (stats [3 4 10])
>
> (stats [80 1 44 13 6])
>
> #+END_SRC
>
> #+RESULTS:
> : #'user/sum1#'user/statsclass clojure.lang.Compiler$CompilerExceptionclass
> java.lang.IllegalStateExceptionclass java.lang.IllegalStateExceptionclass
> clojure.lang.Compiler$CompilerExceptionclass 
> java.lang.IllegalStateExceptionclass
> java.lang.IllegalStateExceptionCompilerException
> java.lang.RuntimeException: Unable to resolve symbol: sum in this context,
> compiling:(/tmp/form-init6637865895670060372.clj:2:15)
> : IllegalStateException Attempting to call unbound fn: #'user/avg1
> clojure.lang.Var$Unbound.throwArity (Var.java:43)
> : IllegalStateException Attempting to call unbound fn: #'user/avg1
> clojure.lang.Var$Unbound.throwArity (Var.java:43)
>
> I'm not sure why the version of ob-clojure.el is not yet in the org or
> org-plus-contrib packages - Does master only become maint after major
> version releases?
>
> Note also, there appears to be an issue with most recent versions of
> cider when you do cider-jack-in and your not inside a project. The
> issues seem to relate mainly to clj-refactor, but there could be other
> problems. Again, highly recommend running your cider inside a clojure
> project.
>
> Tim
>
> numbch...@gmail.com writes:
>
> > Here is the examples:
> >
> > #+BEGIN_SRC clojure
> > (+ 1 1) ;=> 2
> > #+END_SRC
> >
> > #+RESULTS:
> > : class clojure.lang.LispReader$ReaderExceptionclass
> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
> at
> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
> >
> > #+BEGIN_SRC clojure :results value
> > (def sum1 #(reduce + %))
> > (def avg1 #(/ (sum %) (count %)))
> >
> > (defn stats
> >   [numbers]
> >   (map #(% numbers) [sum1 count avg1]))
> >
> > (stats [3 4 10])
> > ;; => (17 3 17/3)
> >
> > (stats [80 1 44 13 6])
> > ;; => (144 5 144/5)
> > #+END_SRC
> >
> > #+RESULTS:
> > : class clojure.lang.LispReader$ReaderExceptionclass
> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
> at
> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
> >
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
>
>
> --
> Tim Cross
>


Re: [O] ob-sh.el removed in master branch source code?

2017-07-12 Thread numbch...@gmail.com
Thanks, that's might because Emacs old org-mode version.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jul 13, 2017 at 8:44 AM, Kaushal Modi <kaushal.m...@gmail.com>
wrote:

> That's a very old incompatible change:
>
> * Version 8.2
>
> ** Incompatible changes
>
> *** =ob-sh.el= renamed to =ob-shell= This may require two changes in user
> config.
>
> 1. In =org-babel-do-load-languages=, change =(sh . t)= to =(shell . t)=.
>
> 2. Edit =local.mk= files to change the value of =BTEST_OB_LANGUAGES= to
> remove "sh" and include "shell".
> http://orgmode.org/cgit.cgi/org-mode.git/plain/etc/ORG-NEWS
>
>
> On Wed, Jul 12, 2017, 8:26 PM numbch...@gmail.com <numbch...@gmail.com>
> wrote:
>
>> RT
>> I checked `ORG-NEWS` and git log history. Have not found this change in
>> recent commits.
>> Can someone explain this?
>>
> --
>
> Kaushal Modi
>


Re: [O] Emacs master now updated to Org 9.0.9

2017-07-12 Thread numbch...@gmail.com
Thanks for your work.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jul 4, 2017 at 3:54 PM, Bastien Guerry  wrote:

> Indeed, thanks to you and to everyone involved.
>
> I'm very grateful everyone has been patiently baring
> with me for this task.
>
> --
>  Bastien
>
>


Re: [O] Org-mode ELPA repository package is not very updated?

2017-07-12 Thread numbch...@gmail.com
After some tries, I use org-mode source code `master` branch now. use
extension `use-package` to load it. It works very fine.
Thanks.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Jul 3, 2017 at 1:31 PM, Bastien <b...@gnu.org> wrote:

> Hi,
>
> "numbch...@gmail.com" <numbch...@gmail.com> writes:
>
> > I found Org-mode ELPA released source code is old and does not
> > include some patches and updates.
>
> This should be fixed now -- please confirm in a few days.
>
> --
>  Bastien
>


[O] ob-clojure will error result when contains comment

2017-07-12 Thread numbch...@gmail.com
Here is the examples:

#+BEGIN_SRC clojure
(+ 1 1) ;=> 2
#+END_SRC

#+RESULTS:
: class clojure.lang.LispReader$ReaderExceptionclass
java.lang.RuntimeExceptionRuntimeException EOF while reading, starting at
line 1  clojure.lang.Util.runtimeException (Util.java:221)

#+BEGIN_SRC clojure :results value
(def sum1 #(reduce + %))
(def avg1 #(/ (sum %) (count %)))

(defn stats
  [numbers]
  (map #(% numbers) [sum1 count avg1]))

(stats [3 4 10])
;; => (17 3 17/3)

(stats [80 1 44 13 6])
;; => (144 5 144/5)
#+END_SRC

#+RESULTS:
: class clojure.lang.LispReader$ReaderExceptionclass
java.lang.RuntimeExceptionRuntimeException EOF while reading, starting at
line 1  clojure.lang.Util.runtimeException (Util.java:221)


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


  1   2   >