Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2023-05-13 Thread stardiviner
I applied your diff with a testing. This indeed solved the performance
issue.
Will this be updated in Org-mode source code?
Also I come up with one thing, filter out tags which have shortcut
keybinding bound. Because user defined shortcut key defined tags are not
always on head of list.

[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, May 13, 2023 at 3:39 PM Ihor Radchenko  wrote:

> stardiviner  writes:
>
> > I have a large `org-tag-alist` value that contains about ~7000 tags.
> > When I press [C-c C-q] `org-set-tags-command`. Emacs suspends a long
> time.
>
> Indeed. That's because `org-fast-tag-selection' tries to put all those
> 7k tags into tag selection window.
>
> We can probably limit the maximum number of tags in the quick selection
> window.
>
> Can you try the attached simple diff for `org-fast-tag-selection' and
> check if it is enough to solve the hang?
>
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


Improve the performance of `org-set-tags-command` on large `org-tag-alist`

2023-05-12 Thread stardiviner
I have a large `org-tag-alist` value that contains about ~7000 tags.
When I press [C-c C-q] `org-set-tags-command`. Emacs suspends a long time.

Here are the profiler reports in the attachments.

I hope this can be improved the performance.

[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/


cpu.profiler
Description: Binary data


memory.profiler
Description: Binary data


[Need Help] Error to evaluate "mpv" command in inline src block

2023-04-29 Thread stardiviner
*** Reproduce and experience log

I have Emacs Org mode config like bellowing to auto evaluate inline src
block when Org headline cycle expanded.

#+begin_src emacs-lisp
;;; auto evaluate inline source block in property "EVAL".

(defcustom org-property-eval-keyword "EVAL"
  "A property keyword for evaluate code."
  :type 'string
  :safe #'stringp
  :group 'org)

(add-to-list 'org-default-properties org-property-eval-keyword)

(defun org-property-eval-on-cycle-expand ( state)
  "Evaluate Org inline source block in property value on headline cycle
expand."
  (when (memq state '(children subtree))
(if-let ((inline-src-block (org-entry-get nil org-property-eval-keyword
nil)))
(with-temp-buffer
  (insert inline-src-block)
  (goto-char (point-min))
  (let* ((context (org-element-context))
 (lang (org-element-property :language context))
 (type (org-element-type context))
 (src-block-info (org-babel-get-src-block-info nil
context)))
(when (eq type 'inline-src-block)
  (org-babel-execute-src-block
   nil src-block-info
   (pcase lang
 ("sh" `((:session . ,(make-temp-name " *ob-sh-inline-async
(sh) ")) (:async . "yes") (:results . "silent")))
 ("shell" `((:session . ,(make-temp-name "
*ob-sh-inline-async (shell) ")) (:async . "yes") (:results . "silent")))
 ("bash" `((:session . ,(make-temp-name "
*ob-sh-inline-async (bash) ")) (:async . "yes") (:results . "silent")))
 ("zsh" `((:session . ,(make-temp-name "
*ob-sh-inline-async (zsh) ")) (:async . "yes") (:results . "silent")))
 (_ '((:results . "none")))

(add-hook 'org-cycle-hook #'org-property-eval-on-cycle-expand)
#+end_src

I have example Org file like bellowing.

Here is the testing Org content:

#+begin_src org
,* 《枕刀歌》
:PROPERTIES:
:DATE: [2021-05-13 Thu 20:09]
:Douban:   https://movie.douban.com/subject/35350794/
:DIR:  枕刀歌
:EVAL: src_sh{mpv "枕刀歌/《枕刀歌》SE05 江海阔 歌谣哼唱.mp4"}
:END:
#+end_src

When I press Tab key to expand upper headline. I check the inline src block
session buffer, here is the output:

#+begin_example
bash-5.2$ bash-5.2$ PROMPT_COMMAND=;PS1="org_babel_sh_prompt> ";PS2=
org_babel_sh_prompt> echo
'ob_comint_async_shell_start_d1cc7563-be0c-4ed0-a4c2-d1b545333983'
mpv "枕刀歌/《枕刀歌》SE05 江海阔 歌谣哼唱.mp4"
echo 'ob_comint_async_shell_end_d1cc7563-be0c-4ed0-a4c2-d1b545333983'
ob_comint_async_shell_start_d1cc7563-be0c-4ed0-a4c2-d1b545333983
org_babel_sh_prompt> =[input] No key binding found for key 'c'.
[input] No key binding found for key 'h'.
[input] No key binding found for key '''.
[input] No key binding found for key 'b'.
[input] No key binding found for key 'c'.
[input] No key binding found for key 'n'.
[input] No key binding found for key 'a'.
[input] No key binding found for key 'y'.
[input] No key binding found for key 'n'.
[input] No key binding found for key 'c'.
[input] No key binding found for key 'h'.
[input] No key binding found for key 'n'.
[input] No key binding found for key 'c'.
[input] No key binding found for key 'c'.
[input] No key binding found for key '-'.
[input] No key binding found for key 'b'.
[input] No key binding found for key 'c'.
[input] No key binding found for key '-'.
[input] No key binding found for key '-'.
[input] No key binding found for key 'a'.
[input] No key binding found for key 'c'.
[input] No key binding found for key '-'.
[input] No key binding found for key 'b'.
[input] No key binding found for key '''.

Resuming playback. This behavior can be disabled with --no-resume-playback.

 Video --vid=1 (*) (h264 1920x1080 25.000fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
AO: [coreaudio] 48000Hz stereo 2ch floatp
Mute: yes



  C-c C-c>
Saving state.

Exiting... (Quit)
org_babel_sh_prompt> echo $SHELL
/bin/zsh
org_babel_sh_prompt>
#+end_example

Then I try to replace the "mpv" shell command with another command without
need to invoke desktop GUI. Like bellowing Org content:

#+begin_src org
,* 《枕刀歌》
:PROPERTIES:
:DATE: [2021-05-13 Thu 20:09]
:Douban:   https://movie.douban.com/subject/35350794/
:DIR:  枕刀歌
:EVAL: src_sh{sleep 10; echo "done"}
:END:
#+end_src

It evaluated fine.

#+begin_example
sh-3.2$ sh-3.2$ PROMPT_COMMAND=;PS1="org_babel_sh_prompt> ";PS2=
org_babel_sh_prompt> echo
'ob_comint_async_shell_start_ca48d711-c1d3-4ec3-8e9b-072f76fc86d5'
sleep 10; echo "done"
echo 'ob_comint_async_shell_end_ca48d711-c1d3-4ec3-8e9b-072f76fc86d5'
ob_comint_async_shell_start_ca48d711-c1d3-4ec3-8e9b-072f76fc86d5
org_babel_sh_prompt> done
org_babel_sh_prompt>
ob_comint_asyn

How to change working directory in ob-matlab source block?

2023-04-12 Thread stardiviner
Is there friend know Emacs Org mode and Matlab here?

I try to save Matlab plot into image file in another path instead of
current working directory. Like
bellowing code:

#+headers: :var cwd=(expand-file-name "data/images/" (file-name-directory
(buffer-file-name)))
#+headers: :prologue "eval(sprintf("cd '%s'", cwd))"
#+headers: :epilogue "saveas(gcf,'matlab-plot-demo2.png'); close(gcf);"
#+begin_src matlab :results graphics file link :dir "data/images" :file
"matlab-plot-demo2.png" :session "*MATLAB*"
bar([1 11 7 8 2 2 9 3 6])
#+end_src

#+RESULTS[(2023-04-13 00:09:01) c5fc0d36b27e75610664ee69ae618649637e45d9]:
[[file:data/images/matlab-plot-demo2.png]]

But Matlab command "cd" does not work correctly in upper code method.

Currently I come up with two solutions:

solution 1

#+begin_src matlab :results graphics file link :file
"data/images/matlab-plot-demo2.png" :session "*MATLAB*" :var
img="data/images/matlab-plot-demo2.png"
bar([1 11 7 8 2 2 9 3 6])
% saveas(gcf, 'data/images/matlab-plot-demo2.png')
% saveas(gcf, img)
disp(img)
close(gcf)
#+end_src

#+RESULTS[(2023-04-13 12:08:35) b87e1d8687e33acc089ea7374829c4d41e3dd0e4]:
[[file:data/images/matlab-plot-demo2.png]]

solution 2

#+headers: :var cwd=(expand-file-name "data/images/" (file-name-directory
(buffer-file-name)))
#+headers: :prologue "eval(sprintf("cd '%s'", cwd))"
#+headers: :epilogue "saveas(gcf,'matlab-plot-demo2.png'); close(gcf);"
#+begin_src matlab :results graphics file link :dir "data/images" :file
"matlab-plot-demo2.png" :session "*MATLAB*"
bar([1 11 7 8 2 2 9 3 6])
#+end_src

#+RESULTS[(2023-04-13 00:09:01) c5fc0d36b27e75610664ee69ae618649637e45d9]:
[[file:data/images/matlab-plot-demo2.png]]

Both does not work.

If you got a workable solution, please help me, Thanks very much.

[stardiviner] GPG key ID:
47C32433IRC(freeenode): stardiviner
Twitter:  @numbchildKey fingerprint = 9BAA 92BC CDDD
B9EF 3B36  CB99 B8C4 B8E5 47C3 2433Blog: http://stardiviner.github.io/; target="_blank">http://stardiviner.github.io/



How to change working directory in ob-matlab source block?

2023-04-12 Thread stardiviner
[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/


[BUG] org-capture got file userlock error when I capture on second time.

2023-03-20 Thread stardiviner
ure-elfeed-source)
:DATE(original): %(my/org-capture-elfeed-date)
:DATE: %u
:END:

%(my/org-capture-elfeed-content)"
   :empty-lines 1
   :jump-to-captured t)
 :append))

  ;; auto re-format elfeed entry org-capture buffer.
  (defun my/elfeed-format-org-capture-buffer ()
"A helper command to Delete org-capture elfeed-entry ending backslash
\\."
(interactive)
(goto-char (point-min))
(replace-string "\\" "")
(replace-string " " "")
;; using regex replace using \( \)\{2,\}  which means 2 or more
consecutive spaces and replace that with 1 space.
(replace-regexp "\\( \\)\\{2,\\}" " ")
(org-mark-subtree) ; or `org-mark-element', `mark-whole-buffer'
(call-interactively 'org-fill-paragraph) ; or `fill-paragraph'
)

  (add-hook 'org-capture-mode-hook #'my/elfeed-format-org-capture-buffer)

  ;; Download link media with youtube-dl.
  (defun youtube-dl-cmd-wrapper (url)
"Downloads the URL with youtube-dl in an async shell"
(let ((default-directory "~/Downloads"))
  (async-shell-command (format "youtube-dl %s" url

  (defun elfeed-youtube-dl ( use-generic-p)
"Use youtube-dl to download the link media."
(interactive "P")
(let ((entries (elfeed-search-selected)))
  (cl-loop for entry in entries
   do (elfeed-untag entry 'unread)
   when (elfeed-entry-link entry)
   do (youtube-dl-cmd-wrapper it))
  (mapc #'elfeed-search-update-entry entries)
  (unless (use-region-p) (forward-line

  (define-key elfeed-search-mode-map (kbd "d") 'elfeed-youtube-dl)
  )
#+end_src

I might need to take some time to bisect my Emacs config with bug-hunter to
check whether some options caused this error. I will add more details later.

If you have any clue about this error, thanks for the hint.

[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/


[SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el

2023-03-17 Thread stardiviner
For now, ob-clojure.el contains lot of code for ClojureScript. Only some
code has same functionality. Like CIDER backend. In the future,
ClojureScript part code will increase and different. So I suggest
separate them into two source code files.

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: [FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text.

2023-03-07 Thread stardiviner
[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, Mar 7, 2023 at 9:59 PM Ihor Radchenko  wrote:

> stardiviner  writes:
>
> > But I can't do similar in `org-agenda-custom-commands` description part
> > like this:
> > ```elisp
> > (add-to-list
> >'org-agenda-custom-commands
> >'("c" (format "%s Today [c]locked tasks." (all-the-icons-faicon
> > "hourglass-start"))
> >  ((agenda ""
> >   ((org-agenda-ndays 1)
> >(org-agenda-span-1)
> >(org-agenda-use-time-grid t)
> >(org-agenda-include-diary nil)
> >(org-agenda-show-log (quote clockcheck))
> >(org-agenda-clockreport t))
> > ```
> > This upper code will report error.
>
> Does `("c" ,(format ...) ...) work?
>
>
This macro-style expanded string works. I'm curious why have to be expanded?



> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


[FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text.

2023-03-06 Thread stardiviner
I want to display text icon using "all-the-icons" package to beautify
org-mode commands interface.

In `org-capture-templates`, I can set description text with propertied text
like this:

```elisp
(setq org-capture-templates
  `(("c" ,(format "%s\tsticky note" (all-the-icons-faicon
"sticky-note-o" :face 'all-the-icons-green :v-adjust 0.01))
 entry (file "")
 ;; select todo keyword interactively from `org-todo-keywords'.
 ;; The `org-todo-keywords-for-agenda' variable is fullfilled with
value AFTER generated Agenda.
 "* %(completing-read \"Todo keyword: \"
org-todo-keywords-for-agenda nil t) %^{Capture} [/] \n:PROPERTIES:\n:TIME:
%U\n:END: \n%i\n%a\n\n%?\n"
 ;; :time-prompt t
 :empty-lines 1 :jump-to-captured t))
```

But I can't do similar in `org-agenda-custom-commands` description part
like this:
```elisp
(add-to-list
   'org-agenda-custom-commands
   '("c" (format "%s Today [c]locked tasks." (all-the-icons-faicon
"hourglass-start"))
 ((agenda ""
  ((org-agenda-ndays 1)
   (org-agenda-span-1)
   (org-agenda-use-time-grid t)
   (org-agenda-include-diary nil)
   (org-agenda-show-log (quote clockcheck))
   (org-agenda-clockreport t))
```
This upper code will report error.

[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/


[DISCUSS] "same text-property competing" problem in external packages

2023-02-27 Thread stardiviner
I got a problem when more than one Emacs package competing on setting
text-property on same target from different packages.

Here is the original problem and discussion link:
https://github.com/nobiot/org-transclusion/issues/166

Does anybody have a good idea to solve this problem?

Thanks for your idea and suggestions.

[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: How to auto insert inline image link for org-plot/gnuplot result plot?

2022-01-02 Thread stardiviner
I write an advice for this.

#+begin_src emacs-lisp
;; `org-plot/gnuplot' advice of auto insert org gnuplot result image file.
  (advice-add 'org-plot/gnuplot :around
#'org-plot/gnuplot-insert-org-image-link)

  (defun org-plot/gnuplot-insert-org-image-link (origin-func  args)
"Auto insert `org-plot/gnuplot' generated plot image file link."
(save-excursion
  (org-plot/goto-nearest-table)
  ;; Set default options.
  (setf params nil)
  (dolist (pair org-plot/gnuplot-default-options)
(unless (plist-member params (car pair))
  (setf params (plist-put params (car pair) (cdr pair)
  ;; Collect options.
  (while (and (equal 0 (forward-line -1))
  (looking-at "[[:space:]]*#\\+"))
(setf params (org-plot/collect-options params
(setf param-file (plist-get params :file))
(apply origin-func args)
(goto-char (org-table-end))
(org-indent-line) (insert (format "\n"))
(org-indent-line) (insert (format "[[%s][%s]]" (expand-file-name
param-file) param-file))
(org-indent-line) (insert (format "\n"))
(when org-startup-with-inline-images (org-redisplay-inline-images)))
#+end_src

I suggest `org-plot.el` library can support this feature.

[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, Jun 18, 2017 at 1:55 PM numbch...@gmail.com 
wrote:

> I want to auto insert inline image for `org-plot/gnuplot` result plot
> below the table. Like this:
>
> ```org
> #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange
> [0:]"
> | Sede  | Max cites | H-index |
> |---+---+-|
> | Chile |257.72 |   21.39 |
> | Leeds |165.77 |   19.68 |
> | Sao Paolo | 71.00 |   11.50 |
> | Stockholm |134.19 |   14.33 |
> | Morelia   |257.56 |   17.67 |
>
> Press =[C-c " g]= on upper table to generate gnuplot plot image (*NOTE*:
> the
> generated plot image is in currently working directory).
>
> #+ATTR_ORG: :width 250
> #+ATTR_LATEX: :width 2.5in
> #+ATTR_HTML: :width 250px
> [[file:org-plot.png]]
> ```
>
> I have an idea, add an advice on `org-plot/gnuplot` with a user helper
> function to inser the inline image link.
> This advice need to:
>
> - locate point below the table.
> - get the `org-plot/gnuplot` result plot image link.
> - insert inline image link.
>
> [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/
>


[QUESTION] How to generate org-agenda view for clocked tasks and logs etc which are sorted by timestamps?

2021-11-03 Thread stardiviner
How to use elisp code to generate an org-agenda view for clocked tasks and
logs etc which are sorted by timestamps? I want to view my daily done tasks
and attach them as part of diary (maybe use org source block elisp code to
generate output?)

So how to setup `org-agenda-custom-commands` to archive this purpose?

Thanks for your help in advance. Regards.


[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: More on design of org-contacts.el - Re: [UPDATED PATCH] Re: add new link type "contact:" for org-contacts.el

2021-11-02 Thread stardiviner
I would like to be the maintainer of org-contacts.el. (I might already
replied this message? Sorry if duplicated.)
I have separated and put org-contacts on GitHub
https://github.com/stardiviner/org-contacts.el.
And I'm in the progress to put it on NonGNU ELPA or MELPA.

[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, Dec 14, 2020 at 2:06 PM Bastien  wrote:

> Hi stardiviner,
>
> what is the last state of your patch?  Feel free to resend it,
> I will apply it.
>
> Also, do you want to become the maintainer for org-contacts.el?
>
> Remember, elisp files in contrib/ will soon be extracted from
> the repository: https://orgmode.org/list/87wnzfy60h@bzg.fr
>
> Still, it's useful to already know who will be in charge.
>
> Thanks,
>
> --
>  Bastien
>


[SOLVED] Re: [QUESTION] Add advice on command org-add-note not working

2021-08-20 Thread stardiviner
Thanks Samuel, using `org-store-log-note’ indeed solved the problem. Great 
solution.


> On Aug 20, 2021, at 4:45 PM, Samuel Loury  wrote:
> 
> "Christopher M. Miles"  writes:
> 
>> <#secure method=pgpmime mode=sign>
> 
> Beware this did not actually sign your message.
> 
>> I have following advice code:
>> 
>> #+begin_src emacs-lisp
>> (defun my/org-add-note--auto-add-tag ()
>>  "Auto add tag 'LOG' when add note log."
>>  (org-back-to-heading)
>>  ;; DEBUG: the following code is not executed.
>>  (message "DEBUG")
>>  (require 'seq)
>>  (org-set-tags (seq-uniq (cons "LOG" (org-get-tags nil t)
>> 
>> (advice-add 'org-add-note :after #'my/org-add-note--auto-add-tag)
>> #+end_src
>> 
>> With Emacs Edebug, I found it only executed to ~(org-back-to-heading)~, then 
>> stopped. The following
>> "DEBUG" message is not printed and tag "LOG" is not added.
>> 
>> Does anybody have some clue for this issue?
> 
> `org-add-note` only sets up a side buffer to write the content of the
> note. The "go back to the heading to actually write the note" is done by
> `org-store-log-note`, invoked using C-c C-c on your note.
> 
> So it is normal that `org-back-to-heading` fails in the org-note buffer
> that indeed does not have a heading.
> 
> Hint: press p when in edebug session to find out in which buffer context
> the code will apply.
> 
> I just tried applying the advice to `org-store-log-note` instead of
> `org-add-note` and it worked fine :-).
> 
> My best,
> -- 
> Konubinix
> GPG Key: 7439106A
> Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A




STOP this patch for now.

2021-07-08 Thread stardiviner


> On Jul 8, 2021, at 4:59 PM, Christian Hopps  wrote:
> 
> It may eventually be incorporated into the very popular emacs-mac port 
> (railwaycat tap in homebrew); however, it will probably not be incorporated 
> into the nextstep/emacs main code. I started looking at doing a version for 
> the mainline code, but it’s hard to get motivated b/c using that version of 
> emacs on OS X is a pretty sub-par experience.

Thanks for your work on this support. I found upstream is less active. Don’t 
know when will be merged.

> 
> I only commented on this b/c I think you might are disabling 
> notifications-notify which work great with my code changes, and using 
> something else if you see Darwin OS, and that will break my native “Just 
> Works” support for notifications, which again may end up on many peoples 
> machines. I would ask that the patch be modified in a way that didn’t break 
> native support if present before it was accepted.
> 
> Also as you can see by the multiple patches you’ve submitted there’s really 
> no good answer for an external notifier, so whatever you pick is probably 
> going to be wrong for someone I guess.

Yes, this troubled my too. Currently no good solution. I will stop this patch 
for now. Wait for upstream emacs-mac port support. Hope it will be arrived in 
at leas half of year.

> 
> If this patch is going to be accepted I would ask that it
> 
> 1) be conditional (disable-able with a variable)
> 2) do the check for the custom installed external notifier and if not present 
> then fallback to using the emacs supplied notifications-notify
> 3) not restrict notifications-notify to gnu/linux only.
> 
> That way people that have already developed solutions for this won’t have 
> them broken.
> 
> Thanks,
> Chris.
> 
>> On Jul 7, 2021, at 8:00 PM, stardiviner > <mailto:numbch...@gmail.com>> wrote:
>> 
>> Hi Chris, thanks for your work. I have a question, will your patch of 
>> notification code be merged to upstream?
>> If yes, I think my patch will be not necessary. If no, then I think add a my 
>> workaround for macOS is considerable.
>> 
>>> On Jul 7, 2021, at 2:23 AM, Christian Hopps >> <mailto:cho...@chopps.org>> wrote:
>>> 
>>> It supports imagemagick (specify —with-imagemagick), and it includes svg by 
>>> default, I simply forked the railwaycat version and added the native 
>>> notification code.
>>> 
>>> Thanks,
>>> Chris.
>>> 
>>>> On Jul 6, 2021, at 11:30 AM, stardiviner >>> <mailto:numbch...@gmail.com>> wrote:
>>>> 
>>>> Thanks for your suggestion. Does your Emacs build supports imagemagick 
>>>> image view and svg feature support? Because company-mode now have built-in 
>>>> icons support. This is the reason that I switch from 
>>>> https://emacsformacosx.com/ <https://emacsformacosx.com/> to Homebrew cask 
>>>> Emacs version.
>>>> 
>>>>> On Jul 6, 2021, at 12:21 PM, Christian Hopps >>>> <mailto:cho...@chopps.org>> wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> Please consider: I added full native notification support to the popular 
>>>>> OS X Emacs build available in homebrew. This supports rewrites 
>>>>> notifications-notify defun to use the native code rather than dbus, and 
>>>>> so everything "Just Works".
>>>>> 
>>>>> Info can be found here:
>>>>> 
>>>>> https://github.com/choppsv1/homebrew-emacsmacport 
>>>>> <https://github.com/choppsv1/homebrew-emacsmacport>
>>>>> 
>>>>> Thanks,
>>>>> Chris.
>>>>> 
>>>>> stardiviner mailto:numbch...@gmail.com>> writes:
>>>>> 
>>>>>> Here is the new patch which invokes notifications though Emacs built-in 
>>>>>> API `ns-do-applescript`.
>>>>>> 
>>>>>> [2. text/x-patch; 
>>>>>> 0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch]...
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On Jul 6, 2021, at 8:06 AM, Tim Cross >>>>>> <mailto:theophil...@gmail.com>> wrote:
>>>>>>> 
>>>>>>> 
>>>>>>> stardiviner mailto:numbch...@gmail.com>> writes:
>>>>>>> 
>>>>>>>>> On Jul 5, 2021, at 7:55 PM, Maxim Nikulin >>>>>>>> <mailto:maniku...@gm

Re: [new patch] [PATCH] make org-notify support for macOS desktop notification

2021-07-07 Thread stardiviner
Hi Chris, thanks for your work. I have a question, will your patch of 
notification code be merged to upstream?
If yes, I think my patch will be not necessary. If no, then I think add a my 
workaround for macOS is considerable.

> On Jul 7, 2021, at 2:23 AM, Christian Hopps  wrote:
> 
> It supports imagemagick (specify —with-imagemagick), and it includes svg by 
> default, I simply forked the railwaycat version and added the native 
> notification code.
> 
> Thanks,
> Chris.
> 
>> On Jul 6, 2021, at 11:30 AM, stardiviner > <mailto:numbch...@gmail.com>> wrote:
>> 
>> Thanks for your suggestion. Does your Emacs build supports imagemagick image 
>> view and svg feature support? Because company-mode now have built-in icons 
>> support. This is the reason that I switch from https://emacsformacosx.com/ 
>> <https://emacsformacosx.com/> to Homebrew cask Emacs version.
>> 
>>> On Jul 6, 2021, at 12:21 PM, Christian Hopps >> <mailto:cho...@chopps.org>> wrote:
>>> 
>>> Hi,
>>> 
>>> Please consider: I added full native notification support to the popular OS 
>>> X Emacs build available in homebrew. This supports rewrites 
>>> notifications-notify defun to use the native code rather than dbus, and so 
>>> everything "Just Works".
>>> 
>>> Info can be found here:
>>> 
>>> https://github.com/choppsv1/homebrew-emacsmacport 
>>> <https://github.com/choppsv1/homebrew-emacsmacport>
>>> 
>>> Thanks,
>>> Chris.
>>> 
>>> stardiviner mailto:numbch...@gmail.com>> writes:
>>> 
>>>> Here is the new patch which invokes notifications though Emacs built-in 
>>>> API `ns-do-applescript`.
>>>> 
>>>> [2. text/x-patch; 
>>>> 0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch]...
>>>> 
>>>> 
>>>> 
>>>>> On Jul 6, 2021, at 8:06 AM, Tim Cross >>>> <mailto:theophil...@gmail.com>> wrote:
>>>>> 
>>>>> 
>>>>> stardiviner mailto:numbch...@gmail.com>> writes:
>>>>> 
>>>>>>> On Jul 5, 2021, at 7:55 PM, Maxim Nikulin >>>>>> <mailto:maniku...@gmail.com>> wrote:
>>>>>>> 
>>>>>>> On 05/07/2021 10:50, stardiviner wrote:
>>>>>>>> I updated the patch, I found the package `osx-lib` contains solution.
>>>>>>>> So I removed the directly osascript process invocation.
>>>>>>> 
>>>>>>> I have no objections any more. On the other hand I have no access to 
>>>>>>> macOS, so
>>>>>>> I have not tested this patch. Feel free to ignore comments from this 
>>>>>>> message,
>>>>>>> they are mostly matter of taste.
>>>>>>> 
>>>>>>> I expect that a simple script "notify-send" may allow to avoid 
>>>>>>> modification of
>>>>>>> code. Something like (untested, unsure concerning "quoted form of ...")
>>>>>>> 
>>>>>>> #!/usr/bin/env osascript
>>>>>>> display notification (item 1 of argv)
>>>>>>> 
>>>>>>> However if osx-lib in is installed automatically, it may be more 
>>>>>>> convenient.
>>>>>>> Unsure if some of currently supported linux distributions have 
>>>>>>> notify-send
>>>>>>> that can not handle title as the first argument.
>>>>>>> 
>>>>>>>> -  ((fboundp 'notifications-notify)
>>>>>>>> +  ((and (eq system-type 'gnu/linux) (fboundp 
>>>>>>>> 'notifications-notify))
>>>>>>> 
>>>>>>> Does it mean that `notifications-notify' is bound but it does not work 
>>>>>>> on
>>>>>>> macOS? If so, maybe it is better to put new clause for 'darwin above 
>>>>>>> and to
>>>>>>> drop 'gnu/linux here. From my point of view, it is preferable to avoid
>>>>>>> additional requirement for `notifications-notify'. If someone will 
>>>>>>> create a
>>>>>>> feature request for `notifications-notify' for macOS, it will just work
>>>>>>> without installing of additional packages as soon as such feature is
>>>>>>> implemented.
>>>>>>> 
>>>>>>> 
>>>>>> I indeed tried `notifications-notify`. And it does not work, reports 
>>>>>> error that
>>>>>> it needs dbus. PS. I used the Homebrew formulae version Emacs.
>>>>>> I considered the order of conditions. Because notifications and 
>>>>>> notify-send etc
>>>>>> requires dbus. So I guess only Linux supports that. So add system-type 
>>>>>> detection
>>>>>> will be better. WDYT?
>>>>> 
>>>>> I think you can add dbus support to macOS using homebrew and that might
>>>>> resolve the issue. At the very least, this will need to be investigated
>>>>> because otherwise, adding this patch may break configurations for users
>>>>> who have added dbus support via homebrew and have notifications working,
>>>>> but have not installed the osx-lib package.
>>>>> 
>>>>> My only small concern with your proposed changes is that it will add a
>>>>> dependency on a new package osx-lib, which I think is only available in
>>>>> melpa. At the very least, this will need to be documented somewhere.
>>>>> However, I'm not sure what the situation is wrt adding code which
>>>>> depends on an external package which is not available in either elpa or
>>>>> nongnuELPA? As org mode is a part of GNU Emacs, I suspect that any code
>>>>> which 'encourages' the use of melpa packages will not be acceptable.
>>>>> 
>>>>> --
>>>>> Tim Cross
>>>>> 
>>> 
>> 
> 



Re: [new patch] [PATCH] make org-notify support for macOS desktop notification

2021-07-06 Thread stardiviner
Thanks for your suggestion. Does your Emacs build supports imagemagick image 
view and svg feature support? Because company-mode now have built-in icons 
support. This is the reason that I switch from https://emacsformacosx.com/ 
<https://emacsformacosx.com/> to Homebrew cask Emacs version.

> On Jul 6, 2021, at 12:21 PM, Christian Hopps  wrote:
> 
> Hi,
> 
> Please consider: I added full native notification support to the popular OS X 
> Emacs build available in homebrew. This supports rewrites 
> notifications-notify defun to use the native code rather than dbus, and so 
> everything "Just Works".
> 
> Info can be found here:
> 
> https://github.com/choppsv1/homebrew-emacsmacport
> 
> Thanks,
> Chris.
> 
> stardiviner  writes:
> 
>> Here is the new patch which invokes notifications though Emacs built-in API 
>> `ns-do-applescript`.
>> 
>> [2. text/x-patch; 
>> 0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch]...
>> 
>> 
>> 
>>> On Jul 6, 2021, at 8:06 AM, Tim Cross  wrote:
>>> 
>>> 
>>> stardiviner  writes:
>>> 
>>>>> On Jul 5, 2021, at 7:55 PM, Maxim Nikulin  wrote:
>>>>> 
>>>>> On 05/07/2021 10:50, stardiviner wrote:
>>>>>> I updated the patch, I found the package `osx-lib` contains solution.
>>>>>> So I removed the directly osascript process invocation.
>>>>> 
>>>>> I have no objections any more. On the other hand I have no access to 
>>>>> macOS, so
>>>>> I have not tested this patch. Feel free to ignore comments from this 
>>>>> message,
>>>>> they are mostly matter of taste.
>>>>> 
>>>>> I expect that a simple script "notify-send" may allow to avoid 
>>>>> modification of
>>>>> code. Something like (untested, unsure concerning "quoted form of ...")
>>>>> 
>>>>> #!/usr/bin/env osascript
>>>>> display notification (item 1 of argv)
>>>>> 
>>>>> However if osx-lib in is installed automatically, it may be more 
>>>>> convenient.
>>>>> Unsure if some of currently supported linux distributions have notify-send
>>>>> that can not handle title as the first argument.
>>>>> 
>>>>>> -((fboundp 'notifications-notify)
>>>>>> +((and (eq system-type 'gnu/linux) (fboundp 
>>>>>> 'notifications-notify))
>>>>> 
>>>>> Does it mean that `notifications-notify' is bound but it does not work on
>>>>> macOS? If so, maybe it is better to put new clause for 'darwin above and 
>>>>> to
>>>>> drop 'gnu/linux here. From my point of view, it is preferable to avoid
>>>>> additional requirement for `notifications-notify'. If someone will create 
>>>>> a
>>>>> feature request for `notifications-notify' for macOS, it will just work
>>>>> without installing of additional packages as soon as such feature is
>>>>> implemented.
>>>>> 
>>>>> 
>>>> I indeed tried `notifications-notify`. And it does not work, reports error 
>>>> that
>>>> it needs dbus. PS. I used the Homebrew formulae version Emacs.
>>>> I considered the order of conditions. Because notifications and 
>>>> notify-send etc
>>>> requires dbus. So I guess only Linux supports that. So add system-type 
>>>> detection
>>>> will be better. WDYT?
>>> 
>>> I think you can add dbus support to macOS using homebrew and that might
>>> resolve the issue. At the very least, this will need to be investigated
>>> because otherwise, adding this patch may break configurations for users
>>> who have added dbus support via homebrew and have notifications working,
>>> but have not installed the osx-lib package.
>>> 
>>> My only small concern with your proposed changes is that it will add a
>>> dependency on a new package osx-lib, which I think is only available in
>>> melpa. At the very least, this will need to be documented somewhere.
>>> However, I'm not sure what the situation is wrt adding code which
>>> depends on an external package which is not available in either elpa or
>>> nongnuELPA? As org mode is a part of GNU Emacs, I suspect that any code
>>> which 'encourages' the use of melpa packages will not be acceptable.
>>> 
>>> --
>>> Tim Cross
>>> 
> 



[new patch] Re: [PATCH] make org-notify support for macOS desktop notification

2021-07-05 Thread stardiviner
Here is the new patch which invokes notifications though Emacs built-in API 
`ns-do-applescript`.



0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch
Description: Binary data


> On Jul 6, 2021, at 8:06 AM, Tim Cross  wrote:
> 
> 
> stardiviner  writes:
> 
>>> On Jul 5, 2021, at 7:55 PM, Maxim Nikulin  wrote:
>>> 
>>> On 05/07/2021 10:50, stardiviner wrote:
>>>> I updated the patch, I found the package `osx-lib` contains solution.
>>>> So I removed the directly osascript process invocation.
>>> 
>>> I have no objections any more. On the other hand I have no access to macOS, 
>>> so
>>> I have not tested this patch. Feel free to ignore comments from this 
>>> message,
>>> they are mostly matter of taste.
>>> 
>>> I expect that a simple script "notify-send" may allow to avoid modification 
>>> of
>>> code. Something like (untested, unsure concerning "quoted form of ...")
>>> 
>>> #!/usr/bin/env osascript
>>> display notification (item 1 of argv)
>>> 
>>> However if osx-lib in is installed automatically, it may be more convenient.
>>> Unsure if some of currently supported linux distributions have notify-send
>>> that can not handle title as the first argument.
>>> 
>>>> -  ((fboundp 'notifications-notify)
>>>> +  ((and (eq system-type 'gnu/linux) (fboundp 'notifications-notify))
>>> 
>>> Does it mean that `notifications-notify' is bound but it does not work on
>>> macOS? If so, maybe it is better to put new clause for 'darwin above and to
>>> drop 'gnu/linux here. From my point of view, it is preferable to avoid
>>> additional requirement for `notifications-notify'. If someone will create a
>>> feature request for `notifications-notify' for macOS, it will just work
>>> without installing of additional packages as soon as such feature is
>>> implemented.
>>> 
>>> 
>> I indeed tried `notifications-notify`. And it does not work, reports error 
>> that
>> it needs dbus. PS. I used the Homebrew formulae version Emacs.
>> I considered the order of conditions. Because notifications and notify-send 
>> etc
>> requires dbus. So I guess only Linux supports that. So add system-type 
>> detection
>> will be better. WDYT?
> 
> I think you can add dbus support to macOS using homebrew and that might
> resolve the issue. At the very least, this will need to be investigated
> because otherwise, adding this patch may break configurations for users
> who have added dbus support via homebrew and have notifications working,
> but have not installed the osx-lib package.
> 
> My only small concern with your proposed changes is that it will add a
> dependency on a new package osx-lib, which I think is only available in
> melpa. At the very least, this will need to be documented somewhere.
> However, I'm not sure what the situation is wrt adding code which
> depends on an external package which is not available in either elpa or
> nongnuELPA? As org mode is a part of GNU Emacs, I suspect that any code
> which 'encourages' the use of melpa packages will not be acceptable. 
> 
> -- 
> Tim Cross
> 



Re: [PATCH] make org-notify support for macOS desktop notification

2021-07-05 Thread stardiviner



> On Jul 6, 2021, at 8:06 AM, Tim Cross  wrote:
> 
> 
> stardiviner  writes:
> 
>>> On Jul 5, 2021, at 7:55 PM, Maxim Nikulin  wrote:
>>> 
>>> On 05/07/2021 10:50, stardiviner wrote:
>>>> I updated the patch, I found the package `osx-lib` contains solution.
>>>> So I removed the directly osascript process invocation.
>>> 
>>> I have no objections any more. On the other hand I have no access to macOS, 
>>> so
>>> I have not tested this patch. Feel free to ignore comments from this 
>>> message,
>>> they are mostly matter of taste.
>>> 
>>> I expect that a simple script "notify-send" may allow to avoid modification 
>>> of
>>> code. Something like (untested, unsure concerning "quoted form of ...")
>>> 
>>> #!/usr/bin/env osascript
>>> display notification (item 1 of argv)
>>> 
>>> However if osx-lib in is installed automatically, it may be more convenient.
>>> Unsure if some of currently supported linux distributions have notify-send
>>> that can not handle title as the first argument.
>>> 
>>>> -  ((fboundp 'notifications-notify)
>>>> +  ((and (eq system-type 'gnu/linux) (fboundp 'notifications-notify))
>>> 
>>> Does it mean that `notifications-notify' is bound but it does not work on
>>> macOS? If so, maybe it is better to put new clause for 'darwin above and to
>>> drop 'gnu/linux here. From my point of view, it is preferable to avoid
>>> additional requirement for `notifications-notify'. If someone will create a
>>> feature request for `notifications-notify' for macOS, it will just work
>>> without installing of additional packages as soon as such feature is
>>> implemented.
>>> 
>>> 
>> I indeed tried `notifications-notify`. And it does not work, reports error 
>> that
>> it needs dbus. PS. I used the Homebrew formulae version Emacs.
>> I considered the order of conditions. Because notifications and notify-send 
>> etc
>> requires dbus. So I guess only Linux supports that. So add system-type 
>> detection
>> will be better. WDYT?
> 
> I think you can add dbus support to macOS using homebrew and that might
> resolve the issue.

I checked my homebrew, I found the `dbus` is installed already. And in Emacs 
`(featurep ‘dbus)` returns t.

But `(org-show-notification “test”)` returns error:
```
Debugger entered--Lisp error: (dbus-error "No connection to bus" :session)
  dbus-message-internal(1 :session "org.freedesktop.Notifications" 
"/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" 
dbus-call-method-handler :string "Emacs" :uint32 0 :string 
"/opt/homebrew/Cellar/emacs-head@28/28.0.50_1/share..." :string "Org mode 
message" :string "test" (:array) ((:dict-entry "urgency" (:variant :byte 0))) 
:int32 3000)
  apply(dbus-message-internal 1 :session "org.freedesktop.Notifications" 
"/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" 
dbus-call-method-handler (:string "Emacs" :uint32 0 :string 
"/opt/homebrew/Cellar/emacs-head@28/28.0.50_1/share..." :string "Org mode 
message" :string "test" (:array) ((:dict-entry "urgency" (:variant :byte 0))) 
:int32 3000))
  dbus-call-method(:session "org.freedesktop.Notifications" 
"/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" 
:string "Emacs" :uint32 0 :string 
"/opt/homebrew/Cellar/emacs-head@28/28.0.50_1/share..." :string "Org mode 
message" :string "test" (:array) ((:dict-entry "urgency" (:variant :byte 0))) 
:int32 3000)
  notifications-notify(:title "Org mode message" :body "test" :timeout 3000 
:urgency low)
  (cond ((functionp org-show-notification-handler) (funcall 
org-show-notification-handler notification)) ((stringp 
org-show-notification-handler) (start-process "emacs-timer-notification" nil 
org-show-notification-handler notification)) ((fboundp 
'w32-notification-notify) (let ((id (w32-notification-notify :title "Org mode 
message" :body notification :urgency 'low))) (run-with-timer 
org-show-notification-timeout nil #'(lambda nil (w32-notification-close id) 
((fboundp 'notifications-notify) (notifications-notify :title "Org mode 
message" :body notification :timeout (* org-show-notification-timeout 1000) 
:urgency 'low)) ((executable-find "notify-send") (start-process 
"emacs-timer-notification" nil "notify-send&q

Re: [PATCH] make org-notify support for macOS desktop notification

2021-07-05 Thread stardiviner



> On Jul 5, 2021, at 7:55 PM, Maxim Nikulin  wrote:
> 
> On 05/07/2021 10:50, stardiviner wrote:
>> I updated the patch, I found the package `osx-lib` contains solution.
>> So I removed the directly osascript process invocation.
> 
> I have no objections any more. On the other hand I have no access to macOS, 
> so I have not tested this patch. Feel free to ignore comments from this 
> message, they are mostly matter of taste.
> 
> I expect that a simple script "notify-send" may allow to avoid modification 
> of code. Something like (untested, unsure concerning "quoted form of ...")
> 
> #!/usr/bin/env osascript
> display notification (item 1 of argv)
> 
> However if osx-lib in is installed automatically, it may be more convenient. 
> Unsure if some of currently supported linux distributions have notify-send 
> that can not handle title as the first argument.
> 
>> -((fboundp 'notifications-notify)
>> +((and (eq system-type 'gnu/linux) (fboundp 'notifications-notify))
> 
> Does it mean that `notifications-notify' is bound but it does not work on 
> macOS? If so, maybe it is better to put new clause for 'darwin above and to 
> drop 'gnu/linux here. From my point of view, it is preferable to avoid 
> additional requirement for `notifications-notify'. If someone will create a 
> feature request for `notifications-notify' for macOS, it will just work 
> without installing of additional packages as soon as such feature is 
> implemented.
> 
> 
I indeed tried `notifications-notify`. And it does not work, reports error that 
it needs dbus. PS. I used the Homebrew formulae version Emacs.
I considered the order of conditions. Because notifications and notify-send etc 
requires dbus. So I guess only Linux supports that. So add system-type 
detection will be better. WDYT?


Re: [PATCH] make org-notify support for macOS desktop notification

2021-07-04 Thread stardiviner
I updated the patch, I found the package `osx-lib` contains solution. So I 
removed the directly osascript process invocation.

0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch
Description: Binary data



> On Jul 4, 2021, at 1:48 PM, Maxim Nikulin  wrote:
> 
> On 04/07/2021 07:23, stardiviner wrote:
>> I found `org-notify` does not support macOS desktop notification. So I write 
>> a small patch for this.
> 
> I am surprised that there is no OS-agnostic function in Emacs that sends 
> simple notification, suitable when no advanced feature are necessary. Only 
> OS-dependent variants are implemented for Linux and Windows.
> 
>> +(format "'display notification \"%s\" with title 
>> \"title\"'" notification "Org mode message")))
> 
> Unsafe substitution of the argument. There is no guarantee that notification 
> has no quote characters. I do not know, which link you would prefer:
> - old https://xkcd.com/327/ "Robert'); DROP TABLE"
> - recent 
> https://arstechnica.com/gadgets/2021/06/mass-data-wipe-in-my-book-devices-prompts-warning-from-western-digital/
>  Wipe data from NAS (accordingly to some sources, device can be protected by 
> firewall, it is enough to open in a browser a page with a malicious  src="..."> element, e.g. in a comment of an earlier visitor)
> 
> The preferred way is to pass such parameters as separate arguments of 
> `start-process'. I am not familiar with osascript, I hope, it does not 
> additionally interpret strings passed to "display notification" to do 
> something fancy things. Example with sh:
> 
> Current unsafe variant:
> 
>>   sh -c "`printf 'echo "%s: %s - %s"' 'some-command' '"; echo another action 
>> ; echo "' 'second arg'
> With parameters passed as separate arguments to avoid interpretation of 
> special characters:
> 
>>   sh -c 'echo "$0: $1 - $2"' 'some-command' '"; echo another action ; echo 
>> "' 'second arg'
> 
> 



[PATCH] make org-notify support for macOS desktop notification

2021-07-03 Thread stardiviner
I found `org-notify` does not support macOS desktop notification. So I write a 
small patch for this.

Thanks for reviewing.



0001-org-clock.el-Make-org-notify-support-macOS-notificat.patch
Description: Binary data


Re: org-attach a directory?

2021-06-15 Thread stardiviner


> On Jun 12, 2021, at 12:35 AM, John Kitchin  wrote:
> 
> I discovered another way to do this that is already built in with 
> `org-attach-dired-to-subtree` that would help sometimes. 
> 
> You split your window, open dired in one of them, mark some files, and then 
> run that command in the dired window.
> 
> John

Thanks John.

I tried your methods. But this need to mark multiple regular files. Instead of 
a directory. It needs to leave Org file buffer. What if I have multiple Org 
buffer presents. It might cause chaos. I don’t think it’s a good solution to 
attach directory. But learn a new command. Still good.

> 
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu <http://kitchingroup.cheme.cmu.edu/>
> 
> 
> 
> On Thu, Jun 10, 2021 at 10:04 PM stardiviner  <mailto:numbch...@gmail.com>> wrote:
> I want this feature patch too. Hope Org Mode can add this. I remember old 
> version org-mode can do this. But later delete this feature? I forget what 
> version is.
> 
> I suggest to add this feature.
> 
>> On Jun 8, 2021, at 11:49 PM, John Kitchin > <mailto:jkitc...@andrew.cmu.edu>> wrote:
>> 
>> Is it possible to attach a directory to an org heading?
>> 
>> I have only seen how to attach a file so far.
>> 
>> John
>> 
>> ---
>> Professor John Kitchin (he/him/his)
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu <http://kitchingroup.cheme.cmu.edu/>
>> 
> 



Re: org-attach a directory?

2021-06-10 Thread stardiviner
I want this feature patch too. Hope Org Mode can add this. I remember old 
version org-mode can do this. But later delete this feature? I forget what 
version is.

I suggest to add this feature.

> On Jun 8, 2021, at 11:49 PM, John Kitchin  wrote:
> 
> Is it possible to attach a directory to an org heading?
> 
> I have only seen how to attach a file so far.
> 
> John
> 
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu 
> 



Re: [ORG] Moving the org-mode.git repo to savannah.gnu.org

2021-06-05 Thread stardiviner
Thanks for quick reply and solving this problem. :smile:

> On Jun 5, 2021, at 3:55 PM, Bastien  wrote:
> 
> Hi Stardiviner,
> 
> stardiviner  writes:
> 
>> I have a big problem. After I registered savannah account, I open
>> profile page at first 3 days. Then I have not touched it anymore. Now
>> Savannah emailed me that my account has been removed because of idle.
> 
> I'm sorry for this.  This happened to Timothy too, and perhaps others.
> I was not aware of this policy.
> 
> I was waiting to get all Savannah user names before asking the Emacs
> maintainers to add them to the Emacs project (where the org-mode.git
> Savannah repo lives), so that I ask only once, but it was a mistake.
> 
> I will ask them to add all usernames I have today, hoping this will
> avoid problems.
> 
> Please write me in private so that we can sort this out for you.
> 
> Thanks,
> 
> -- 
> Bastien




Re: [ORG] Moving the org-mode.git repo to savannah.gnu.org

2021-06-05 Thread stardiviner
I have a big problem. After I registered savannah account, I open profile
page at first 3 days. Then I have not touched it anymore. Now Savannah
emailed me that my account has been removed because of idle. It has
happened two times. Is there a way to avoid this? If not, I hope to keep
org-mode in separate self-hosting repository.

[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, Jun 2, 2021 at 2:18 PM Bastien  wrote:

> Hi Kaushal,
>
> Kaushal Modi  writes:
>
> > I am seeing that the master branch on https://code.orgmode.org/bzg/
> > org-mode/commits/master has newer commits than the main branch on
> > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/log/ .
>
> Fixed, thanks - I sync repositories regularily, but since we don't use
> the savannah repo for now, it's not critical.
>
> > I am assuming that the complete switch to Savannah is still pending?
>
> Yes.  I plan to make the switch early July.
>
> Thanks,
>
> --
>  Bastien
>
>


Re: [QUESTION] Org "customid" and "coderef" links seems not fontified as other file: link

2020-12-23 Thread stardiviner


Bump this thread, hi, Nicolas, any thoughts or update about this?

stardiviner  writes:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
>
> I have following minimal testing code:
>
> #+begin_src emacs-lisp
> (defun org-link-beautify (start end path bracketp)
>   "Display icon for the Org link type."
>   (message
>(format "start: %s, end: %s, path: %s, bracketp: %s" start end path 
> bracketp)))
>
> (dolist (link-type (mapcar 'car org-link-parameters))
> (org-link-set-parameters link-type :activate-func #'org-link-beautify))
> #+end_src
>
> The ~message~ does not print parameter values at all. I guess those "customid"
> [[#Usage] and "coderef" (coderef) are different with "file:" etc links. Is 
> this
> true? Here is my complete source code I want to try fontify customid and 
> coderef
> links.
>
> https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L67
>
> Is there any way to fix this problem?
>
> Regards
>
> - -- 
> [ stardiviner ]
>I try to make every word tell the meaning that I want to express.
>
>Blog: https://stardiviner.github.io/
>IRC(freenode): stardiviner, Matrix: stardiviner
>GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>   
> -BEGIN PGP SIGNATURE-
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7HHwAUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsNAxggAtBoYLo9Gm5dLjVH/9XEqij1GtE0j
> bgHF27icJq6p2BawOQx9MPENgFUO7GIYTlSjLTYq2fj9yXKWpqbyswIf6a/jLNGE
> gTEktGAGul1/+k0OcAwE1RS1qCbU0t3AeX+LqcqUmSJN4TbfcsHaez+LaomGHSPH
> tg5QtRgQNdp40/4Qc5JRc/YyfueN/qdJnsJ7hny63rroT7TWVugIkgSgS9WPtcCY
> ss6Yrbz0EBHvb+7lyLDzyJfbn1YwIkYdTQ/tx0ebp/5dTnpH0XD1YDQD12HTvowE
> 4tWGlwI8YNJkUsp2NjtFfWz+bempl15i7swqgxwvNiETOxTBuuv7Lf7Z2Q==
> =kaJV
> -END PGP SIGNATURE-----


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Bug: org-contacts.el: org-contacts-link-store breaks org-id [9.4.2 (release_9.4.2-307-g8840af @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-12-16 Thread stardiviner
Ok, I added `org-id-link-to-org-use-id` support now. Check out the latest
update in Git.

[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 17, 2020 at 11:26 AM Ihor Radchenko  wrote:

>
> stardiviner  writes:
>
> > Sure, I didn't expected that soon bug appears. I checked source code, I
> > commented out an condition accidentally.
> > Here is the patch. Tested it should work now.
>
> What about adding support for org-id? Is it necessary to use headline
> text as a search string even when org-id is being used (and
> org-id-link-to-org-use-id is set to non-nil)?
>
> Best,
> Ihor
>
>


Re: Bug: org-contacts.el: org-contacts-link-store breaks org-id [9.4.2 (release_9.4.2-307-g8840af @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-12-16 Thread stardiviner
I seems don't have permission to do `git push` directly.
Got error:
```
128 git … push -v upstream master\:refs/heads/master
Pushing to code.orgmode.org:bzg/org-mode.git
Gogs: You do not have sufficient authorization for this action
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```

Is this git address "g...@code.orgmode.org:bzg/org-mode.git" correct?
I got from https://code.orgmode.org/bzg/org-mode.
I also tried http protocol. Also failed with following error:
```
  1 git … push -v upstream master\:refs/heads/master
Pushing to https://code.orgmode.org/bzg/org-mode.git
Writing objects: 100% (5/5), 970 bytes | 970.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
POST git-receive-pack (1123 bytes)
Icon theme "ubuntu-mono-dark" not found.
Icon theme "Mint-X" not found.
Icon theme "elementary" not found.
POST git-receive-pack (1123 bytes)
error: RPC failed; HTTP 401 curl 22 The requested URL returned error: 401
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date
```

[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 17, 2020 at 1:18 PM Bastien  wrote:

> stardiviner  writes:
>
> > Does that means I can push to org-contacts.el directly by myself?
>
> Yes indeed.  Thanks to you!
>
> --
>  Bastien
>


Re: Bug: org-contacts.el: org-contacts-link-store breaks org-id [9.4.2 (release_9.4.2-307-g8840af @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-12-16 Thread stardiviner
Does that means I can push to org-contacts.el directly by myself?
That's simpler. 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, Dec 17, 2020 at 1:03 PM Bastien  wrote:

> Ihor Radchenko  writes:
>
> > stardiviner  writes:
> >
> >> Sure, I didn't expected that soon bug appears. I checked source code, I
> >> commented out an condition accidentally.
> >> Here is the patch. Tested it should work now.
> >
> > What about adding support for org-id? Is it necessary to use headline
> > text as a search string even when org-id is being used (and
> > org-id-link-to-org-use-id is set to non-nil)?
>
> I don't know what's the best solution here, but stardiviner feel free
> to commit patches yourself, as this is part of contrib/.
>
> --
>  Bastien
>


Re: Bug: org-contacts.el: org-contacts-link-store breaks org-id [9.4.2 (release_9.4.2-307-g8840af @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-12-16 Thread stardiviner
Supporting org-id has been considered.
I will see is it easy to integrated it in. If simple, I will do it soon.
Thanks for your suggestion. More detailed discussion can reference another
thread in this mailing list.
"More on design of org-contacts.el - Re: [UPDATED PATCH] Re: add new link
type "contact:" for org-contacts.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 Thu, Dec 17, 2020 at 11:26 AM Ihor Radchenko  wrote:

>
> stardiviner  writes:
>
> > Sure, I didn't expected that soon bug appears. I checked source code, I
> > commented out an condition accidentally.
> > Here is the patch. Tested it should work now.
>
> What about adding support for org-id? Is it necessary to use headline
> text as a search string even when org-id is being used (and
> org-id-link-to-org-use-id is set to non-nil)?
>
> Best,
> Ihor
>
>


Re: Bug: org-contacts.el: org-contacts-link-store breaks org-id [9.4.2 (release_9.4.2-307-g8840af @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-12-16 Thread stardiviner
Sure, I didn't expected that soon bug appears. I checked source code, I
commented out an condition accidentally.
Here is the patch. Tested it should work 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, Dec 16, 2020 at 7:40 PM Bastien  wrote:

> Hi,
>
> Ihor Radchenko  writes:
>
> > When using org-contacts and org-id simultaneously, org-contacts
> > unconditionally makes org-store-link use file:name.org:*Headline link
> > style instead of id:UUID link style expected when using org-id. The
> > problem does not only appears when storing links to contact.org
> > headlines, but for any headlines.
> >
> > Probably, org-contacts should be integrated with org-id or at least not
> > interfere with links to ordinary headlines.
>
> Agreed.  Stardiviner, can you have a look?
>
> Thanks,
>
> --
>  Bastien
>
From db33924b9439a5a787b30e985cf005ba11347642 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Thu, 17 Dec 2020 08:19:35 +0800
Subject: [PATCH] org-contacts: Fix org-store-link error caused by
 org-contacts-link-store

* contrib/lisp/org-contacts.el (org-contacts-link-store): Fix Org store
link by adding missing condition for org-contacts.
---
 contrib/lisp/org-contacts.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 310166d53..44ba455c4 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -1157,8 +1157,8 @@ (org-link-set-parameters "org-contact"
 
 (defun org-contacts-link-store ()
   "Store the contact in `org-contacts-files' with a link."
-  (when (eq major-mode 'org-mode)
-;; (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files))
+  (when (and (eq major-mode 'org-mode)
+	 (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files)))
 (let ((headline-str (substring-no-properties (org-get-heading t t t t
   (org-store-link-props
:type "org-contact"
-- 
2.29.2



Re: [final patch] Re: add new link type "contact:" for org-contacts.el

2020-12-15 Thread stardiviner
Thanks for reviewing.

Don't know why, it's been applied in the "master" branch already by you. (I
did git pull from upstream)
Here is the commit:
e9c3993ee * | org-contacts.el: Add new link type "contact:"

If this is confirmed, I might don't need to add a new patch to add my name
to maintainer. Can you add it directly? That will be more simple.

[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 15, 2020 at 5:56 PM Bastien  wrote:

> stardiviner  writes:
>
> > My patch still in the previous "[UPDATED PATCH]" state. (I attached
> > in this email)
>
> Thanks.  It applies correctly on the maint branch but I'd rather apply
> it againt the master branch, where it fails to apply.
>
> Can you replay your changes on top of the main branch, and also add
> your name as the maintainer?
>
> Thanks a lot!
>
> --
>  Bastien
>


[final patch] Re: add new link type "contact:" for org-contacts.el

2020-12-15 Thread stardiviner
My patch still in the previous "[UPDATED PATCH]" state. (I attached in this
email)

I can take a try to be the maintainer for org-contacts.el
Seems it's not very frequently mentioned. So I don't spend too much time on
it.

[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, Dec 14, 2020 at 2:06 PM Bastien  wrote:

> Hi stardiviner,
>
> what is the last state of your patch?  Feel free to resend it,
> I will apply it.
>
> Also, do you want to become the maintainer for org-contacts.el?
>
> Remember, elisp files in contrib/ will soon be extracted from
> the repository: https://orgmode.org/list/87wnzfy60h@bzg.fr
>
> Still, it's useful to already know who will be in charge.
>
> Thanks,
>
> --
>  Bastien
>
From 7446c0dda49554db0af18401984d20b9b460d408 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 30 Oct 2020 15:11:53 +0800
Subject: [PATCH] org-contacts.el: Add new link type "contact:"

* contrib/lisp/org-contacts.el (org-contacts-link-store): Store a link
of org-contacts in Org file.

* contrib/lisp/org-contacts.el (org-contacts-link-open): Open contact:
link in Org file.

* contrib/lisp/org-contacts.el (org-contacts-link-complete): Insert a
contact: link with completion of contacts.

* contrib/lisp/org-contacts.el (org-contacts-link-face): Set different
face for contact: link.
---
 contrib/lisp/org-contacts.el | 75 
 1 file changed, 75 insertions(+)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 4b3693a0e..d8d498425 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -1146,6 +1146,81 @@ (defun org-contacts-split-property (string  separators omit-nulls)
 (setq proplist (cons bufferstring proplist
 (cdr (reverse proplist
 
+;;; Add an Org link type `org-contact:' for easy jump to or searching org-contacts headline.
+;;; link spec: [[org-contact:query][desc]]
+(org-link-set-parameters "org-contact"
+			 :follow 'org-contacts-link-open
+			 :complete 'org-contacts-link-complete
+			 :store 'org-contacts-link-store
+			 :face 'org-contacts-link-face)
+
+(defun org-contacts-link-store ()
+  "Store the contact in `org-contacts-files' with a link."
+  (when (eq major-mode 'org-mode)
+;; (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files))
+(let ((headline-str (substring-no-properties (org-get-heading t t t t
+  (org-store-link-props
+   :type "org-contact"
+   :link headline-str
+   :description headline-str
+
+(defun org-contacts--all-contacts ()
+  "Return an alist (name . (file . position)) of all contacts in `org-contacts-files'."
+  (car (mapcar
+	(lambda (file)
+	  (unless (buffer-live-p (get-buffer (file-name-nondirectory file)))
+	(find-file file))
+	  (with-current-buffer (get-buffer (file-name-nondirectory file))
+	(org-map-entries
+	 (lambda ()
+	   (let ((name (substring-no-properties (org-get-heading t t t t)))
+		 (file (buffer-file-name))
+		 (position (point)))
+		 `(:name ,name :file ,file :position ,position))
+	org-contacts-files)))
+
+(defun org-contacts-link-open (path)
+  "Open contacts: link type with jumping or searching."
+  (let ((query path))
+(cond
+ ((string-match "/.*/" query)
+  (let* ((f (car org-contacts-files))
+	 (buf (get-buffer (file-name-nondirectory f
+	(unless (buffer-live-p buf) (find-file f))
+	(with-current-buffer buf
+	  (string-match "/\\(.*\\)/" query)
+	  (occur (match-string 1 query)
+ (t
+  (let* ((f (car org-contacts-files))
+	 (buf (get-buffer (file-name-nondirectory f
+	(unless (buffer-live-p buf) (find-file f))
+	(with-current-buffer buf
+	  (goto-char (marker-position (org-find-exact-headline-in-buffer query)
+  ;; FIXME
+  ;; (let* ((contact-entry (plist-get (org-contacts--all-contacts) query))
+  ;; 	 (contact-name (plist-get contact-entry :name))
+  ;; 	 (file (plist-get contact-entry :file))
+  ;; 	 (position (plist-get contact-entry :position))
+  ;; 	 (buf (get-buffer (file-name-nondirectory file
+  ;; 	(unless (buffer-live-p buf) (find-file file))
+  ;; 	(with-current-buffer buf (goto-char position)))
+  
+
+(defun org-contacts-link-complete ( arg)
+  "Create a org-contacts link using completion."
+  (let ((name (completing-read "org-contact Name: "
+			   (mapcar
+(lambda (plist) (plist-get plist :name))
+(org-contacts--all-contacts)
+(concat "org-contact:" name)))
+
+(defun org-contacts-link-face (path)
+  "Different face color for different org-contacts link query.&quo

Re: More on design of org-contacts.el - Re: [UPDATED PATCH] Re: add new link type "contact:" for org-contacts.el

2020-12-15 Thread stardiviner
Change an email is hard word for me. I use gmail address for many places.
I started to use new email for new accounts recently.
But switch email need to be later when I have time and desire.
And thanks for your suggestion of mail services. :smile:

[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 17, 2020 at 2:50 PM Jean Louis  wrote:

> * stardiviner  [2020-11-16 13:21]:
> :PROPERTIES:
> :ID:   e2c30814-b983-4391-869a-3c700d041467
> :END:
> >
> > First, thank your very much for suggestion.
> >
> > What really I have not found your email in my Gmail (in web
> > browser),
>
> Maybe because it went to Spam/Junk folder. For privacy and safety
> reasons I do not recommend using Gmail at all.
>
> I may recommend using your own email address, requires some money, or
> https://posteo.de/ https://tutanota.de/ or https://protonmail.ch/
>
> > I found it in mu4e (Emacs). Which I can't reply because I'm in
> > China, sendmail to Gmail SMTP server is blocked. So I'm replying you
> > in mu4e. Don't know whether you can receive my message.
>
> I wish I could understand, mu4e is only local system that searches
> emails on your computer. How you send emails depends on your email
> provider. Maybe you fetch mailing list to search for emails?
>
> > Using unique ID is the only solution to identity contact. I already
> thought
> > about this. But integrating org-id is hard for me. Have not spent that
> time on
> > it yet. But I will, if I want to improve this org-contacts.
>
> If I may just give idea. I am using this below function to
> automatically get ID numbers for headings. Normally it is by
> saving. Maybe you can do something to automatically insert such
> number. I do not know if heading is contact, but if it is, it becomes
> all easier.
>
> (defun rcd-org-add-ids-to-headlines-in-file ()
>   "Add ID properties to all headlines in the current file which
> do not already have one."
>   (interactive)
>   (org-map-entries 'org-id-get-create))
>
> > > Each hyperdocument (within or without Emacs) that allows back linking
> > > to its specifical parts should have a function or key binding to
> > > quickly obtain the link reference.
>
> Once you have decided how is contact referenced as now is referenced
> by query, I could maybe figure how to obtain the reference.
>
> It should not be that hard:
>
> - find the current heading
>
> - find current ID number
>
> - how link should look like could be customizable, maybe heading as
>   visible part. That requires discussion.
>
> - prepare link into memory for pasting in other window or document.
>
> - it should also be possible to insert such into register.
>
> - the option to obtain link by query should be kept intact
>
> Maybe two keybindings or functions can be made:
>
> ** Proposal
> :PROPERTIES:
> :ID:   a566d476-f478-44d8-8d91-53f6eccca10b
> :END:
>
> 1. One that finds the current heading and obtains the link
>
> (defun capture-contact-by-query-to-heading ()
>   (let* ((heading (org-get-heading))
>  (link (format "[[org-contact:query#%s][%s]]" heading heading)))
> (kill-new link)))
>
> (capture-contact-by-query-to-heading)
>
> => [[org-contact:query#Proposal][Proposal]]
>
> And such function should be expanded and be customizable:
>
> - maybe user wish to provide format string as maybe user wish to know
>   visually that link leads to contact like:
>
> => [[org-contact:query#John Doe][Contact: John Doe]]
>
> 2. One that finds currentheading by its ID and obtains the link:
>
> (defun capture-contact-by-id-to-heading-1 ()
>   (let* ((heading (org-get-heading))
>  (id (org-id-get))
>  (link (format "[[org-contact:id#%s][%s]]" id heading)))
> link))
>
> (defun capture-contact-by-id-to-heading ()
>   (kill-new (capture-contact-by-id-to-heading-1)))
>
> (capture-contact-by-id-to-heading)
>
> => [[org-contact:id#a566d476-f478-44d8-8d91-53f6eccca10b][Proposal]]
>
> These are design ideas only. You may expand and make checks on these
> functions that such work properly.
>
> Additional functions that may be very usable is to quickly send links
> to other window. User is collecting the database of contacts in one
> file and one window and wishes to insert links into other window that
> references such contacts. In that file where you need a link you would
> arrive with cursor. Then you go to database of contacts and invoke a
> key that send

[FIXED] Re: Archive an task which has un-indented logbook caused error

2020-12-08 Thread stardiviner
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 Wed, Dec 9, 2020 at 1:04 PM Kyle Meyer  wrote:

> Kyle Meyer writes:
>
> > Thanks for reporting.  This is the same error as reported by Duianto at
> >
> https://orgmode.org/list/cae-tx7i5ew3ed3yx6jjx57qnurtv0aumwkue0w83yuureke...@mail.gmail.com
> >
> > It bisects to 11ef7454a (org.el (org-fixup-indentation): Fix logbook
> > drawers indentation, 2020-09-07).
>
> As mentioned in the earlier thread, the issue should be fixed by
> 2eb5f0741.
>


Archive an task which has un-indented logbook caused error

2020-12-07 Thread stardiviner
etree-subheading-p (> nsub 0))) (setq datetree-date
(org-date-to-gregorian (or ... time) (if (and (> (length heading) 0)
(string-match "^\\*+" heading)) (setq level (match-end 0)) (setq heading
nil level 0)) (save-excursion (org-back-to-heading t) (let* ((all-tags
(org-get-tags)) (local-tags (cl-remove-if ... all-tags)) (inherited-tags
(cl-remove-if-not ... all-tags)) (context (list ... ... ... ... ... ...
...))) (let (this-command) (org-copy-subtree 1 nil t)) (set-buffer buffer)
(if (not (derived-mode-p ...)) (let (... ...) (call-interactively ...)))
(if (and newfile-p org-archive-file-header-format) (progn (goto-char ...)
(insert ...))) (if datetree-date (progn (require ...)
(org-datetree-find-date-create datetree-date) (org-narrow-to-subtree)))
(let ((org-todo-line-regexp tr-org-todo-line-regexp) (org-todo-keywords-1
tr-org-todo-keywords-1) (org-todo-kwd-alist tr-org-todo-kwd-alist)
(org-done-keywords tr-org-done-keywords) (org-todo-regexp
tr-org-todo-regexp) (org-todo-line-regexp tr-org-todo-line-regexp))
(goto-char (point-min)) (org-show-all '...) (if (and heading ...) (progn
... ... ... ... ...) (if org-archive-reversed-order ... ... ...))
(org-paste-subtree (org-get-valid-level level ...)) (and inherited-tags (or
... ...) (org-set-tags all-tags)) (if (and org-archive-mark-done ... ...)
(progn ...)) (let (...) (while --dolist-tail-- ...)) (if (eq this-buffer
buffer) nil (if ... ...)) (widen (run-hooks 'org-archive-hook) (let
(this-command) (org-cut-subtree)) (if (featurep 'org-inlinetask) (progn
(org-inlinetask-remove-END-maybe))) (setq org-markers-to-move nil) (if
org-provide-todo-statistics (progn (save-excursion (org-up-heading-safe)
(org-update-statistics-cookies nil (message "Subtree archived %s" (if
(eq this-buffer buffer) (concat "under heading: " heading) (concat "in
file: " (abbreviate-file-name afile)))
  (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
(let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
'region-start-level 'region)) org-loop-over-headlines-in-active-region)
(org-map-entries (list 'progn '(setq org-map-continue-from (progn
(org-back-to-heading) (point))) (list 'org-archive-subtree find-done))
org-loop-over-headlines-in-active-region cl (if (org-invisible-p)
(org-end-of-subtree nil t (cond ((equal find-done '(4))
(org-archive-all-done)) ((equal find-done '(16)) (org-archive-all-old)) (t
(let* ((tr-org-todo-keywords-1 org-todo-keywords-1) (tr-org-todo-kwd-alist
org-todo-kwd-alist) (tr-org-done-keywords org-done-keywords)
(tr-org-todo-regexp org-todo-regexp) (tr-org-todo-line-regexp
org-todo-line-regexp) (tr-org-odd-levels-only org-odd-levels-only)
(this-buffer (current-buffer)) (time (format-time-string (substring ... 1
-1))) (file (abbreviate-file-name (or ... ...))) (location
(org-archive--compute-location (or ... org-archive-location))) (afile (car
location)) (heading (cdr location)) (infile-p (equal file
(abbreviate-file-name ...))) (newfile-p (and (org-string-nw-p afile) (not
...))) (buffer (cond (... this-buffer) (...) (...) (t ...)))
(org-odd-levels-only (if (local-variable-p ... ...) org-odd-levels-only
tr-org-odd-levels-only)) level datetree-date datetree-subheading-p) (if
(string-match "\\`datetree/\\(\\**\\)" heading) (progn (let (...) (setq
heading ...) (setq datetree-subheading-p ...)) (setq datetree-date
(org-date-to-gregorian ... (if (and (> (length heading) 0)
(string-match "^\\*+" heading)) (setq level (match-end 0)) (setq heading
nil level 0)) (save-excursion (org-back-to-heading t) (let* ((all-tags ...)
(local-tags ...) (inherited-tags ...) (context ...)) (let (this-command)
(org-copy-subtree 1 nil t)) (set-buffer buffer) (if (not ...) (let ...
...)) (if (and newfile-p org-archive-file-header-format) (progn ... ...))
(if datetree-date (progn ... ... ...)) (let (... ... ... ... ... ...)
(goto-char ...) (org-show-all ...) (if ... ... ...) (org-paste-subtree ...)
(and inherited-tags ... ...) (if ... ...) (let ... ...) (if ... nil ...)
(widen (run-hooks 'org-archive-hook) (let (this-command)
(org-cut-subtree)) (if (featurep 'org-inlinetask) (progn
(org-inlinetask-remove-END-maybe))) (setq org-markers-to-move nil) (if
org-provide-todo-statistics (progn (save-excursion (org-up-heading-safe)
(org-update-statistics-cookies nil (message "Subtree archived %s" (if
(eq this-buffer buffer) (concat "under heading: " heading) (concat "in
file: " (abbreviate-file-name afile))) (org-reveal) (if (looking-at "^[
\11]*$") (outline-next-visible-heading 1)))
  org-archive-subtree(nil)
  funcall-interactively(org-archive-subtree nil)
  call-interactively(org-archive-subtree)
  org-archive-subtree-default()
  funcall-interactively(org-archive-subtree-default)
  call-interactively(org-archive-subtree-default nil nil)
  command-execute(org-archive-subtree-default)
```


[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] I updated patch by deleteing duplicate tags

2020-12-02 Thread stardiviner
[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 2, 2020 at 5:30 PM stardiviner  wrote:

> The default [C-c C-q] completing tags only retrieve tags from current
> buffer locally.
>
> By this patch, will merge both buffer-local tags and user defined global
> `org-tags-alist`.
>
> This is more reasonable.
>
>
> [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 95060ad30d2c7fd5db432b2058627ee48d1586b0 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Wed, 2 Dec 2020 17:24:29 +0800
Subject: [PATCH] org.el: Complete tags from both global and buffer local

* lisp/org.el: (org-fast-tag-selection): merge buffer local tags with
global alist of tags.
---
 lisp/org.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0e12e4b15..287b8c407 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12256,10 +12256,13 @@ (defun org-fast-tag-selection (current inherited table  todo-table)
 		(condition-case nil
 			(setq tg (completing-read
   "Tag: "
-  (or buffer-tags
-  (with-current-buffer buf
-	(setq buffer-tags
-	  (org-get-buffer-tags))
+  (delq nil
+	(delete-dups
+	 (append (or buffer-tags
+		 (with-current-buffer buf
+		   (setq buffer-tags
+			 (org-get-buffer-tags
+		 (org-global-tags-completion-table))
 		  (quit (setq tg "")))
 		(when (string-match "\\S-" tg)
 		  (cl-pushnew (list tg) buffer-tags :test #'equal)
-- 
2.29.2



[PATCH] [C-c C-q] completing tags from both buffer-local and global alist of tags

2020-12-02 Thread stardiviner
The default [C-c C-q] completing tags only retrieve tags from current
buffer locally.

By this patch, will merge both buffer-local tags and user defined global
`org-tags-alist`.

This is more reasonable.


[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 c1f88411835f34a8c571547bf8156c98f18d2b2e Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Wed, 2 Dec 2020 17:24:29 +0800
Subject: [PATCH] org.el: Complete tags from both global and buffer local

* lisp/org.el: (org-fast-tag-selection): merge buffer local tags with
global alist of tags.
---
 lisp/org.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0e12e4b15..0249a43c3 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12256,10 +12256,11 @@ (defun org-fast-tag-selection (current inherited table  todo-table)
 		(condition-case nil
 			(setq tg (completing-read
   "Tag: "
-  (or buffer-tags
-  (with-current-buffer buf
-	(setq buffer-tags
-	  (org-get-buffer-tags))
+  (append (or buffer-tags
+	  (with-current-buffer buf
+		(setq buffer-tags
+		  (org-get-buffer-tags
+	  (org-global-tags-completion-table
 		  (quit (setq tg "")))
 		(when (string-match "\\S-" tg)
 		  (cl-pushnew (list tg) buffer-tags :test #'equal)
-- 
2.29.2



Re: More on design of org-contacts.el - Re: [UPDATED PATCH] Re: add new link type "contact:" for org-contacts.el

2020-11-16 Thread stardiviner


First, thank your very much for suggestion.

What really I have not found your email in my Gmail (in web browser), I found it
in mu4e (Emacs). Which I can't reply because I'm in China, sendmail to Gmail
SMTP server is blocked. So I'm replying you in mu4e. Don't know whether you can
receive my message.

Jean Louis  writes:

> * stardiviner  [2020-11-11 15:05]:
>   :PROPERTIES:
>   :CREATED:  [2020-11-11 Wed 16:57]
>   :ID:   17d463d2-ff0c-4614-93da-06e3de8e6035
>   :END:
>> Thank you too.
>> I indeed want to extend org-contacts.el. So I would like to be it's
>> maintainer.
>> 
>> Currently how many org-mode maintainer(mailing list manager)?
>> If patch need to wait a month. Because I spend less time on org-mode too
>> comparing before time. I agree with that, I might will add multiple PATCHes
>> together.
>
> Side notes:
>
> I have looked into contacts. It relies on a query to find a contact. I
> hope that I am right.
>
> Text based Org mode anyway may rely on built-in text searches like
> incremental Emacs's search.
>
> org-contact wishes to pin point to specific contact. It wants to
> create a hyperlink to one specific contact. It does not want to find 2
> contacts with the same query or more of them. 
>
> As I have 195000 contacts in PostgreSQL database I know from browsing
> them that many of them have same unique names. To reference to a
> specific contact by using name query would be useless as I could miss
> it and take other contact. Thus search involves narrowing contacts by
> maybe state, location and other filters. Each contact has its own
> uniquely assigned ID number. An integer assigned by the database
> automatically.
>
> By using the ID number I can easily capture the reference link to th
> contact from the database and insert such link into the Org file. As
> long as I do not change the ID number even if contact name is changed
> I would be able to pin point the specific number.
>
> Thus for org-contacts I recommend creation of unique IDs in the
> properties for headings for each contact so that contact may be
> referenced by the unique ID.

Using unique ID is the only solution to identity contact. I already thought
about this. But integrating org-id is hard for me. Have not spent that time on
it yet. But I will, if I want to improve this org-contacts.

>
> Additional proposals:
>
> Each hyperdocument (within or without Emacs) that allows back linking
> to its specifical parts should have a function or key binding to
> quickly obtain the link reference.
>
> For example if user browses heading for *** John Doe anywhere within
> such heading user should be able to press a key to capture the link to
> the contact automatically.
>
> In the file my-contacts.org:
>
> *** John Doe
> :PROPERTIES:
> :ID:   cc400d57-2adf-47af-90d9-c4d9fdd70d2b
> :CREATED:  [2020-11-11 Wed 16:57]
> :END:
>
> DATA
>
>  DATA
>  :PROPERTIES:
>  :CREATED:  [2020-11-11 Wed 16:57]
>  :ID:   19781b53-211b-4291-af48-5f3655dd7cec
>  :END:
>
>  DATA
>  :PROPERTIES:
>  :CREATED:  [2020-11-11 Wed 16:57]
>  :ID:   e8eb6647-8d8e-4ec6-b759-43dcfd60d17b
>  :END:
>
> Anywhere within the subtree for John Doe user should be able to obtain
> the reference to the contact. For example by clicking `C-x w'.
>
> Upon key press following link could then be stored into memory, or
> register, whatever is better design:
>
> [[org-contact:~/file/my-contacts.org#cc400d57-2adf-47af-90d9-c4d9fdd70d2b][John
>  Doe]]
>
> Then user would go to other Org file and use `C-y' to yank the contact
> into the new file.
>
> One shall consider that obtaining the object reference should be
> on the fly customizable. As maybe I wish to have in the link:
>
> - Contact's first name only like when addressing friends
>
> - Contact's full name, with or without middle names
>
> - Contact's name plus city and country
>
> Having several ways to obtain quickly reference to the contact (to
> generate link in memory) is useful feature that shortens the time and
> makes it less error prone for the user. If only query is used with
> simple typo contact link will not work. What will follow is tedious
> browsing and opening of files to find the right contact.
>
> User can have many Org contact files and file reference should be
> included into the file. This assumes that files should be fixed in
> file system.
>
> This proposal follows the Doug Engelbart's Technology Template Project
> for Open Hyperdocument Systems (OHS) in relation to addressing:
> https://www.dougengelbart.org/content/view/110/460/#2b1
>
> Global, Human-Understandable, Ob

[SUGGESTION] Let org-set-tags-command TAB complete with more tags.

2020-11-13 Thread stardiviner
Currently press [TAB] key in `org-set-tags-command` will provide current
buffer tags as completion candidates. This is very less.
 I suggest providing all tags in candidates.
Here is a modification.

#+begin_src diff
modified   lisp/org.el
@@ -12254,12 +12254,7 @@ (defun org-fast-tag-selection (current inherited
table  todo-table)
 (when exit-after-next (setq exit-after-next 'now)))
((= c ?\t)
 (condition-case nil
- (setq tg (completing-read
-  "Tag: "
-  (or buffer-tags
-  (with-current-buffer buf
- (setq buffer-tags
-  (org-get-buffer-tags))
+ (setq tg (completing-read "Tag: " (org-global-tags-completion-table)))
   (quit (setq tg "")))
 (when (string-match "\\S-" tg)
   (cl-pushnew (list tg) buffer-tags :test #'equal)
#+end_src

The Org Mode has `org-tag-alist` for user to setting default fast-selection
tags group. I don't know whether function
`(org-global-tags-completion-table)` already merged with `org-tag-alist`.
It seems only get tags from all Agenda files after I checked out its 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/


Re: [UPDATED PATCH] Re: add new link type "contact:" for org-contacts.el

2020-11-11 Thread stardiviner
Thank you too.
I indeed want to extend org-contacts.el. So I would like to be it's
maintainer.

Currently how many org-mode maintainer(mailing list manager)?
If patch need to wait a month. Because I spend less time on org-mode too
comparing before time. I agree with that, I might will add multiple PATCHes
together.


[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 11, 2020 at 4:37 PM Bastien  wrote:

> Hi Stardiviner,
>
> stardiviner  writes:
>
> > You're right. Thanks for suggestion.
> > I attached new patch now.
>
> Applied, thanks.
>
> Would you like to be org-contacts.el maintainer?
>
> Beware that, since it is in contrib/, it will soon be extracted from
> org-mode.git and temporarily live in a org-contrib.git repository.
>
> Files in this org-contrib.git will wait for maintainers to take over
> and maintain the file elsewhere, so you'd be free to maintain it where
> you see fit.
>
> --
>  Bastien
>


[UPDATED PATCH] Re: add new link type "contact:" for org-contacts.el

2020-11-09 Thread stardiviner
You're right. Thanks for suggestion.
I attached new patch 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 Mon, Nov 9, 2020 at 7:05 PM Jean Louis  wrote:

> * stardiviner  [2020-11-09 03:25]:
> > After waited some days, still no reponse, so I popup this email.
> > Can some Org maintainer review my patch? Thanks.
> > It does not changed org-contacts.el core logic. Just added a new link
> type.
> > Should be easy to review.
>
> If I may say, many people manage their contacts and it can be by
> various ways, I am managing my contacts and by default use "contact:"
>
> I find it useful for people to leave "contact:" link free and not bind
> it to org-contact package.
>
> Instead it is more pointful to make "org-contact:" link that
> specificaly points to contacts for org-contact package.
>
> Just "org-contact:" instead of "contact:"
>
>
From 7446c0dda49554db0af18401984d20b9b460d408 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 30 Oct 2020 15:11:53 +0800
Subject: [PATCH] org-contacts.el: Add new link type "contact:"

* contrib/lisp/org-contacts.el (org-contacts-link-store): Store a link
of org-contacts in Org file.

* contrib/lisp/org-contacts.el (org-contacts-link-open): Open contact:
link in Org file.

* contrib/lisp/org-contacts.el (org-contacts-link-complete): Insert a
contact: link with completion of contacts.

* contrib/lisp/org-contacts.el (org-contacts-link-face): Set different
face for contact: link.
---
 contrib/lisp/org-contacts.el | 75 
 1 file changed, 75 insertions(+)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 4b3693a0e..d8d498425 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -1146,6 +1146,81 @@ (defun org-contacts-split-property (string  separators omit-nulls)
 (setq proplist (cons bufferstring proplist
 (cdr (reverse proplist
 
+;;; Add an Org link type `org-contact:' for easy jump to or searching org-contacts headline.
+;;; link spec: [[org-contact:query][desc]]
+(org-link-set-parameters "org-contact"
+			 :follow 'org-contacts-link-open
+			 :complete 'org-contacts-link-complete
+			 :store 'org-contacts-link-store
+			 :face 'org-contacts-link-face)
+
+(defun org-contacts-link-store ()
+  "Store the contact in `org-contacts-files' with a link."
+  (when (eq major-mode 'org-mode)
+;; (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files))
+(let ((headline-str (substring-no-properties (org-get-heading t t t t
+  (org-store-link-props
+   :type "org-contact"
+   :link headline-str
+   :description headline-str
+
+(defun org-contacts--all-contacts ()
+  "Return an alist (name . (file . position)) of all contacts in `org-contacts-files'."
+  (car (mapcar
+	(lambda (file)
+	  (unless (buffer-live-p (get-buffer (file-name-nondirectory file)))
+	(find-file file))
+	  (with-current-buffer (get-buffer (file-name-nondirectory file))
+	(org-map-entries
+	 (lambda ()
+	   (let ((name (substring-no-properties (org-get-heading t t t t)))
+		 (file (buffer-file-name))
+		 (position (point)))
+		 `(:name ,name :file ,file :position ,position))
+	org-contacts-files)))
+
+(defun org-contacts-link-open (path)
+  "Open contacts: link type with jumping or searching."
+  (let ((query path))
+(cond
+ ((string-match "/.*/" query)
+  (let* ((f (car org-contacts-files))
+	 (buf (get-buffer (file-name-nondirectory f
+	(unless (buffer-live-p buf) (find-file f))
+	(with-current-buffer buf
+	  (string-match "/\\(.*\\)/" query)
+	  (occur (match-string 1 query)
+ (t
+  (let* ((f (car org-contacts-files))
+	 (buf (get-buffer (file-name-nondirectory f
+	(unless (buffer-live-p buf) (find-file f))
+	(with-current-buffer buf
+	  (goto-char (marker-position (org-find-exact-headline-in-buffer query)
+  ;; FIXME
+  ;; (let* ((contact-entry (plist-get (org-contacts--all-contacts) query))
+  ;; 	 (contact-name (plist-get contact-entry :name))
+  ;; 	 (file (plist-get contact-entry :file))
+  ;; 	 (position (plist-get contact-entry :position))
+  ;; 	 (buf (get-buffer (file-name-nondirectory file
+  ;; 	(unless (buffer-live-p buf) (find-file file))
+  ;; 	(with-current-buffer buf (goto-char position)))
+  
+
+(defun org-contacts-link-complete ( arg)
+  "Create a org-contacts link using completion."
+  (let ((name (completing-read "org-contact Name: "
+			   (mapcar
+(lambda (plist) (plist-get plist :name))

Re: [PATCH] add new link type "contact:" for org-contacts.el

2020-11-08 Thread stardiviner
After waited some days, still no reponse, so I popup this email.
Can some Org maintainer review my patch? Thanks.
It does not changed org-contacts.el core logic. Just added a new link type.
Should be easy to review.

[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, Oct 30, 2020 at 3:44 PM stardiviner  wrote:

> Accidentally pressed send button without email body.
> Hope org-contacts.el author can review 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 Fri, Oct 30, 2020 at 3:35 PM stardiviner  wrote:
>
>>
>>
>> [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: Org mode fontification error in # in python and ipython source blocks

2020-11-03 Thread stardiviner
Thanks for noting. :) I added that in my Emacs config 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 Tue, Nov 3, 2020 at 5:53 PM Sebastian Gimeno 
wrote:

> Dear Stardiviner,
>
> I used the "scimax" configuration. Scimax's maintainer, John Kitchin,
> helped me out to find the root cause of the problem, i.e. the following
> addition to " python-font-lock-keywords":
>
> (setq python-font-lock-keywords
>   (append python-font-lock-keywords
>  '(;; this is the full string.
> ;; group 1 is the quote type and a closing quote is matched
> ;; group 2 is the string part
> (
> ;; "f\\(['\"]\\{1,3\\}\\)\\([^\\1]+?\\)\\1"
> "f\\(['\"]\\{1,3\\}\\)\\(.+?\\)\\1"
> ;; these are the {keywords}
> ("{[^}]*?}"
>  ;; Pre-match form
>  (progn (goto-char (match-beginning 0)) (match-end 0))
>  ;; Post-match form
>  (goto-char (match-end 0))
>  ;; face for this match
>  (0 font-lock-variable-name-face t))
>
> Commenting out this code snippet, the fontfying / HTML-export problem goes
> away.
>
> Cheers,
> sebastian
>
>
>
>
> On Tue, Nov 3, 2020 at 6:50 AM stardiviner  wrote:
>
>> I have same problem sometimes in different babel languages.
>> I would like to know what caused this problem too.
>> Can you send me a message after you solved problem? Thanks in advance. :)
>> smile
>>
>> [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 2, 2020 at 2:26 AM Sebastian Gimeno 
>> wrote:
>>
>>> Hi,
>>>
>>> I am using emacs 27.1 and org-plus-contrib 20201026.
>>>
>>> I am having problems with the fontification of python and ipython
>>> source blocks when the code contains curly brackets "{}" (other course
>>> blocks are ok). For instance, the following snippet
>>>
>>> #+BEGIN_SRC python :results drawer
>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3])
>>> plt.show()
>>> a=1
>>> print("a={}".format{a})
>>> #+END_SRC
>>>
>>> does not fontify correctly in either python or ipython source blocks.
>>>
>>> As a consequence, when exporting the org file to HTML (C-c C-e h h), it
>>> fails with the following message:
>>>
>>> font-lock-fontify-keywords-region: Invalid function: #
>>>
>>> If changing the code snippet to:
>>>
>>> #+BEGIN_SRC python :results drawer
>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3])
>>> plt.show()
>>> a=1
>>> print("a=%s" % a)
>>> #+END_SRC
>>>
>>> the block fontifies and the file is exported to HTML correctly.
>>>
>>> Can you reproduce this behaviour?
>>>
>>> Many thanks in advance!
>>>
>>


Re: Org mode fontification error in # in python and ipython source blocks

2020-11-02 Thread stardiviner
I have same problem sometimes in different babel languages.
I would like to know what caused this problem too.
Can you send me a message after you solved problem? Thanks in advance. :)
smile

[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 2, 2020 at 2:26 AM Sebastian Gimeno 
wrote:

> Hi,
>
> I am using emacs 27.1 and org-plus-contrib 20201026.
>
> I am having problems with the fontification of python and ipython source
> blocks when the code contains curly brackets "{}" (other course blocks are
> ok). For instance, the following snippet
>
> #+BEGIN_SRC python :results drawer
> import matplotlib.pyplot as plt
> plt.plot([1,2,3])
> plt.show()
> a=1
> print("a={}".format{a})
> #+END_SRC
>
> does not fontify correctly in either python or ipython source blocks.
>
> As a consequence, when exporting the org file to HTML (C-c C-e h h), it
> fails with the following message:
>
> font-lock-fontify-keywords-region: Invalid function: #
>
> If changing the code snippet to:
>
> #+BEGIN_SRC python :results drawer
> import matplotlib.pyplot as plt
> plt.plot([1,2,3])
> plt.show()
> a=1
> print("a=%s" % a)
> #+END_SRC
>
> the block fontifies and the file is exported to HTML correctly.
>
> Can you reproduce this behaviour?
>
> Many thanks in advance!
>


Re: [PATCH] add new link type "contact:" for org-contacts.el

2020-10-30 Thread stardiviner
Accidentally pressed send button without email body.
Hope org-contacts.el author can review 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 Fri, Oct 30, 2020 at 3:35 PM stardiviner  wrote:

>
>
> [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] add new link type "contact:" for org-contacts.el

2020-10-30 Thread stardiviner
[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 18b12dac615085e4c55029568b65c30b17ec5189 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 30 Oct 2020 15:11:53 +0800
Subject: [PATCH] org-contacts.el: Add new link type "contact:"

* contrib/lisp/org-contacts.el (org-contacts-link-store): Store a link
of org-contacts in Org file.

* contrib/lisp/org-contacts.el (org-contacts-link-open): Open contact:
link in Org file.

* contrib/lisp/org-contacts.el (org-contacts-link-complete): Insert a
contact: link with completion of contacts.

* contrib/lisp/org-contacts.el (org-contacts-link-face): Set different
face for contact: link.
---
 contrib/lisp/org-contacts.el | 66 
 1 file changed, 66 insertions(+)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 4b3693a0e..851802916 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -1146,6 +1146,72 @@ (defun org-contacts-split-property (string  separators omit-nulls)
 (setq proplist (cons bufferstring proplist
 (cdr (reverse proplist
 
+;;; Add an Org link type `contact:' for easy jump to or searching org-contacts headline.
+;;; link spec: [[contact:query][desc]]
+(org-link-set-parameters "contact"
+			 :follow 'org-contacts-link-open
+			 :complete 'org-contacts-link-complete
+			 :store 'org-contacts-link-store
+			 :face 'org-contacts-link-face)
+
+(defun org-contacts-link-store ()
+  "Store the contact in `org-contacts-files' with a link."
+  (when (eq major-mode 'org-mode)
+;; (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files))
+(let ((headline-str (substring-no-properties (org-get-heading t t t t
+  (org-store-link-props
+   :type "contact"
+   :link headline-str
+   :description headline-str
+
+(defun org-contacts--all-contacts ()
+  "Return an alist (name . (file . position)) of all contacts in `org-contacts-files'."
+  (car (mapcar
+	(lambda (file)
+	  (unless (buffer-live-p (get-buffer (file-name-nondirectory file)))
+	(find-file file))
+	  (with-current-buffer (get-buffer (file-name-nondirectory file))
+	(org-map-entries
+	 (lambda ()
+	   (let ((name (substring-no-properties (org-get-heading t t t t)))
+		 (file (buffer-file-name))
+		 (position (point)))
+		 `(:name ,name :file ,file :position ,position))
+	org-contacts-files)))
+
+(defun org-contacts-link-open (path)
+  "Open contacts: link type with jumping or searching."
+  (let ((query path))
+(cond
+ ((string-match "/.*/" query)
+  (let* ((f (car org-contacts-files))
+	 (buf (get-buffer (file-name-nondirectory f
+	(unless (buffer-live-p buf) (find-file f))
+	(with-current-buffer buf
+	  (string-match "/\\(.*\\)/" query)
+	  (occur (match-string 1 query)
+ (t
+  (let* ((f (car org-contacts-files))
+	 (buf (get-buffer (file-name-nondirectory f
+	(unless (buffer-live-p buf) (find-file f))
+	(with-current-buffer buf
+	  (goto-char (marker-position (org-find-exact-headline-in-buffer query)
+
+(defun org-contacts-link-complete ( arg)
+  "Create a org-contacts link using completion."
+  (let ((name (completing-read "Contact Name: "
+			   (mapcar
+(lambda (plist) (plist-get plist :name))
+(org-contacts--all-contacts)
+(concat "contact:" name)))
+
+(defun org-contacts-link-face (path)
+  "Different face color for different org-contacts link query."
+  (cond
+   ((string-match "/.*/" path)
+'(:background "sky blue" :overline t :slant 'italic))
+   (t '(:background "green yellow" :underline t
+
 (provide 'org-contacts)
 
 ;;; org-contacts.el ends here
-- 
2.28.0



Re: Please help by becoming a maintainer for an Org Babel file

2020-10-28 Thread stardiviner
I see, contribution is sure 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, Oct 28, 2020 at 4:55 PM Bastien  wrote:

> Hi stardiviner,
>
> stardiviner  writes:
>
> > I would like to be a maintainer of ob-clojure.el too.
>
> For now, I'd rather have one maintainer per file than several.
>
> Contributions are always welcome, of course.  If I don't have time to
> maintain ob-clojure.el correctly next year, I'll ask for someone else.
>
> Best,
>
> --
>  Bastien
>


Re: Please help by becoming a maintainer for an Org Babel file

2020-10-27 Thread stardiviner
I would like to be a maintainer of ob-clojure.el 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 Mon, Oct 26, 2020 at 4:08 PM Bastien  wrote:

> Dear all,
>
> we are looking for more maintainers of individual Org Babel files.
>
> Jack and Ian are already in, I added myself to ob-clojure.el.
>
> If you feel like proposing yourself for maintaining an Org Babel
> language, that would be super helpful.
>
> Thanks a lot!
>
> --
>  Bastien
>
>


Re: Please help by becoming a maintainer for an Org Babel file

2020-10-27 Thread stardiviner
I searched my name in maintainer line.

Here is the complete list:
```
File: lisp/ob-eshell.el
   5  25 ;; Author: stardiviner 

File: contrib/lisp/ob-redis.el
   4  25 ;; Author: stardiviner 
   5  29 ;; Maintainer: stardiviner 

File: contrib/lisp/ob-diff.el
   4  25 ;; Author: stardiviner 
   5  29 ;; Maintainer: stardiviner 

File: contrib/lisp/ob-arduino.el
   3  26 ;; Authors: stardiviner 

File: contrib/lisp/ob-spice.el
   5  29 ;; Maintainer: stardiviner (numbch...@gmail.com)

File: contrib/lisp/ob-sclang.el
   6  26 ;; Authors: stardiviner 

File: contrib/lisp/ob-smiles.el
  14  29 ;; Maintainer: stardiviner [numbch...@gmail.com]

File: contrib/lisp/ob-php.el
   4  25 ;; Author: stardiviner 
   5  29 ;; Maintainer: stardiviner 

File: contrib/lisp/ob-clojure-literate.el
   3  26 ;; Authors: stardiviner 
```

I would like to invite some people who is interested in to maintain them
with me. Because I recently don't have much time. Actually they are not
complicated like ob-python or ob-R 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, Oct 26, 2020 at 4:08 PM Bastien  wrote:

> Dear all,
>
> we are looking for more maintainers of individual Org Babel files.
>
> Jack and Ian are already in, I added myself to ob-clojure.el.
>
> If you feel like proposing yourself for maintaining an Org Babel
> language, that would be super helpful.
>
> Thanks a lot!
>
> --
>  Bastien
>
>


Re: New website - back to the old unicorn!

2020-10-27 Thread stardiviner


New website looks clean and elegant, thanks TEC.

TEC  writes:

> Hi Everyone, just a quick note from me:
>
> Regarding the intermediate state, there are a few teething issues 
> that
> have appeared when deploying the site on orgmode.org.*
>
> If we could hold off from announcing this on some of the more
> high-traffic forums till these get sorted out that would be 
> appreciated
> :) We want people to get the best possible first impression of the
> revamp after all.
>
> Timothy.
>
>
> *The favicon, font, and .gif files are not served properly ATM for 
>  example


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Please help by becoming a maintainer for an Org Babel file

2020-10-27 Thread stardiviner


Bastien  writes:

> Dear all,
>
> we are looking for more maintainers of individual Org Babel files.
>
> Jack and Ian are already in, I added myself to ob-clojure.el.
>

I would like to help maintain ob-clojure.el too. Clojure is my main language.

> If you feel like proposing yourself for maintaining an Org Babel
> language, that would be super helpful.
>
> Thanks a lot!


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [PATCH] ob-python: Rename exec tmpfile handle to prevent conflict

2020-10-26 Thread stardiviner


Bastien  writes:

> Hi Jack,
>
> Jack Kamm  writes:
>
>> Thanks Bastien, the Woof! tool looks interesting.
>
> Thanks!  I'm working on a small woof.el package to make it more
> useful for both maintainers (setting headers) and users (checking
> upcoming changes or help requests).
>

This is great and helpful! Thanks Bastien.

>> By the way, on seeing this thread again, I realized this patch
>> probably should have been applied to the maint branch. So I've cherry
>> picked it into there, and merged back into master.
>
> Thanks for this!


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [PATCH] Async session eval (2nd attempt)

2020-10-26 Thread stardiviner
results-file)
> +
>  (provide 'ob-python)
>  
>  ;;; ob-python.el ends here
> diff --git a/testing/lisp/test-ob-python.el b/testing/lisp/test-ob-python.el
> index a2cc7b79c..0267678cd 100644
> --- a/testing/lisp/test-ob-python.el
> +++ b/testing/lisp/test-ob-python.el
> @@ -207,6 +207,67 @@ (ert-deftest test-ob-python/session-value-sleep ()
>  #+end_src"
>   (org-babel-execute-src-block)
>  
> +(ert-deftest test-ob-python/async-simple-session-output ()
> +  (let ((org-babel-temporary-directory "/tmp")
> +(org-confirm-babel-evaluate nil))
> +(org-test-with-temp-text
> + "#+begin_src python :session :async yes :results output
> +import time
> +time.sleep(.1)
> +print('Yep!')
> +#+end_src\n"
> + (should (let ((expected "Yep!"))
> +(and (not (string= expected (org-babel-execute-src-block)))
> +     (string= expected
> +  (progn
> +(sleep-for 0 200)
> +    (goto-char (org-babel-where-is-src-block-result))
> +(org-babel-read-result)
> +
> +(ert-deftest test-ob-python/async-named-output ()
> +  (let (org-confirm-babel-evaluate
> +(org-babel-temporary-directory "/tmp")
> +(src-block "#+begin_src python :async :session :results output
> +print(\"Yep!\")
> +#+end_src")
> +(results-before "
> +
> +#+NAME: foobar
> +#+RESULTS:
> +: Nope!")
> +(results-after "
> +
> +#+NAME: foobar
> +#+RESULTS:
> +: Yep!
> +"))
> +(org-test-with-temp-text
> + (concat src-block results-before)
> + (should (progn (org-babel-execute-src-block)
> +(sleep-for 0 200)
> +(string= (concat src-block results-after)
> + (buffer-string)))
> +
> +(ert-deftest test-ob-python/async-output-drawer ()
> +  (let (org-confirm-babel-evaluate
> +(org-babel-temporary-directory "/tmp")
> +(src-block "#+begin_src python :async :session :results output drawer
> +print(list(range(3)))
> +#+end_src")
> +(result "
> +
> +#+RESULTS:
> +:results:
> +[0, 1, 2]
> +:end:
> +"))
> +(org-test-with-temp-text
> + src-block
> + (should (progn (org-babel-execute-src-block)
> +(sleep-for 0 200)
> +(string= (concat src-block result)
> + (buffer-string)))
> +
>  (provide 'test-ob-python)
>  
>  ;;; test-ob-python.el ends here


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Starting from 9.5, Org contrib will be distributed as a separate Org ELPA package

2020-10-24 Thread stardiviner


Bastien  writes:

> Hi all,
>
> "Org contrib" refers to the list of Emacs lisp files that you find
> in the contrib/ directory of Org's repository:
>
> https://code.orgmode.org/bzg/org-mode/src/master/contrib
>
> The idea of this directory was to have a place where to promote Org
> packages even if they are not part of Org's core (ie the files that go
> into Emacs core.)  It was also useful as a place to welcome packages
> from authors who don't sign the FSF copyright assignment.
>
> Both reasons are kind of obsolete nowadays: many, if not most useful
> Org contributions are published elsewhere.  Also, mixing authors who
> signed the FSF assignment and those who don't is never a good idea
> for a repo, even if the contributions happen in separate spaces.
>
> Org 9.5 will ship without the packages in the contrib/ directory.
>
> Emacs lisp files in contrib/ will be packaged as an Org ELPA package
> that you can install independentely from there.  The files will live
> in a new org-contrib.git repo on code.orgmode.org.
>
> In the long run, every Emacs file in org-contrib.git need to find a
> proper maintainer (who will decide where to maintain it) or to be
> listed in the list of Emacs orphan packages.
>
> If you use Org contrib/ files from git, you will have to clone a 
> new repository when the split is done, within the next weeks.
>
> If you use org-plus-contrib, you don't have anything to do before 
> Org 9.5 is released.  When it is, you will have add Org ELPA to
> your configuration and install org-contrib from there.
>
> If you have any question on this, please let me know!
>
> Best,

I agree with this solution. This is good idea. It will keep maintaining and
debugging Org Mode simpler.

Even though I just use local Git source code for Org Mode. (So don't need to
modify my config at all.)

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Bug: org-cycle stops working on Org files with empty lines at end of buffer [9.4 (9.4-elpaplus @ /home/brentg/.emacs.d/elpa/org-plus-contrib-20200914/)]

2020-10-18 Thread stardiviner


A simple temporary solution to this bug is remove hook function from 
~org-cycle-hook~:

#+begin_src emacs-lisp
(remove-hook 'org-cycle-hook #'org-cycle-show-empty-lines)
#+end_src

stardiviner  writes:

> Bastien  writes:
>
>> Hi,
>>
>> stardiviner  writes:
>>
>>> I also did a bisect debug. Found the function ~org-cycle-show-empty-lines~ 
>>> in hook
>>> ~org-cycle-hook~ caused this problem.
>>
>> Did you find the commit that introduces this bug?
>
> I did a git bisect test, found the bad commit.
>
> "ee3c3b554 | * bad org.el: Allow empty subtrees to be folded back"
>
>>
>> Also, if you can provide a patch, please go ahead.
>>
>
> Can't help on this. Don't know much on regexp matching and position boundries 
> etc.
>
> Will keep improving skill.


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [Share] collect some idea about auto eval code when TAB expand headline

2020-10-16 Thread stardiviner


Jeremie Juste  writes:

> Hello,
>
> I don't see very clearly how you want to use the code.
> (It might well be because of my lack of skills)
>
> Could you give a usage example?

Aha, I forget to copy an example here.

It looks like this.

#+begin_src org
,* 《三生三世 十里桃花》  :LOG:TV:
  :PROPERTIES:
  :EVAL: src_sh{mpg123 "三生三世 十里桃花/杨宗纬 张碧晨 - 凉凉.mp3"} 
  :END:

#+end_src

>
> Best regards,
>
> Jeremie
>
>
> On Friday, 16 Oct 2020 at 13:01, stardiviner wrote:
>> I write an elisp config for Org Mode to auto evaluate inline source block in 
>> property "EVAL".
>>
>> #+begin_src emacs-lisp
>> (defcustom org-property-eval-keywords-list '("EVAL")
>>   "A list of property keywords for evaluate code."
>>   :type 'list
>>   :safe #'listp
>>   :group 'org)
>>
>> (defun org-property-eval-code ( state)
>>   "Evaluate Org inline source block in property value."
>>   (when (memq state '(children subtree))
>> (if-let ((inline-src-block (org-entry-get nil "EVAL" nil)))
>> (with-temp-buffer
>>   (insert inline-src-block)
>>   (goto-char (point-min))
>>   (require 'ob-async nil t)
>>   (setq-local org-babel-default-inline-header-args
>>   '((:results . "silent") (:async . t)))
>>   (let* ((context (org-element-context))
>>  (src-block-info (org-babel-get-src-block-info nil context))
>>  (type (org-element-type context)))
>> (when (eq type 'inline-src-block)
>>   ;; ob-async: `org-babel-execute-src-block:async'
>>   (org-babel-execute-src-block nil src-block-info)))
>>
>> (add-hook 'org-cycle-hook #'org-property-eval-code)
>> #+end_src
>>
>> A question:
>>
>> How to get all property keywords under headline? I want to use ~member~ to 
>> detect
>> whether property keywords has member in defined custom list
>> ~org-property-eval-keywords-list~.
>>
>> Second question:
>>
>> Do you have any good idea or suggest about this?
>>
>> Thanks for sharing your idea.


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



[Share] collect some idea about auto eval code when TAB expand headline

2020-10-15 Thread stardiviner


I write an elisp config for Org Mode to auto evaluate inline source block in 
property "EVAL".

#+begin_src emacs-lisp
(defcustom org-property-eval-keywords-list '("EVAL")
  "A list of property keywords for evaluate code."
  :type 'list
  :safe #'listp
  :group 'org)

(defun org-property-eval-code ( state)
  "Evaluate Org inline source block in property value."
  (when (memq state '(children subtree))
(if-let ((inline-src-block (org-entry-get nil "EVAL" nil)))
(with-temp-buffer
  (insert inline-src-block)
  (goto-char (point-min))
  (require 'ob-async nil t)
  (setq-local org-babel-default-inline-header-args
  '((:results . "silent") (:async . t)))
  (let* ((context (org-element-context))
 (src-block-info (org-babel-get-src-block-info nil context))
 (type (org-element-type context)))
(when (eq type 'inline-src-block)
  ;; ob-async: `org-babel-execute-src-block:async'
  (org-babel-execute-src-block nil src-block-info)))

(add-hook 'org-cycle-hook #'org-property-eval-code)
#+end_src

A question:

How to get all property keywords under headline? I want to use ~member~ to 
detect
whether property keywords has member in defined custom list
~org-property-eval-keywords-list~.

Second question:

Do you have any good idea or suggest about this?

Thanks for sharing your idea.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [PATCH] Re: Bug: org-cycle stops working on Org files with empty lines at end of buffer [9.4 (9.4-elpaplus @ /home/brentg/.emacs.d/elpa/org-plus-contrib-20200914/)]

2020-10-03 Thread stardiviner


Bastien  writes:

> stardiviner  writes:
>
>> Waited many days, seems no useful patch available. I suggest to revert that
>> commit.
>
> I will have a look over the week-end, thanks.

Thanks for taking time to look at this problem, Bastien.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [PATCH] Re: Bug: org-cycle stops working on Org files with empty lines at end of buffer [9.4 (9.4-elpaplus @ /home/brentg/.emacs.d/elpa/org-plus-contrib-20200914/)]

2020-10-03 Thread stardiviner


Kyle Meyer  writes:

> Ihor Radchenko writes:
>
>> Subject: [PATCH] Do not remove trailing newline when deleting planning info
>>  line.
>>
>> * lisp/org.el (org-add-planning-info): Remove front newline instead of
>> trailing newline when deleting planning info is completetly removed
>> from a heading.  Fixes "Cycling through TODO workflow joins the next
>> line onto the current one".
>
> Did you intended to send a different patch?  This looks to be the same
> patch you sent at <https://orgmode.org/list/87ft78608z.fsf@localhost>.
>
> Also, can someone could provide an example case that was fixed by
> ee3c3b554 (org.el: Allow empty subtrees to be folded back, 2020-09-05)?
> The report that prompted that commit didn't include one:
> https://orgmode.org/list/ca+yh0srpgemuyad0ds3tznwppkq8_mpact-oekk-rxoqnb-...@mail.gmail.com
>
> I tried with
>
> --8<---cut here---start->8---
>
> * TODO a
>
> * TODO b
> --8<---cut here---end--->8---
>
> If I understand the original message by Dmitrii (+cc), the request was
> that, since starting up folded shows the first heading as
>
> * TODO a...
>
> tab should be able to fold the heading back to that state after
> expansion.  But, trying with the current master (16f505db2), tab still
> doesn't fold that heading on my end.  Unless we have a concrete reason
> to keep ee3c3b554, reverting it might be the best fix for this thread's
> issue.

Waited many days, seems no useful patch available. I suggest to revert that
commit.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Support for simultaneous running clocks?

2020-09-23 Thread stardiviner


Michael Welle  writes:

> Hello,
>
> Samuel Wales  writes:
>
>> more than one clock can be useful, but maybe need not be org-related,
>> even if that would be nice?  for example, your laundry is due in 45m,
>> tea will be steeped in 8m, etc.
> for that exactly that use case ;) I have a small shell script that
> creates at jobs and pops up a msg box when laundry is due. With an elisp
> wrapper it's easy to M-x it from Emacs. Nothing fancy or elaborated, but
> it works for me.

Like this, you're just using system. Not Org Mode. Clock need to clock specific
headline tasks or something else. Well, sure, if user in similar case, of course
can use shell script, that will be more convenient.

Anyone would also like to add this feature?

# ==

I've looked command ~org-clock-in~ source code around, I summarized some parts
might related or be affected:

- clock under different headlines for multiple clocking.
- clock in org-agenda buffer should similar as above.
- clock in/out hooks should still working as before.
- the mode-line lighter of displaying clock need to be changed (my idea is use
  mouse hover to display all running clocks in Emacs tooltip).

# ==

Here is some thought about how to implement it, just some thought, not code 
prototype.
(Copied text from my previous message, and added something.)

- Most clock commands I uses is clocking from headline on in org-agenda, or even
  from org-capture. Then clock out. If support multiple simultaneous clocks.
  Then might need to use some extra arguments like headline location. About
  this, I think should not be much complexity.
- Need to use different variable to maintain all running clocks.
- If there are some case have not considered, can also be supported for new 
feature.
- maybe the mode-line clocking might need to adjusted. Anyone have good idea?
  + If only one clock, then display clocking task tile.
  + If have more than one clocks, then display clock numbers?
  + Use mouse-hover tooltip to display currently all running clocks.
- But this new feature will bring more usage benefits. Like time tracking on
  different tasks; project top-level headline and sub-task simultaneous clocking
  for projects; and more accurate time statistics output on time-block etc. Also
  user can start new clock without interrupt old clock, for example, user
  defined an org-capture template will auto start a clock, but don't want to
  interrupt current clock.

# ==

After this think over, I might want to take a try.

I will dig deeper in source code. Come back later.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Bug: Double trailing slash for default candidate in org-refile-get-target [9.4 (9.4-7-g3eccc5-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20200921/)]

2020-09-23 Thread stardiviner
ot; . c++) ("ditaa" . artist) ("dot" 
> . fundamental)
> ("elisp" . emacs-lisp) ("ocaml" . tuareg)
> ("screen" . shell-script) ("shell" . sh)
> ("sqlite" . sql))
>  org-occur-hook '(org-first-headline-recenter)
>  org-cycle-hook '(org-cycle-hide-archived-subtrees 
>  org-cycle-hide-drawers
> org-cycle-show-empty-lines
> org-optimize-window-after-visibility-change)
>  org-speed-command-hook '(org-speed-command-activate
> org-babel-speed-command-activate)
>  org-refile-use-outline-path 'file
>  org-export-before-parsing-hook '(org-attach-expand-links)
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-link-parameters '(("attachment" :follow org-attach-follow :complete
>   org-attach-complete-link)
>  ("id" :follow org-id-open)
>  ("eww" :follow org-eww-open :store 
>  org-eww-store-link)
>  ("rmail" :follow org-rmail-open :store
>   org-rmail-store-link)
>  ("mhe" :follow org-mhe-open :store 
>  org-mhe-store-link)
>  ("irc" :follow org-irc-visit :store 
>  org-irc-store-link
>   :export org-irc-export)
>  ("info" :follow org-info-open :export 
>  org-info-export
>   :store org-info-store-link)
>  ("gnus" :follow org-gnus-open :store
>   org-gnus-store-link)
>  ("docview" :follow org-docview-open :export
>   org-docview-export :store 
>   org-docview-store-link)
>  ("bibtex" :follow org-bibtex-open :store
>   org-bibtex-store-link)
>  ("bbdb" :follow org-bbdb-open :export 
>  org-bbdb-export
>   :complete org-bbdb-complete-link :store
>   org-bbdb-store-link)
>  ("w3m" :store org-w3m-store-link) ("file+sys")
>  ("file+emacs") ("shell" :follow 
>  org-link--open-shell)
>  ("news" :follow
>   #[514 "\301\300\302Q\"\207"
>     ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
>   )
>  ("mailto" :follow
>   #[514 "\301\300\302Q\"\207"
> ["mailto" browse-url ":"] 6 "\n\n(fn URL 
> ARG)"]
>   )
>  ("https" :follow
>   #[514 "\301\300\302Q\"\207"
> ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]
>   )
>  ("http" :follow
>   #[514 "\301\300\302Q\"\207"
> ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]
>   )
>  ("ftp" :follow
>   #[514 "\301\300\302Q\"\207" ["ftp" browse-url 
>  ":"]
> 6 "\n\n(fn URL ARG)"]
>   )
>  ("help" :follow org-link--open-help)
>  ("file" :complete org-link-complete-file)
>  ("elisp" :follow org-link--open-elisp)
>  ("doi" :follow org-link--open-doi))
>  org-link-elisp-confirm-function 'yes-or-no-p
>  )


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Bug: org-cycle stops working on Org files with empty lines at end of buffer [9.4 (9.4-elpaplus @ /home/brentg/.emacs.d/elpa/org-plus-contrib-20200914/)]

2020-09-23 Thread stardiviner


Bastien  writes:

> Hi,
>
> stardiviner  writes:
>
>> I also did a bisect debug. Found the function ~org-cycle-show-empty-lines~ 
>> in hook
>> ~org-cycle-hook~ caused this problem.
>
> Did you find the commit that introduces this bug?

I did a git bisect test, found the bad commit.

"ee3c3b554 | * bad org.el: Allow empty subtrees to be folded back"

>
> Also, if you can provide a patch, please go ahead.
>

Can't help on this. Don't know much on regexp matching and position boundries 
etc.

Will keep improving skill.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Bug: org-cycle stops working on Org files with empty lines at end of buffer [9.4 (9.4-elpaplus @ /home/brentg/.emacs.d/elpa/org-plus-contrib-20200914/)]

2020-09-22 Thread stardiviner
python . t) (shell . t) 
>> (sqlite . t) (dot . t) (plantuml . t))
>>  org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS 
>> WIDTH)"]
>>  org-agenda-loop-over-headlines-in-active-region nil
>>  org-src-lang-modes '(("arduino" . arduino) ("redis" . redis) ("php" . php) 
>> ("C" . c) ("C++" . c++) ("asymptote" . asy) ("bash" . sh) ("beamer" . latex) 
>> ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist)
>>  ("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . tuareg) 
>> ("screen" . shell-script) ("shell" . sh) ("sqlite" . sql))
>>  org-occur-hook '(org-first-headline-recenter)
>>  org-html-head-include-default-style nil
>>  org-html-htmlize-output-type 'css
>>  org-export-headline-levels 100
>>  org-edit-src-auto-save-idle-delay 5
>>  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
>> org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
>>  org-todo-keywords '((sequence "TODO(t)" "|" "DONE(d)" "SHELVED(s)" 
>> "DELEGATED(e)"))
>>  org-speed-command-hook '(org-speed-command-activate 
>> org-babel-speed-command-activate)
>>  org-clock-persist-file "/home/brentg/Plans/Home/org-clock-save.el"
>>  org-odt-format-inlinetask-function 
>> 'org-odt-format-inlinetask-default-function
>>  org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el") 
>> ("elisp" . "el"))
>>  org-return-follows-link t
>>  org-refile-use-outline-path 'file
>>  org-clock-in-hook '(bg-org-clock-in-hook)
>>  org-export-before-parsing-hook '(org-attach-expand-links)
>>  org-id-locations-file "/home/brentg/Plans/Home/.org-id-locations"
>>  org-confirm-shell-link-function 'yes-or-no-p
>>  org-link-parameters '(("attachment" :follow org-attach-follow :complete 
>> org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow 
>> org-eww-open :store org-eww-store-link)
>>   ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" 
>> :follow org-mhe-open :store org-mhe-store-link)
>>   ("irc" :follow org-irc-visit :store org-irc-store-link :export 
>> org-irc-export) ("info" :follow org-info-open :export org-info-export :store 
>> org-info-store-link)
>>   ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" 
>> :follow org-docview-open :export org-docview-export :store 
>> org-docview-store-link)
>>   ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) 
>> ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete 
>> org-bbdb-complete-link :store org-bbdb-store-link)
>>   ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("shell" 
>> :follow org-link--open-shell)
>>   ("news" :follow #[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 
>> 6 "\n\n(fn URL ARG)"])
>>   ("mailto" :follow #[514 "\301\300\302 Q \"\207" ["mailto" browse-url 
>> ":"] 6 "\n\n(fn URL ARG)"])
>>   ("https" :follow #[514 "\301\300\302 Q \"\207" ["https" browse-url 
>> ":"] 6 "\n\n(fn URL ARG)"])
>>   ("http" :follow #[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 
>> 6 "\n\n(fn URL ARG)"])
>>   ("ftp" :follow #[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"] 6 
>> "\n\n(fn URL ARG)"]) ("help" :follow org-link--open-help) ("file" :complete 
>> org-link-complete-file)
>>   ("elisp" :follow org-link--open-elisp) ("doi" :follow 
>> org-link--open-doi))
>>  org-latex-format-headline-function 
>> 'org-latex-format-headline-default-function
>>  org-link-elisp-confirm-function 'bg-org-confirm-elisp-link
>>  org-clock-idle-time 10
>>  org-latex-format-inlinetask-function 
>> 'org-latex-format-inlinetask-default-function
>>  org-tab-before-tab-emulation-hook '(org-tempo-complete-tag)
>>  org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
>>  org-html-format-headline-function 'org-html-format-headline-default-function
>>  org-confirm-babel-evaluate 'bg-org-confirm-babel-evaluate
>>  org-directory "/home/brentg/Plans/Home"
>>  org-publish-project-alist '(("my-emacs-lisp-org" :base-directory 
>> "~/emacs_lisp/" :publishing-directory "~/public_html/emacs_lisp" :recursive 
>> t :table-of-contents t :base-extension "org" :publishing-function
>>  org-html-publish-to-html :style-include-default nil :section-numbers t 
>> :with-sub-superscript nil :html-head "> href=\"org.css\" type=\"text/css\" />"
>>  :author-info nil :creator-info nil)
>> ("my-emacs-lisp-extra" :base-directory "~/emacs_lisp/" 
>> :publishing-directory "~/public_html/emacs_lisp" :base-extension 
>> "css\\|pdf\\|png\\|jpg\\|gif" :publishing-function
>>  org-publish-attachment :recursive t :author nil)
>> ("my-emacs-lisp" :components ("my-emacs-lisp-org" 
>> "my-emacs-lisp-extra")))
>>  org-default-notes-file "/home/brentg/Plans/Home/notes.org"
>>  )


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Recent update commit "7769518f3" caused source block syntax highlighting failed

2020-09-07 Thread stardiviner


After git bisect, I found the bad commit.

Bisect Rest (1)
7769518f3 * bad @ Use the `org-block' face for every true blocks

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: babel default header args as functions

2020-09-06 Thread stardiviner


Bastien  writes:

> Hi Matt,
>
> Matt Huszagh  writes:
>
>> Matt Huszagh  writes:
>>
>>> I've generated a patch for this. Please let me know your thoughts. I
>>> believe this adds valuable flexibility to default header
>>> arguments.
>>
>> I've added an additional fix that makes this work during export too.
>
> I would like to hear what other think about this feature.
>
> Anyone?
>
> Also, if we integrate the change, `eval-default-headers' would be
> better named `org-babel-eval-default-headers'.

I like this new feature propose too. It can be used in many situations. Really 
helpful.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Shower thought: submit an IETF RFC to register Org as a MIME type

2020-09-04 Thread stardiviner


I would like to see this result too. Great to know this :)

TEC  writes:

> Hi everyone,
>
> Prompted by the fact that Markdown is registered as a MIME type
> (RFC7763) and perusing the MIME registration procedure (RFC6838),
> I wonder if it may be possible to register Org as a MIME type?
>
> There are a few parts of RFC6838 in particular which give me hope, 
> such
> as:
>> [§4.9] universal support and implementation of a media type are 
>> NOT a
>> requirement for registration.
>
> I'm guessing the main barrier wold be a the lack of a published
> specification --- I'm guessing a complete version of
> https://orgmode.org/worg/dev/org-syntax.html published under the 
> main
> site (i.e. https://orgmode.org/standard.html) would be required.
>
> Looking for other uses of the .org extension, there doesn't seem 
> to be
> much. The main result is from "Lotus Organiser", which seems to be 
> a
> (discontinued) PIM from IBM which used .org as its file type in 
> the 1992
> release. Other than that it seems that Yamaha and SoundBlaster 
> have used
> it as an extension for organ audio samples.
>
> If it does seem possible to have text/org formally added as a mime 
> type,
> I would love to push this.
>
> Please let me know what you think.
>
> All the best,
>
> Timothy.


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Support for simultaneous running clocks?

2020-09-04 Thread stardiviner


Bastien  writes:

> Hi Carlo,
>
> Carlo Tambuatco  writes:
>
>> I don't know if anyone has suggested or is working on the ability for
>> org mode to 
>> keep track of multiple running clocks simultaneously. I'd like the
>> ability to keep 
>> track of, for example, how long something takes to compile while I
>> keep track of 
>> how long I am working on some other project task at the same time.
>
> FWIW, this has also been requested in this thread recently:
>
> https://orgmode.org/list/cal1eyu+bhbpa_xk9g-zpujm26izca4zke8kt93_pqcefxqa...@mail.gmail.com
>
> I can think of a few use cases, but I wonder if the is worth the added
> complexity.

It depends on how much complexity would it introduced into Org-mode. But I think
it's worth.

- Most clock commands I uses is clocking from headline on in org-agenda, or even
  from org-capture. Then clock out. If support multiple simultaneous clocks.
  Then might need to use some extra arguments like headline location. About
  this, I think should not be much complexity.
- If there are some case have not considered, can also be supported for new 
feature.
- maybe the mode-line clocking might need to adjusted. Anyone have good idea?
  + If only one clock, then display clocking task tile.
  + If have more than one clocks, then display clock numbers?
  + Use mouse-hover tooltip to display currently all running clocks.
- But this new feature will bring more usage benefits. Like time tracking on
  different tasks; project top-level headline and sub-task simultaneous clocking
  for projects; and more accurate time statistics output on time-block etc. Also
  user can start new clock without interrupt old clock, for example, user
  defined an org-capture template will auto start a clock, but don't want to
  interrupt current clock.

For now, this is all I can come up with.

org-timer is a similar functionality.
Maybe consider to let org-timer to be simultaneous too?
But there is problem on how to interact with multiple org timers.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Support for simultaneous running clocks?

2020-07-19 Thread stardiviner


I wish this feature too.

Carlo Tambuatco  writes:

> I don't know if anyone has suggested or is working on the ability for org
> mode to
> keep track of multiple running clocks simultaneously. I'd like the ability
> to keep
> track of, for example, how long something takes to compile while I keep
> track of
> how long I am working on some other project task at the same time.


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [QUESTION] Re: [PATCH] make org-attach-url download function as an option

2020-07-16 Thread stardiviner


Ihor Radchenko  writes:

> I do not know an answer to your question, but would like to point out
> that make-thread will return immidietealy and all the following code
> will run before the download finishes:
>
> (run-hook-with-args 'org-attach-after-change-hook attach-dir)
> (org-attach-tag)
> (cond ((eq org-attach-store-link-p 'attached)...
>
> At least the hooks and org-attach-tag would expect that the file is
> attached already.

Indeed, as long as org-attach introduced new async actions. Those hooks will
have problem if they requires files is downloading finished. Also `make-thread'
does not have process sentinel. That's also an problem.

Does anyone have better idea?

>
> Best,
> Ihor
>
> stardiviner  writes:
>
>> I got solution for async org-attach-url now. Use `make-thread` for async
>> downloading is simple.
>>
>> Here is the code prototype, but it has a problem, seems `apply` part code 
>> does
>> not really downloading file. I don't know why. Does anybody knows the reason?
>>
>> #+begin_src diff
>> modified   lisp/org-attach.el
>> @@ -110,6 +110,12 @@ (defcustom org-attach-method 'cp
>>(const :tag "Hard Link" ln)
>>(const :tag "Symbol Link" lns)))
>>  
>> +(defcustom org-attach-url-function 'url-copy-file
>> +  "The download file function to use in org-attach-url."
>> +  :type '(choice (const 'url-copy-file))
>> +  :safe #'functionp
>> +  :group 'org-attach)
>> +
>>  (defcustom org-attach-expert nil
>>"Non-nil means do not show the splash buffer with the attach dispatcher."
>>:group 'org-attach
>> @@ -503,7 +509,12 @@ (defun org-attach-attach (file  visit-dir 
>> method)
>> ((eq method 'cp) (copy-file file attach-file))
>> ((eq method 'ln) (add-name-to-file file attach-file))
>> ((eq method 'lns) (make-symbolic-link file attach-file))
>> -   ((eq method 'url) (url-copy-file file attach-file)))
>> +   ((eq method 'url) (make-thread
>> +  (lambda ()
>> +;; (url-copy-file file attach-file)
>> +;; FIXME This seems does not really download file. 
>> Don't know why.
>> +(apply org-attach-url-function '(file attach-file)))
>> +  "org-attach-url downloading")))
>>(run-hook-with-args 'org-attach-after-change-hook attach-dir)
>>(org-attach-tag)
>>(cond ((eq org-attach-store-link-p 'attached)
>> #+end_src
>>
>> Bastien  writes:
>>
>>> Hi,
>>>
>>> stardiviner  writes:
>>>
>>>> I found when network is bad and slow, or the download file is big, the
>>>> org-attach-url will suspend Emacs for a long time. User might have to 
>>>> cancel
>>>> downloading, and start again later.
>>>
>>> Indeed, this might be annoying.  At the same time, it is not
>>> unreasonable to expect the user to know what size is the contents he
>>> is willing to attach to an Org node.
>>>
>>>> I hope to make "org-attach-url" download file asynchronously. But function
>>>> org-attach-attach hardcoded this function for 'url method. Here is a patch 
>>>> to
>>>> make it into an option.
>>>
>>> (FWIW, I could not find the patch.)
>>>
>>> I think you are on the right track when trying to enhance the 'url
>>> package.  Maybe url-copy-file should be asynchronous and url could
>>> provide url-copy-file-synchronously (to mimic the url-retrieve and
>>> url-retrieve-synchronously pair)?
>>>
>>> Until Emacs has a function to copy a URL's contents asynchronously,
>>> I'd rather not add this functionality in Org.
>>
>>
>> -- 
>> [ stardiviner ]
>>I try to make every word tell the meaning that I want to express.
>>
>>Blog: https://stardiviner.github.io/
>>IRC(freenode): stardiviner, Matrix: stardiviner
>>GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>>


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



[QUESTION] Re: [PATCH] make org-attach-url download function as an option

2020-07-15 Thread stardiviner


I got solution for async org-attach-url now. Use `make-thread` for async
downloading is simple.

Here is the code prototype, but it has a problem, seems `apply` part code does
not really downloading file. I don't know why. Does anybody knows the reason?

#+begin_src diff
modified   lisp/org-attach.el
@@ -110,6 +110,12 @@ (defcustom org-attach-method 'cp
  (const :tag "Hard Link" ln)
  (const :tag "Symbol Link" lns)))
 
+(defcustom org-attach-url-function 'url-copy-file
+  "The download file function to use in org-attach-url."
+  :type '(choice (const 'url-copy-file))
+  :safe #'functionp
+  :group 'org-attach)
+
 (defcustom org-attach-expert nil
   "Non-nil means do not show the splash buffer with the attach dispatcher."
   :group 'org-attach
@@ -503,7 +509,12 @@ (defun org-attach-attach (file  visit-dir method)
((eq method 'cp) (copy-file file attach-file))
((eq method 'ln) (add-name-to-file file attach-file))
((eq method 'lns) (make-symbolic-link file attach-file))
-   ((eq method 'url) (url-copy-file file attach-file)))
+   ((eq method 'url) (make-thread
+ (lambda ()
+   ;; (url-copy-file file attach-file)
+   ;; FIXME This seems does not really download file. 
Don't know why.
+   (apply org-attach-url-function '(file attach-file)))
+ "org-attach-url downloading")))
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
#+end_src

Bastien  writes:

> Hi,
>
> stardiviner  writes:
>
>> I found when network is bad and slow, or the download file is big, the
>> org-attach-url will suspend Emacs for a long time. User might have to cancel
>> downloading, and start again later.
>
> Indeed, this might be annoying.  At the same time, it is not
> unreasonable to expect the user to know what size is the contents he
> is willing to attach to an Org node.
>
>> I hope to make "org-attach-url" download file asynchronously. But function
>> org-attach-attach hardcoded this function for 'url method. Here is a patch to
>> make it into an option.
>
> (FWIW, I could not find the patch.)
>
> I think you are on the right track when trying to enhance the 'url
> package.  Maybe url-copy-file should be asynchronous and url could
> provide url-copy-file-synchronously (to mimic the url-retrieve and
> url-retrieve-synchronously pair)?
>
> Until Emacs has a function to copy a URL's contents asynchronously,
> I'd rather not add this functionality in Org.


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



[SOLVED] Re: [BUG] org-fill-paragraph [M-q] not apply on last paragraph

2020-07-07 Thread stardiviner


stardiviner  writes:

> After recently (about weeks) update in Org Mode "master" branch. I found [M-q]
> org-fill-paragraph command not apply on the last paragraph of region select
> large part of text. I don't have this problem before.
>
> And I confirmed this problem with minimal Emacs config with latest "master"
> branch of org-mode.
>
> The command "emacs -q" don't have this problem.

In the latest "master" branch, Nicolas fixed this issue.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [BUG] org-fill-paragraph [M-q] not apply on last paragraph

2020-07-06 Thread stardiviner


to...@tuxteam.de writes:

> On Mon, Jul 06, 2020 at 07:40:48PM +0800, stardiviner wrote:
>> 
>> Nicolas Goaziou  writes:
>> 
>> > Hello,
>> >
>> > stardiviner  writes:
>> >
>> >> After recently (about weeks) update in Org Mode "master" branch. I found 
>> >> [M-q]
>> >> org-fill-paragraph command not apply on the last paragraph of region 
>> >> select
>> >> large part of text. I don't have this problem before.
>> >
>> > This is very vague. Do you have an ECM demonstrating the issue?
>> 
>> I have long minimal-init.el config file. I will attach the init file in 
>> attachments.
>> 
>> And here is the steps I reproduce this bug:
>> 
>> 1. Open an Org file which contains long un-wrapped text. Like this:
>> 
>>#+begin_src org
>>In addition to debugging a program, VS Code supports running the program. 
>> The *Debug: Run (Start Without Debugging)* /action/ is triggered with 
>> =[Ctrl+F5]= and uses the currently selected launch configuration. Many of 
>> the launch configuration attributes are supported in 'Run' mode. VS Code 
>> maintains a debug session while the program is running, and pressing the 
>> Stop button terminates the program.
>>
>>Tip: The Run action is always available, but not all debugger extensions 
>> support 'Run'. In this case, 'Run' will be the same as 'Debug'.
>>#+end_src
>> 
>> 2. region select two paragraphs.
>> 
>> 3. press [M-q] ~org-fill-paragraph~ command.
>> 
>> 4. The second paragraph is not filled.
>
> FWIW, it does for me.
>
> One thing I noticed, though, is that due to the long lines, the last one
> may be partially selected. In that case, the unselected part doesn't get
> the fill treatment. When I make sure /everything/ is selected, M-q does
> what I expect.

I'm sure I select everything. Are you using the latest commit in "master"
branch? If not, can you test with that?

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: [BUG] org-fill-paragraph [M-q] not apply on last paragraph

2020-07-06 Thread stardiviner

Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> After recently (about weeks) update in Org Mode "master" branch. I found 
>> [M-q]
>> org-fill-paragraph command not apply on the last paragraph of region select
>> large part of text. I don't have this problem before.
>
> This is very vague. Do you have an ECM demonstrating the issue?

I have long minimal-init.el config file. I will attach the init file in 
attachments.

And here is the steps I reproduce this bug:

1. Open an Org file which contains long un-wrapped text. Like this:

   #+begin_src org
   In addition to debugging a program, VS Code supports running the program. 
The *Debug: Run (Start Without Debugging)* /action/ is triggered with 
=[Ctrl+F5]= and uses the currently selected launch configuration. Many of the 
launch configuration attributes are supported in 'Run' mode. VS Code maintains 
a debug session while the program is running, and pressing the Stop button 
terminates the program.
   
   Tip: The Run action is always available, but not all debugger extensions 
support 'Run'. In this case, 'Run' will be the same as 'Debug'.
   #+end_src

2. region select two paragraphs.

3. press [M-q] ~org-fill-paragraph~ command.

4. The second paragraph is not filled.

>
> Regards,


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



minimal-init.el
Description: application/emacs-lisp


init-package.el
Description: application/emacs-lisp


[BUG] org-fill-paragraph [M-q] not apply on last paragraph

2020-07-06 Thread stardiviner


After recently (about weeks) update in Org Mode "master" branch. I found [M-q]
org-fill-paragraph command not apply on the last paragraph of region select
large part of text. I don't have this problem before.

And I confirmed this problem with minimal Emacs config with latest "master"
branch of org-mode.

The command "emacs -q" don't have this problem.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: patch: ob-clojure improvements

2020-07-02 Thread stardiviner


agzam.ibragi...@gmail.com writes:

> There seems to be a bit of lack of interest for these things. But I'm sure
> some people (myself included) would love to see these kinds of
> improvements.

Yes, I rarely saw Clojurians in this mailing list.

> As I said before, I have never participated in contributing
> to Org source, some guidance would be appreciated.

Org Mode has contribution guide here 
http://orgmode.org/worg/org-contribute.html#patches

> Should I keep building it and posting patches? Should I try to go
> incrementally, one small change at a time, or should I just get everything
> working first? If it turns out to be a bigger work, should I ask for
> permission to work in a branch and get access to pushing things to it? Maybe
> things just move slowly, because obviously you can't force maintainers to drop
> everything and concentrate effort to get your things in. Maybe I just have to
> be a little bit more patient?

I think a complete work contains many patches should be better, Also write 
testing if necessary.

I remember ob-clojure.el code are mostly reviewed by Bastien Guerry. I included 
him in Cc: in this email.

> On Sat, Jun 20, 2020 at 1:23 AM stardiviner  wrote:
>
>>
>> Glad to see your patch, really useful in some cases. Thanks.
>>
>> Ag Ibragimov  writes:
>>
>> > Hi everyone, here's my attempt to add clojure CLI and babashka support
>> for ob-clojure.el
>> >
>> > - Adds a header parameter to override org-babel-clojure-backend
>> > - Adds :args param (right now only used for clojure-cli)
>> >
>> > I have tested it with these minimal cases:
>> >
>> > #+begin_src clojure :backend clj-cli :args "-Sdeps '{:deps {inflections
>> {:mvn/version \"0.13.2\"}}}'"
>> >   (use 'inflections.core)
>> >   (plural "word")
>> > #+end_src
>> >
>> > #+begin_src clojure :backend babashka :results output
>> >   (range 10)
>> > #+end_src
>> >
>> > Please let me know what you think. Any advice is appreciated, since I
>> have never contributed before. Thank you.
>>
>>
>> --
>> [ stardiviner ]
>>I try to make every word tell the meaning that I want to express.
>>
>>Blog: https://stardiviner.github.io/
>>IRC(freenode): stardiviner, Matrix: stardiviner
>>GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>>


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: patch: ob-clojure improvements

2020-06-20 Thread stardiviner


Glad to see your patch, really useful in some cases. Thanks.

Ag Ibragimov  writes:

> Hi everyone, here's my attempt to add clojure CLI and babashka support for 
> ob-clojure.el
>
> - Adds a header parameter to override org-babel-clojure-backend
> - Adds :args param (right now only used for clojure-cli)
>
> I have tested it with these minimal cases:
>
> #+begin_src clojure :backend clj-cli :args "-Sdeps '{:deps {inflections 
> {:mvn/version \"0.13.2\"}}}'"
>   (use 'inflections.core)
>   (plural "word")
> #+end_src
>
> #+begin_src clojure :backend babashka :results output
>   (range 10)
> #+end_src
>
> Please let me know what you think. Any advice is appreciated, since I have 
> never contributed before. Thank you.


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



[Feature request] toggle inline image display only under current subtree

2020-06-19 Thread stardiviner


For some Org documents which has lots of images, toggle display of all inline
images will suspend Emacs, and use lot of memory. I suggest Org Mode can add an
[C-u] universal prefix detect before [C-c C-x C-v] to only display inline images
under subtree.

WDYT?

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Question on contributing to Org-mode

2020-06-18 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Ag Ibragimov  writes:

> Can someone help me please to improve ob-clojure for the next release.
>
> I'd like to add bababashka and clojure-cmd support.
>
> I've experimented with the code that's currently in master I so far I got to 
> this.
>
> What I would like to propose:
>
> 1) Ability to override `org-babel-clojure-backend` with a src-block header 
> parameter

I like this idea, currently ob-clojure has many different backends support now,
Use a header argument will be helpful for situations like use different backends
in one org file and other cases.

> 2) Header argument for additional parameters so you could do things like this:

I would like propose header argument name ":backend" or ":clojure". ob-scheme.el
has similar header argument named ":scheme". But I prefer ":backend", because
it's more general.

>
> #+begin_src clojure :args "-Sdeps '{:deps {inflections {:mvn/version 
> "0.13.2"}}}'"
>  (use 'inflections.core)
>  (plural "word")
> #+end_src
>
> However, I don't know what's current convention about header parameters - 
> naming, etc.
> What your thoughts about all that?
>
> diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
> index 299a326e4..de005c32b 100644
> --- a/lisp/ob-clojure.el
> +++ b/lisp/ob-clojure.el
> @@ -224,6 +224,14 @@ (defun ob-clojure-eval-with-slime (expanded params)
>,(buffer-substring-no-properties (point-min) (point-max)))
>  (cdr (assq :package params)
>
> +(defun ob-clojure-eval-with-babashka (expanded params)
> +  "Evaluate EXPANDED code block with PARAMS using babashka."
> +  (org-babel-execute:shell (format "bb -e \"%s\"" expanded) params))
> +
> +(defun ob-clojure-eval-with-clj (expanded params)
> +  "Evaluate EXPANDED code block with PARAMS using clojure-cli."
> +  (org-babel-execute:shell (format "clj -e \"%s\"" expanded) params))
> +
> (defun org-babel-execute:clojure (body params)
>   "Execute a block of Clojure code with Babel."
>   (unless org-babel-clojure-backend
> @@ -238,7 +246,11 @@ (defun org-babel-execute:clojure (body params)
>  ((eq org-babel-clojure-backend 'cider)
>   (ob-clojure-eval-with-cider expanded params))
>  ((eq org-babel-clojure-backend 'slime)
> - (ob-clojure-eval-with-slime expanded params
> + (ob-clojure-eval-with-slime expanded params))
> +((eq org-babel-clojure-backend 'babashka)
> + (ob-clojure-eval-with-babashka expanded params))
> +((eq org-babel-clojure-backend 'clj-cli)
> + (ob-clojure-eval-with-clj expanded params
> (org-babel-result-cond result-params
>   result
>   (condition-case nil (org-babel-script-escape result)
>
> On Sat 13 Jun 2020 at 17:19, Kyle Meyer  wrote:
>
>> Ag Ibragimov writes:
>>
>>> M-x emacs-version and org-version report:
>>>
>>> GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 
>>> Version 10.15.5 (Build 19F101)) of 2020-06-07
>>> Org mode version 9.3.7 (9.3.7-2-g706970-elpaplus @ 
>>> ~/.emacs.d/elpa/28.0/develop/org-plus-contrib-20200608/)
>>>
>>> Now I'm confused, what's in master of bzg/org-mode?
>>
>> It contains what will be the next feature release (9.4, at the moment).
>>
>> Notice that your reported version above contains a git revision: 706970.
>> If you look that up in the repo, you'll find that it's a few commits
>> back from the current tip of the maint branch.  The maint branch is the
>> source for the ELPA builds and is where bug fix releases are cut from.
>>
>>> And if someone wants to send patches, which branch it should be based
>>> of?
>>
>> Bug fixes that apply to maint should ideally be based off of maint, and
>> master is usually appropriate for everything else.


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7rDs8UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMWVQf/YlHZw3Yga3dTlLPU0Xg0f+tJ0JJR
oigjt4oOBsaMGshHny+4QBnO/QJTVWpYEm6j2oFp0Cb1CUn5TiTRDDyRVcX+I15u
W4T+UqsamKQQoRoJccPN3apraQlwiYbwLzN5Qy0hefOkj+E285PNf4Uq1VMwy9sL
n2zqY+cm+lrhv3wG08xXxWckg+Jx76s1M6j9QQH7nGNovYSl3YzpjtOPc2VE2ayv
8FQQX6PSH4gEW7ItyfYd18vYtIn65Zkum+L80d8+HtDVPkw0yDIq6uIkUbR5jCCY
tdbUsl6EeZlb9CkjY9WtOsIGe2FzIHjjhFSYvamgarqs5GGd+GazSPUVKQ==
=4JBP
-END PGP SIGNATURE-



Re: ob-sql src blocks with a totally custom engine

2020-06-16 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Ag Ibragimov  writes:

> Is it possible to have source code SQL blocks that are processed with a 
> custom command line tool?
> e.g. how can I make something like this to work:
>
> #+begin_src sql :cmdline "osqueryi --json"
>  select * from processes limit 5;
> #+end_src

I think it's possible. Should not be hard to implement. You can check out 
ob-sql.el source code.

>
> For those who don't know what osquery is, here's a quote from 
> https://osquery.io: "Osquery uses basic SQL commands to leverage a relational 
> data-model to describe a device."

This is interesting project.

>
> I vaguely remember there was a way to basically "pipe" entire code block to 
> be executed in a given cmd line tool, but I am struggling to find how to do 
> that. There's a way, right? But even then, I think it requires the code block 
> to be of sh-mode of shell-mode, but I want it to be SQL because osquery uses 
> SQL.


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7pU6gUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOTXQf/Z3CT2/mTjtCeaSGaZSzziO3TQVzO
k8eIu/6cX9byVIg96DOpiyWy6+u89C9YTT78w2vqPy353P6+XOskkBBGPLyHlPqa
PyePGNvOAGiFevT7CB0b2X6HuzhkL3bTJt7PQhkc/PakrN2Da7/MewC2UBNML5lQ
t27KEv3JKjQcY79LtcEr0vT0TxXAY1gluO2Flm/b7jXF4DnNBOTfItqGdmTDOxRE
t45jbbM/1SrpwsFvSTLQNI3WBklXDZNF3soiSoc+tw0g0Cn/MQqLKDN1ZE1zbGBf
T8exQ+TuXjQn3yMC8zAhwIluaoCTxyN3gJIIVtT6ZCKrEblcvQxL3aonjA==
=yK3s
-END PGP SIGNATURE-



Re: [BUG] [C-u C-u C-c C-o] open link with external program invalid to open file

2020-06-14 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> When I press =[C-u C-u C-c C-o]= to open an image file link with system 
>> external
>> program. It can't open the image file.
>
> Is it really an Org bug? I.e., is your mailcap file properly set up?
>
> If you think this is really an Org bug, could you provide an ECM,
> including your .mailcap?

I tested with command "emacs -q" and an minimal Emacs config. Both failed to
started. I also record an screen video to show this problem.

Link: https://pan.baidu.com/s/1iBbcStvNCwdN1vB8ivISdw  password code: r6ws

And I don't have file ~/.mailcap setup. But I can open image in command-line
with command "xdg-open". And I'm sure Org link image file exist and normal.

Emacs version: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.20, cairo version 1.17.3) of 2020-06-12
Org Mode version: Org mode version 9.3.4 (release_9.3.4-644-g14d358.dirty @ 
/home/stardiviner/Code/Emacs/org-mode/lisp/)

>
> Regards,


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7l6RQUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsM3HggAo1IJQZUTgLYO/xY47DusHP95jD78
vH2IXreE0ahumDVpPPOQd9o8VKeCpgwMf4/0/1HAn9u2UDmiT27T/5TRo9oeipFr
+E/lMdpWudnewJfLzBbkDekyEqQjbeRQuj1vT/dTW4Viu9YsFKx2v4z6rOYglvsN
yKRx8OI5nXCqLDNcIqYIvk3VfCx4ShjF/n03Qzd1RQVjSEpP86kpk2qCdPMQzXNy
my7ZrZ/KTXAhAfm+n/4GB1E8T8D49rc669BawV/9ctBFvZrRyrm8auLg+53i3j32
YLYt9Tlq8jNL1/IGxY+R2NlU5dTNDtQmdt8RcELFHYp4hICI6cUXshRiUw==
=6MuC
-END PGP SIGNATURE-



[BUG] [C-u C-u C-c C-o] open link with external program invalid to open file

2020-06-13 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


When I press =[C-u C-u C-c C-o]= to open an image file link with system external
program. It can't open the image file.

I tested on minimal Emacs config, confirmed this problem.

Org Mode version: latest "master" branch

Org mode version 9.3.4 (release_9.3.4-644-g14d358.dirty @ 
/home/stardiviner/Code/Emacs/org-mode/lisp/)

Emacs version:

GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo 
version 1.17.3) of 2020-06-12

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7khQcUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNM3ggAjWkVKAhnsmue0BZq9gxq390UHSan
QsiOQN/BzYkUAHHtuY0Jwh5e8u6QO0TXa44v/K/8O4hNMXe7HV59SD2VIs1TvzCA
QFCqtGXeJZyeNizh9SS6A4R35KM8e6pg5LjruPEyekkUplaFf5qUJX0sn5x9SY9Z
tTZO3Bzd4nW2k8joX1DSqFURK+7WNO7en1XRFjF2FjkBp/J4e5aZwHHhLkGxGR4Q
Jn8Xvyf8c3nhrhE+HypwreRexBgiHKhoTK6DIJ9ztXD97/3s2RQ/qbXxVIeqm58U
Vivn5XqQDFxgBeOeOhgKVRSmC1/x83CwkxBDSGXHT4U0BKSPt07MPm1L7w==
=w8gz
-END PGP SIGNATURE-



Re: Bug: fontification error with #end_src in 9.3.7 [9.3.7 (9.3.7-dist @ /PATH/TO/org/install/emacs/site-lisp/org/)]

2020-06-11 Thread stardiviner
ot; :follow org-bbdb-open :export org-bbdb-export 
> :complete
> org-bbdb-complete-link :store org-bbdb-store-link)
>("w3m" :store org-w3m-store-link) ("file+sys") 
> ("file+emacs")
>("shell" :follow org-link--open-shell)
>("news" :follow
> #[257 "\301\300\302Q!\207" ["news" browse-url ":"] 5 
> "\n\n(fn URL)"])
>("mailto" :follow
>     #[257 "\301\300\302Q!\207" ["mailto" browse-url ":"] 
> 5 "\n\n(fn URL)"])
>("https" :follow
> #[257 "\301\300\302Q!\207" ["https" browse-url ":"] 5 
> "\n\n(fn URL)"])
>("http" :follow
> #[257 "\301\300\302Q!\207" ["http" browse-url ":"] 5 
> "\n\n(fn URL)"])
>("ftp" :follow
> #[257 "\301\300\302Q!\207" ["ftp" browse-url ":"] 5 
> "\n\n(fn URL)"])
>("help" :follow org-link--open-help)
>("file" :complete org-link-complete-file)
>("elisp" :follow org-link--open-elisp) ("doi" :follow 
> org-link--open-doi))
>  org-link-elisp-confirm-function 'yes-or-no-p
>  org-list-indent-offset 2
>  )


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7i+zgUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsODLwgAoO1OD+5Rsvzr4HYWynlVYFmu2LIw
atICi53TXYdZF7FIQfbtKwKIMn8ltqwu2ByMhrXm67ArcRFYO5A4u6BXinYj1G/w
Al+KZ8zoNUnq/8oUdGQpFcj/leOzS1ZTpCzHpj9hKq6Urw20egqS8p7MFcG62mJ0
TmSmsoj//f6F65TxrX+bdtWI1UkfJOvXQRr5QzXGj3jHprZfVRKbXdVSmC3Jho+w
S7DqCOn0oTRgiNZiQRDm0xIATFrgCsPqLkRUejblV4YK01smhxUCGEtGTUcOhi50
v0NQYT6wyiGmvZWu5cJQfI3thxId+fy2CY/Qo68jynQsXAyFDHe7vqpNbw==
=PzO7
-END PGP SIGNATURE-



[ISSUE] org-agenda with clocktable infinite on logbook which has text-propertize links

2020-06-09 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


When org-agenda have option ~org-agenda-start-with-clockreport-mode~ enabled.
Generate Org Agenda with clocktable. Here is an Org content which has logbook
contains link which is text-propertized using Emacs extension
https://github.com/stardiviner/org-link-beautify (It's written by myself).

#+begin_src org
,** PROJECT google-translate [11/22]
   SCHEDULED: <2020-06-09 Tue>
   :LOGBOOK:
   CLOCK: [2020-06-10 Wed 09:19]--[2020-06-10 Wed 10:34] =>  1:15
   - create PR https://github.com/atykhonov/google-translate/pull/118
   CLOCK: [2020-06-10 Wed 09:09]--[2020-06-10 Wed 09:14] =>  0:05
   - finished bump version process, tag v0.12.0, draft GitHub release.

#+end_src

When I remove that text-propertized link, org-agenda generate fine. When have
that text-propertized link, org-agenda is infinitely un-finished.

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7gUQAUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNdhQf/b2gkDc9jqbv2BD6zhFEh5nuQ+4hI
FjXXMUBuhiJnMCTXe0DeL4zG2iyU2N/IWHzP+ftuH8QWEK6xOPBAhEuS+6culgK8
aCehl/J9LQsnz6UC8IVw9Pc+Lg+342A4TNJpXgz80RsihwAiObn0Wb0bIOWLJ22n
Vc33x5+jFOCrOVkvjONI+YNTC2hpghfZ/CMW/cmjKsMj9jZ2oOuXIC8ksOhEMIWO
GMQtxQRzO6/gG/VWBC2Ijh0af10rTAYPhbUDfbSaE49tMRoMuWoj7ALceI6gEPtI
z4dWUtEQh2pxCd0ojfIswUJyAkDhNjbBo022DMqwpqgfNycnlMyZQPVq3Q==
=nH9N
-END PGP SIGNATURE-



Re: [Announcement] lsp-mode integration with org-mode

2020-06-08 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Ivan Yonchovski  writes:

> Hi all,
>
> lsp-mode -> org-mode integration allows using Language Server Protocol
> features (e. g. completion, on-the-fly diagnostics, references,
> refactoring, etc.) in org-mode source blocks. This was the most wanted
> feature in our bug tracker and I think that it provides unique
> functionality not avaiable in any other editor and it is great addition
> to the org-mode ecosystem. In the future, we have also planned support
> for debugging in source buffer.
>
> Link to the docs and short demo:
>
> https://github.com/emacs-lsp/lsp-mode/blob/master/docs/page/lsp-org.md
>
>
> Thanks,
> Ivan

This is really great to get official support for Org Mode. I have this idea for
long time, just try start an extension two days ago.
https://github.com/stardiviner/org-babel-lsp

Now, I will archive close this repository. :)

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7e4QQUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPl5Af+MDEFKkQBYMN8j7OAixnfEoRuJvdQ
V15cnLl6GsqPgoMka4teN3uoV9p2jobJ0lk1Hx6NL4krydc8QAImxCNq/GbNWH/n
TBdC9AHUC68vcFjHRISMwfN8nqv3sMLT+pkw2/HPkNEeEaWF8nQl+q6kbdkdti/c
f1PE9QP1wcfrBNdaS3przH9g2mLfChwcFn92dKeFtIwTiAIsHowoxbcKyj5RN8Sj
pa9VxKdfAf2c3pNEzwZVQocxRNps2rGYMvyo9cw1WXrrdMDdfZD0CIzAAwIOthEO
UfmQfF9q0rnjKbBCKk16RBWc6j9LKNa16W39a5mdp9jdRhNTxhGwEE33aA==
=WDPq
-END PGP SIGNATURE-



Re: FWD: Org-Babel Support for Powershell

2020-06-06 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


stanislaw_lem--- via General discussions about Org-mode. 
 writes:

> Hi,
>
> I ask the maintainer of org-babel Bastien Guerry <http://bzg.fr>, if it is 
> possible to include Powershell support for org-babel. Monsieur Guerry told me 
> to ask you via email.
>
> Powershell 5.1 is now an important tool for Infrastructure as Code in the 
> Windows Server world. Windows administrator often encounter mixed IT 
> Landscape with Windows and Linux servers. While it is possible to do network 
> automation with Python with org-babel for the Linux server - you still cannot 
> do Literate Programming in Powershell for Windows server.
>
> I think Literate Programming is a very productive idea for system 
> administration. It is very difficult to establish a Living Documentation 
> policy with Powershell, because of the lack of Literate Programming tools 
> with Powershell support. Currently available Powershell support for 
> Powershell is limited to syntax highlighting and external execution of 
> Powershell commands from code fences. The results of execution of Powershell 
> code snippets is not shown within the Emacs buffer.
>
> With Powershell 7 we got now a cross-platform scripting language for Windows 
> and Linux OS. I think in the future Powershell administration will get more 
> and more important - not only for deployment, but also for cyber security 
> defense of Windows server.
>  
> Yours sincerely
>
> Stanislaw Lem

I remember already there are some ob-powershell relative projects. You might
want to work and improve features on those work. And integrate it into Org Mode.

- - https://gist.github.com/cbilson/ae0d90d163be4d769f8a15ddb58292bc
- - https://github.com/togakangaroo/ob-pwsh

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7boZ4UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPAmAgAsoj1vDfVKtMEM5HcUgA8I62qmNar
SaamgjPPmjlgtlpHZ1GspwGsm/ba9lgzG5iJKULHNgM/Kclf12crjakX+SsR0bVA
e6wtytimwPUw16h5t5vDByuHle8jmfpN9M9vfogc2F2eC5zbKU9uR4jw8FI8kPqp
KtKhX0EKqR1jLwNz4HxPYH7rQiCh/YNlandcVpZ5jRpG1BB+ivpQ5MHpnfImB7ub
xyNpyg5ICAVZuHTyoSrDIh/F5ojK6untfytt06xuTkV8GASt9iG40XxZmyeDznqA
zkgvQP8jPrfXkge7MPvrCq7zF2jLppqoMmqq3i5dJWL3uEkcNF2qAuIF0A==
=lofo
-END PGP SIGNATURE-



Re: [BUG] All drawers except property drawers are open at startup

2020-06-05 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Matt Lundin  writes:

> Matthew Lundin  writes:
>
>> Nicolas Goaziou  writes:
>>
>>> Matt Lundin  writes:
>>>
>>>> All drawers default to open at startup except for property drawers. This
>>>> includes :LOGBOOK: drawers, which can be quite long and block view of an
>>>> entry.
>>>
>>> I think all drawers are opened at startup, including property drawers.
>>>
>>>> I ran a git bisect and discovered that the bug was introduced with
>>>> commit 8b05c06d427e850d45684f69c5165cd7684e1071 on May 9. 
>>>
>>> Isn't it related to 88f5ed91c5cf9cb6962c1b441eac7dbab9a4734e instead?
>>>
>> No. I have the following in my emacs file:
>>
>> (setq org-startup-folded t)
>>
>
> I did some more investigating and it seems my initial git bisect was off
> by one commit. (I think I forgot to reload org files on the last
> bisect.)
>
> The commit that introduced this bug was
> 1027e0256903bc2c4ef9edfb1f7279294fa3f195.
>
> In the function org-set-startup-visibility, that commit replaced
>
> (org-cycle-hide-drawers 'all)
>
> with
>
> (org-cycle-hide-property-drawers 'all)
>
> Thus, only property drawers are hidden at startup.
>

I have same problem. Glad you found the problem commit.

> Best,
>
> Matt


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7bDsMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsONQwgAvgeSgmZuX5lnmgUP30dzVgpVA0vS
O5cKfYD3aMwd5hkCzwUXFfc+LotKBFZJHJy1lRAesHHZclKRyNLpdQHWHwLbhbKM
jBRLnaFQhVHa12QqPplF7/cBMfv41RFYcqiGcwfY+F8ZOrHe++7dOdcmxRKdZtVb
f3WUwZDMQTfKhLLKj44kcKOcah32Utg/3WDG5ovUMiNQ8PUJryOR1eLTW1w//hI5
bLoJGFI69UW6F/MOMBmWyY9BEZyONYGpIWvTqLt/189F0+6VedDbbIlMbjjcNQ8n
VykVGnVqo5Ca5AUbsLysg3Me6ddyiZXh8FzliCobUmAblLTsEi1yRW1B9g==
=DIgk
-END PGP SIGNATURE-



Re: [Feature] add a new org-attach dispatcher command to offline save web page

2020-06-03 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Bastien  writes:

> Hi,
>
> stardiviner  writes:
>
>> Here is my patch, I try to annotate on my patch code to express my
>> words:
>
> Thanks - I see what is hardcoded and why.
>
> Since the whole idea is to use something else than url-copy-file for
> downloading URLs I would rather add an option to allow using a custom
> function.
>
> Something like `org-attach-url-copy-file-function' which would be
> url-copy-file by default but could be set to another function with 
> the same signature.
>
> Don't rush on implementing this though, I'd like to reread the code
> in org-attach.el again to decide if this is the right way - and this
> won't be before 9.5.
>
> Best,

Thanks a lot, that'll be great!

I guess my expression skill is limited, not very smooth to discuss with people.
Try to improve it.

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7YM4wUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPbsQgAtnuLIcgq3l+k5PcFu/YZuhvgjLEg
qp3F9Vvo/yu8eoZvGB2IMA+B1AUVF5Af81OvSIpeOV4ef5lis7smvNtLTWSHxLVI
5m/MGeCATThJ4cbFVGB1fEi3BxFAk5fGerVc+Mm8YYDwLkjhxuERDxkWYAJeLkBj
6vLrFoRTDJc6UvOg36tlMKqQuGkEFke8zNvqwQ/AM3IHwEmOfa9mpCaqAAtKxOtL
mBNSs1aa/+zR4MBYwmIDoloZPoUvWQERj2kJo9KEu+DqHsgHGeS9rT6OSKccZA0P
HJSrtcjmfhKAafLDH4ERtoBoyli+Y8v0LA5aEj2MEl9BIGFmMa14f9dXkA==
=X23S
-END PGP SIGNATURE-



Re: A small idea to simplify (further) time input in the date/time prompt

2020-06-02 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Gustavo Barros  writes:

> Hi stardiviner,
>
> On Tue, Jun 02 2020, stardiviner wrote:
>>
>> Which date/time prompt do you mean? Like set schedule or deadline? If just 
>> raw
>> timestamp, it makes me confused whether it is time continuance.
>>
>
> The date/time prompt is Org's interface for querying for date and time which 
> is
> described in the [[info:org#The date/time prompt]] section of the manual.  It 
> is
> indeed the interface you get when calling 'org-time-stamp', 'org-schedule',
> 'org-deadline' etc.

Thanks for declaration. I see, I have not noticed Org have this way treating
input time value. Glad about learning new stuff.

> As mentioned before in the thread, the suggestion is orthogonal to the 
> timestamp
> format or with document syntax.  It is just an alternative way to input time 
> in
> the date/time prompt, which should produce the same good old timestamp.

That's great.

>
> Best,
> Gustavo.


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7WZXMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOcUgf/X765J3pj9TdAXLKy+IWNH9KTB92y
H0KR25vOZmKqxnrSDrjxajbiJ/iSQkujaVJMsfAGf4v/w+GSeqtHqip745BIhGIb
2TG6dOpE1L3FnKREmC93uuSs3bemciezD4CM7qAjB1DvpNVGiy4NiEbzmoHPjMpY
arvxObEeHmceOEc/1oqFlJfmb7sO5YKfd4xoAHofr+sSpVrG7ophbIAHNVQiAhvt
gQItQ7wudD9wlp42dBP6V56W2ON2VXIuDpCWNEpjvx3MtxvGgvoa1Y8x+RqB3pd6
TL60qk85wdwLRcjl69q2P9Zz4XBk3iWOHfL9mIBJ7ZKqtHwBVzy/6olTig==
=VaY4
-END PGP SIGNATURE-



Re: [Feature] add a new org-attach dispatcher command to offline save web page

2020-06-02 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Bastien  writes:

> Hi Stardiviner,
>
> stardiviner  writes:
>
>> I think maybe Org maintainer can improve the org-attach code to suitable to 
>> add
>> custom function. 
>
> Sorry, I don't understand.
>
> Can you to use M-x customize-option RET org-attach-commands RET then
> add a custom command pointing to the command you have written, bound
> to a keybinding of your choice?
>
> If something does not work with this approach, can you show me what
> you tried and what does not work?

Here is my patch, I try to annotate on my patch code to express my words:

#+begin_src diff
- From 6c667461b45e93059c6f801e485f7da4bfc3606c Mon Sep 17 00:00:00 2001
From: stardiviner 
Subject: [PATCH] * org-attach.el: add a new command to archive web page

,* lisp/org-attach.el (org-attach-url-archive): A new org-attach
dispatcher command to archive web page to a single file.

,* lisp/org-agenda.el (org-attach-url-archive-command): A customize
option to specify external command for archiving web page.

,* lisp/org-attach.el (org-attach-url-archive-page): A command
invoke external command to offline archive save web page.
- ---
 lisp/org-attach.el | 30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 57d1360fc..80855d147 100644
- --- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -204,6 +204,8 @@ (defcustom org-attach-commands
  "Attach a file using symbolic-link method.")
 ((?u ?\C-u) org-attach-url
  "Attach a file from URL (downloading it).")
+((?U) org-attach-url-archive
+ "Attach an offline version of web page URL.") <- This 
`org-attach-commands' is an option which indeead can be customized.
 ((?b) org-attach-buffer
  "Select a buffer and attach its contents to the task.")
 ((?n ?\C-n) org-attach-new
@@ -467,6 +469,31 @@ (defun org-attach-url (url)
   (let ((org-attach-method 'url))
 (org-attach-attach url)))
 
+(defun org-attach-url-archive (url)
<-+
+  (interactive "MURL of the web page be archived to attach: \n")   
  |
+  (let ((org-attach-method 'archive))  
  |
+(org-attach-attach url)))  
  |
+   
  |
+(defcustom org-attach-url-archive-command  
  |  You can see, all those function code can be put in user configuration. Yes.
+  (file-name-nondirectory (executable-find "monolith"))
  |
+  "The command used to offline archive web page.   
  |
+monolith can be found here: https://github.com/Y2Z/monolith.;  
  |
+  :type 'string
  |
+  :safe #'stringp  
  |
+  :group 'org-attach)  
  |
+   
  |
+(defun org-attach-url-archive-page (url target-file)   
  |
+  "Save an offline archive of web page."   
  |
+  (pcase org-attach-url-archive-command
  |
+("monolith"
  |
+ (make-process 
  |
+  :name "org-attach-offline"   
  |
+  :command (list org-attach-url-archive-command url "-o" target-file)  
  |
+  :sentinel (lambda (proc event) (message "org-attach-offline finished!")) 
  |
+  :buffer "*org-attach-url-archive*")) 
  |
+(nil (warn "You must have a command availble for offline save web page!
  |
+Set variable `org-attach-url-archive-command'."   
<--+
+
 (defun org-attach-buffer (buffer-name)
   "Attach BUFFER-NAME's contents to current outline node.
 BUFFER-NAME is a string.  Signals a `file-already-exists' error
@@ -504,7 +531,8 @@ (defun org-attach-attach (file  visit-dir method)
((eq method 'cp) (copy-file file attach-file))
((eq method 'ln) (add-name-to-file file attach-file))
((eq method 'lns) (make-symbolic-link file attach-file))
- -   ((eq method 'url) (url-copy-file file attach-file)))
+   ((eq method 'url) (url-copy-file file attach-file))
<-- But this can't be don'e through advice or something else. 
Unless copy who

Re: [Feature] add a new org-attach dispatcher command to offline save web page

2020-06-02 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Bastien  writes:

> Hi,
>
> stardiviner  writes:
>
>> I added monolith link to defcustom option docstring now. Update
>> patch again.
>
> thanks for working on this, sorry for coming late to the party.
>
> The initial need was to be able to download big web documents
> asynchronously* but the conversation drifted and the patch now is
> about adding a new org-attach command, using monolith.

No, my patch's purpose is to offline archive the whole web page completely.

>
> org-attach-commands is an option that users can customize to suit
> their needs.  Adding the ability to use monolith is fine, and we can
> advertize through Worg, but I don't think it should be in Org's core,
> because (1) monolith is never preinstalled and (2) there seems to be a
> thin and non-obvious difference between what `org-attach-url' and what
> `org-attach-url-archive' provide -- unless I miss something?

Well, It is acceptable if you think reply on monolith is un-acceptable.

I think maybe Org maintainer can improve the org-attach code to suitable to add
custom function. In my patch, If I want to add a custom function to archive
without modify Org Mode org-attach code, customize is not possible. So do you
have any idea to improve current org-attach code, make it suitable for things
like my patch?

>
> So please don't hesitate to document this on
> https://orgmode.org/worg/org-hacks.html or any other page!
>
> Thanks,
>
> * BTW, I still think implementing url-copy-file-asynchronously
> is something that would be useful within Emacs core!

I remember I send an email to emacs-dev mailing list, but seems this is not
implemented. So 

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7WXNoUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOJ1wgAwxeVRr8DS5VmN49SP6g5BfcNUYGy
V6BdIBH2DFFU1F68df8VR/zIgq94QylsoAGR/9R6zyDv7iWBiHZxCBdnn4CXkYsh
k18td+lcRmG9M2sr40FvLeNW5bNseI1Sz0quNrSOlc+1n0DDH9AiTEWUQEGCE2gW
53u2zQak4woFCuQToNP2AWm9vd+U7yBDBtkdz2vFYnqQ5TUMLC17bDcKYDPEXMVj
X0QulekeVhFw+iheQ2s63bU/IpaeU3fdylZhctNECNUqHRf9If+mOInpKYmZ3xsP
JDly8+tjtOPHlr0Llizzd07805NwNGhONyH8DXdeI7AeAQJudYkAt6x8lw==
=PEyv
-END PGP SIGNATURE-



Re: A small idea to simplify (further) time input in the date/time prompt

2020-06-02 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Gustavo Barros  writes:

> Hi All,
>
> the Org date/time prompt does deliver the promise in the manual that we "start
> getting annoyed by pretty
> much any other way of entering a date/time out there".  It has indeed become 
> so
> for me, as the date/time prompt is very neat.  But there is one place where
> input could be even shorter, which is time input.
>
> Currently, time input mostly requires "hour colon minutes", thus a full time
> specification even when minutes are "00".  And "mostly" because you can get 
> away
> with that last part if you use am/pm convention (alas, I do not belong to 
> those
> strange corners of the world).  Besides, the colon is a shift-key in many 
> common
> keyboard layouts (from a simple search, it seems to be so in British, 
> American,
> US International, German, Spanish, and Portuguese layouts, it doesn't seem to 
> be
> so for the French layout though).
>
> So I'd like to suggest a simplification there, which is: a string in the 
> format
> "hour h minute" (that's small caps letter "H"), but in which "hour h" would 
> also
> be recognized as a full hour and "00" minutes presumed.  The mnemonic is 
> obvious
> for "hour", which works well for English, French, Spanish, Portuguese, not so
> much for German.
>
> With this, we'd have some example inputs, and their respective results:
>
> 8h   -> 08:00
> 10h30-> 10:30
> 18h  -> 18:00
> 9h-10h   -> 09:00-10:00
> 9h30-10h -> 09:30-10:00
> 14h+1h   -> 14:00-15:00
>

Which date/time prompt do you mean? Like set schedule or deadline? If just raw
timestamp, it makes me confused whether it is time continuance.

> This would ease input in two ways.  First, it presumes the minutes in full
> hours, thus dispensing with this typing.  Considering full hours are a very
> common case for scheduling and appointments, that shortening should be
> significant.  It is also one key shorter than the am/pm way for full hours, 
> and
> two keys shorter for non full hours in the same case.  Second, it is easier to
> type "h" than it is to type ":", it is easier to reach and it is not a
> shift-key, so the chord is gone too.
>
> One corner case which will arise is if "zero hour" should also be presumed.
> Arguably midnight is not that common in most people's agenda, and could be
> either "0h" or "24h", so we should not really worry in shortening something 
> like
> "midnight and thirty minutes" as "h30".  But this is more tricky with duration
> specification, that is with "+".  In this case minutes not comprising a full
> hour might well be common.  So, how to specify an appointment starting at 
> 10:00
> that lasts 30 minutes? Some alternatives could be: "10h+0h30", "10h+h30",
> "10h+30m".  On a first thought I like the last one better, but I'm really not
> sure what the best approach should be here.
>
> Needless to say, current input conventions should not change.  This is just
> thought as an additional way of inputting time, alongside the ones which 
> already
> exist.  I'm unaware of any use of "h" in the date/time prompt (or of "m", for
> that matter), so I presume this should be viable without conflicting with 
> other
> currently recognized input forms.
>
>
> That's the small suggestion I had to make for the date/time prompt.  I guess,
> technically, this should be filed as "feature request".  But it is just an 
> idea
> I bring to your consideration, in the hope someone else here also likes it.
>
>
> Best,
> Gustavo.


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7WWxwUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOi4Qf/RpkotaYxjmrDA+SsjqK4ep7sLM+Y
tLwm+N47cYYDGPNR3M9o9WZYNxLncygdxXF2eYQjX7DQHmuZ8rLLyNa3Yb9P7vUb
OYywOyTWgSa5wgp1cOJepcFS384DZvZeSg+odhrJDr5wPfhfN7NpbhB3VB3TLiEr
hIHx1XzBfZbNifMR90gupPIZt2IEfHqcoI7zGa1uHfoDRPYDU61m2cVj4ZZDc1Ya
H8gPAFQD+oGbg32PUw6vQn4a6x7Qk668G0kP52e5yCISG8S5P7BKrk0HSKClPUxM
GjH0kYVm5DzEOm6YQvnWfGr2EIDuHLlMxvBaxyIXmMYc+k61RBAisKS1WA==
=QSbI
-END PGP SIGNATURE-



Re: [QUESTION] What's the ":desk" link parameter?

2020-06-02 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Ihor Radchenko  writes:

>> I'm not sure `org-link-make-description-function' is used a lot out
>> there, but the change may break existing configurations/hacks.
>
> It should not break anything. I did not remove
> `org-link-make-description-function' functionality. Just marked it as
> deprecated.
>
>> Also, is it something we could use in the current export backends
>> or just for the users?  If the latter, then I'm in favor of making
>> this move, probably for 9.5.
>
> I am not very familiar with the export code, but the function provided
> in :description property should follow the same conventions with
> `org-link-make-description-function'. The only place it is used is
> org-insert-link. I do not see how it can influence export code. As I
> understand, org-insert-link is mostly for users.

I agree, I used org-store-link and org-insert-link a lot. If this patch is
applied, then I can add more smart rules to auto generate the description based
on file extension etc.

>
> Best,
> Ihor
>
>
> Bastien  writes:
>
>> Hi Ihor,
>>
>> Ihor Radchenko  writes:
>>
>>>> thanks for the patch.  I assume you are submitting it against master,
>>>> am I right?
>>>
>>> The patch is against commit 2e96dc639.
>>
>> I see, thanks.
>>
>>>> From reading this, I don't see what bug it fixes, what problem it
>>>> solves or what real user need it responds to, but maybe I lost part
>>>> of the context.  Can you explain why this should be applied?
>>>
>>> It does not fix any bug. Rather adds a new feature [1]. Currently, org
>>> provides org-link-make-description-function as user customisation to
>>> compute default link description. The patch provides a way to set such
>>> description functions on per link type basis (via :description link
>>> parameter). Using link parameters looks natural for me since similar
>>> customisation is already done in :follow and :store link parameters.
>>
>> Okay, I understand.  It feels natural to me too.
>>
>> I'm not sure `org-link-make-description-function' is used a lot out
>> there, but the change may break existing configurations/hacks.
>>
>> Also, is it something we could use in the current export backends
>> or just for the users?  If the latter, then I'm in favor of making
>> this move, probably for 9.5.
>>
>> Nicolas, what do you think?
>>
>> -- 
>>  Bastien


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7WWmEUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMUewf/RK9/BCnTbNyiNKMklORPitNALPxb
xJC4OKQiwkrPLK1y8m1sUa8Qu1rgg/vb/CSa/lJYJOY448hL6IxAJAxMdGvw0k1g
xIyslnyHu7WxneouxhYr5qIQFWtdJFtKPcuPvMN9VfryD/fxtA+n9rjfw9FLEZuf
Rqp+/clRzQC6BfrYP35OTb1srryST9PblUv283VR6MQASS7QRlHRlVNykFsNWvb9
2kaRt+uB5KqIGVYWIkLYwE1aelw4iUdg/sQkl5keZHIBU/DE5RqPEWFzyIfgcROz
EGUVBh0z0wiAqpm8Ncj7M0MwjkQnNLiRuMWH485NhlSKdMKjDKog7fOMkA==
=pi7r
-END PGP SIGNATURE-



[PATCH v3] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-06-01 Thread stardiviner

Matthew Lundin  writes:

> stardiviner  writes:
>
>> Matthew Lundin  writes:
>>
>>>
>>> I think you also need to replace the newline with a space in the upper
>>> case version.
>>>
>> Supposed there is \n after #+end_src. I also checked the original version 
>> before
>> that change commit. The original has an newline. I write patch by comparing
>> before and after (side by side).
>
> I'm referring to this line in the patch:
>
> indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src 
> ")
>  ^
>
> The newline that needs to be removed is indicated by "^".
>
> You can see a correct similar version of this line on line 1932 of
> ob-core.el.
>
> The original line the problematic commit replaced would also have had a
> space in both, since it called either downcase or upcase on the string
> "#+begin_src ".

You're right, I updated the patch now. I really missed seeing that. :)

From 67b11b793d4ce45c75f5874571434c8a769ed7f3 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Mon, 1 Jun 2020 08:44:22 +0800
Subject: [PATCH] [PATCH] fix 5f0a9cca3 missing space

* lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
with missing space.
---
 lisp/ob-core.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e554e3934..e798595bd 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block ( arg)
 			(if (looking-at "^") "" "\n")
 			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
 			(if arg stars indent) "\n"
-			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
+			indent (if upper-case-p "#+BEGIN_SRC " "#+begin_src ")
 			lang
 			(if (> (length headers) 1)
 			(concat " " headers) headers)
-- 
2.26.2


>
> Best,
>
> Matt


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: [PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-05-31 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Matthew Lundin  writes:

> stardiviner  writes:
>
>> I updated the patch commit message.
>>
>> From b0bdf52a305cb5f9663ee1dc2d08c5de6c7cb602 Mon Sep 17 00:00:00 2001
>> From: stardiviner 
>> Date: Sun, 31 May 2020 10:59:41 +0800
>> Subject: [PATCH] fix 5f0a9cca3 missing space
>>
>> * lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
>> with missing space.
>> ---
>>  lisp/ob-core.el | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lisp/ob-core.el b/lisp/ob-core.el
>> index e554e3934..79937e517 100644
>> --- a/lisp/ob-core.el
>> +++ b/lisp/ob-core.el
>> @@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block ( arg)
>>  (if (looking-at "^") "" "\n")
>>  indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
>>  (if arg stars indent) "\n"
>> -indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
>> +indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
>>  lang
>>  (if (> (length headers) 1)
>>  (concat " " headers) headers)
>> -- 
>> 2.26.2
>>
>
> I think you also need to replace the newline with a space in the upper
> case version.
>

Supposed there is \n after #+end_src. I also checked the original version before
that change commit. The original has an newline. I write patch by comparing
before and after (side by side).

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7UT0kUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOt0ggAtPk/dBaarsrRZOLJaN3SUtMeeIUM
BVdY5194hxKVYSxGtvAZDEi4MimfUgBzuXfaytYlVDeBxd1ShBbaoRNecqzlvaLm
qUAvI3S1ALJKfE4NKZrGwmZAbYdSE1OlJrhNz5IZ5xuJRWIz/ssJyVNhXbwwXy5o
QIbKxdzFdQ1g1iEYJOJS6U7yv2glmLkjgqmosMmFoJCA9Qrup898drdeOqwtUM9n
dmy5uehZonZ0bQpyr6Y09jrWj9fsDD53noZH2K1J2LeHYtf5TMrL+mxMRBSuK8SP
BgfwPqz9mYh1/YQzgYfB0s+J/zT1oBzD08WHHmqxbtM0sOc4ixkv7xszIg==
=r+5b
-END PGP SIGNATURE-



[PATCH v2] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-05-30 Thread stardiviner

I updated the patch commit message.

From b0bdf52a305cb5f9663ee1dc2d08c5de6c7cb602 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sun, 31 May 2020 10:59:41 +0800
Subject: [PATCH] fix 5f0a9cca3 missing space

* lisp/ob-core.el (org-babel-demarcate-block): replace wrong newline
with missing space.
---
 lisp/ob-core.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e554e3934..79937e517 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block ( arg)
 			(if (looking-at "^") "" "\n")
 			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
 			(if arg stars indent) "\n"
-			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
+			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
 			lang
 			(if (> (length headers) 1)
 			(concat " " headers) headers)
-- 
2.26.2


stardiviner  writes:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
>
> When I have a source block (The "|" represents the point):
>
> #+begin_src sh :eval no
> chrome --remote-debugging-port
> |
>
> #+end_src
>
> Then press =[C-c C-v d]=, it becomes like this:
>
> #+begin_src sh :eval no
> chrome --remote-debugging-port
> #+end_src
>
> #+begin_src
> sh :eval no
>
> #+end_src
>
> - -- 
> [ stardiviner ]
>I try to make every word tell the meaning that I want to express.
>
>Blog: https://stardiviner.github.io/
>IRC(freenode): stardiviner, Matrix: stardiviner
>GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
> -BEGIN PGP SIGNATURE-
>
> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7RvwkUHG51bWJjaGls
> ZEBnbWFpbC5jb20ACgkQG13xyVromsPWigf+NOP4j0/9U3YvhHhdAmNbrLiNa+My
> NsN7msj1uSwwgtyKccaDOmB4mRMoKxhdK3TMn55LmKj+xsJY54EQ35Oq2G4HsJYX
> kbypfoj09NNjE4R7Qw7IyAbr7cLkITPbp+9UCDX+lupyNGsKDmkDtrl84JG/Lnxs
> jp5FuKBzeG2P7dR8Zs8TFPZOzzPP4jQKnUgfghRcgLNxxJXX2CPge5+cAKiDQFoh
> yQCXdd9cFbldnethRjQb6GrlylBcCaHe41AuKrXAdn2gmv1gPLNb1perJ/TCyw3x
> ZQy554ZI8dOL1jH4lL5JmGxwWcgMq4qahdhUlfSCEzZKgjKqTtVTdBJYwg==
> =qwc/
> -END PGP SIGNATURE-


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


[PATCH] Re: [BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-05-30 Thread stardiviner

Berry, Charles  writes:

>> On May 29, 2020, at 7:03 PM, stardiviner  wrote:
>> 
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>> 
>> 
>> When I have a source block (The "|" represents the point):
>> 
>> #+begin_src sh :eval no
>> chrome --remote-debugging-port
>> |
>> 
>> #+end_src
>> 
>> Then press =[C-c C-v d]=, it becomes like this:
>> 
>> #+begin_src sh :eval no
>> chrome --remote-debugging-port
>> #+end_src
>> 
>> #+begin_src
>> sh :eval no
>> 
>> #+end_src
>> 
>> - --
>
> Exactly. Commit 5f0a9cca3 adds a `\n' in line 1911 that should have been a 
> space. 
>

Thanks! I just did a small patch to fix this.

From af210eeb78d7611aeb7b6d1a99433cee10e53186 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Sun, 31 May 2020 10:59:41 +0800
Subject: [PATCH] fix 5f0a9cca3

---
 lisp/ob-core.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e554e3934..79937e517 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1908,7 +1908,7 @@ (defun org-babel-demarcate-block ( arg)
 			(if (looking-at "^") "" "\n")
 			indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
 			(if arg stars indent) "\n"
-			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src\n")
+			indent (if upper-case-p "#+BEGIN_SRC\n" "#+begin_src ")
 			lang
 			(if (> (length headers) 1)
 			(concat " " headers) headers)
-- 
2.26.2


> Chuck
>
> [snip]


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


[BUG] recently commits on master branch breaks command 'org-babel-demarcate-block'

2020-05-29 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


When I have a source block (The "|" represents the point):

#+begin_src sh :eval no
chrome --remote-debugging-port
|

#+end_src

Then press =[C-c C-v d]=, it becomes like this:

#+begin_src sh :eval no
chrome --remote-debugging-port
#+end_src

#+begin_src
sh :eval no

#+end_src

- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7RvwkUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPWigf+NOP4j0/9U3YvhHhdAmNbrLiNa+My
NsN7msj1uSwwgtyKccaDOmB4mRMoKxhdK3TMn55LmKj+xsJY54EQ35Oq2G4HsJYX
kbypfoj09NNjE4R7Qw7IyAbr7cLkITPbp+9UCDX+lupyNGsKDmkDtrl84JG/Lnxs
jp5FuKBzeG2P7dR8Zs8TFPZOzzPP4jQKnUgfghRcgLNxxJXX2CPge5+cAKiDQFoh
yQCXdd9cFbldnethRjQb6GrlylBcCaHe41AuKrXAdn2gmv1gPLNb1perJ/TCyw3x
ZQy554ZI8dOL1jH4lL5JmGxwWcgMq4qahdhUlfSCEzZKgjKqTtVTdBJYwg==
=qwc/
-END PGP SIGNATURE-



Re: [Feature] add a new org-attach dispatcher command to offline save web page

2020-05-29 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


Matthew Lundin  writes:

> Ihor Radchenko  writes:
>
>>> As I said, PATCH welcome, I admired many times I don't have ability to 
>>> build a
>>> complex archive functionality on url.el or wget or curl.
>>
>> I have found the following solution [1] using wget:
>>
>> wget --mirror -p --convert-links -P ./LOCAL-DIR WEBSITE-URL
>>
>
> I don't think --mirror is what we want this context, since that will
> initiate a recursive download of the entire site. (Ironically, my IP is
> now banned from a personal blog that provides a how-to for using wget
> after I tried to run the above command on it.) From the wget manual:
>
> -m
> --mirror
> Turn on options suitable for mirroring.  This option turns on 
> recursion and
> time-stamping, sets infinite recursion depth and keeps FTP directory 
> listings.
> It is currently equivalent to -r -N -l inf --no-remove-listing.
>
> AFAICT, org-board uses the following options, which limit the archiving
> to a single page and all its resources:
>
> wget -e robots=off --page-requisites --adjust-extension --convert-links [...]

Interesting, Learned a new skill.

>
>> This will not bundle the page into a single file, but it is better than
>> nothing. org-attach does not have to attach exactly one file.
>
> You can also create a warc (web archive) file with wget, but then you
> need a web archive replayer to view it, which is not exactly convenient.
>

Looks like you already parsed most technologies in awesome-web-archive list.
Does that mean most technologies not suitable for Org Mode for now?

> Best,
>
> Matt


- -- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7RORIUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPyxwf5ATSzoz/vxLnlWGJ4jKxH/HtKlleE
LJP3BhLDuRl6nrjJTBYfwCM/SrFbcWQjpzLtoXFRvL6Ro60yhNWxCgYSu74WPF6B
Or3oEQrnQGvQ8SKNcyEOimXbKCUDImNetCAyLpxtbPJ0pHtf6py49p9i/M7ZTZK/
jIF2g0E1AezDwGPG00jpdO1cDOiGYczvRfaaMr2OQ1EBtDrZOn5z+Cb6YiaHqfF5
x5HT5Z8fCqxAFOj9ixzOdqZ9C2hRncxATyiSFH0vAzwDYpYw9A20ZqoevThTVZRI
IUmirJM7pUQ4MM2SXidkLaT5T/Zuy4PjCrM8yfXybbnrSkWrVgjeEpXhYg==
=gsT0
-END PGP SIGNATURE-



  1   2   3   4   5   6   >