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-



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


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 know this "--mirror" option. I used this solution to archive web page before.
Make this command work in org-attach is a little bit of complicated. I have
considered it on current org-attach code. With my Elisp ability, can't write it
out. Still not very good at Elisp :(

>
> 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 check out function `org-attach-attach` source code, the "cond" structure
is the most commands.

I remember org-attach dispatcher used to have a command to move directory
directly. But it seems removed. Now, all org-attach commands only supports file.
I also search Elisp functions, can't find a function to move directory around.
So PATCH welcome. I remember you send patch on Org Mode mailing list, I believe
you at least is same kind of newbie like me who can write a little Elisp. :)

>
> [1] 
> https://askubuntu.com/questions/411540/how-to-get-wget-to-download-exact-same-web-page-html-as-browser
>
> Best,
> Ihor
>
> stardiviner  writes:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>>
>> Matthew Lundin  writes:
>>
>>> Ihor Radchenko  writes:
>>>
>>>> It does not mean that attaching URL directly is not worth including
>>>> into org. This sounds pretty common use case, especially considering
>>>> the number of packages providing similar feature. You mentioned
>>>> org-board, but there is also org-download and org-web-tools.
>>>
>>> My uneasiness has more to do with the specificity of the dependence on
>>> monolith and the way that is hard-coded into the patch. When it comes to
>>> patches, I think priority should go to those that are configurable,
>>> accessible, and useful for everyone as opposed to those that have
>>> hard-coded work-flows or highly-specific user configurations.
>>
>> I don't think it's hardcoded, As I said in my first email, It's an 
>> `defcustom',
>> isn't it? User totally can change that. And I used `executable-find', the 
>> value
>> will be `nil' when monolith is not available. And I don't have ability to
>> archive same functionality with wget or curl. And as I said before, PATCH
>> welcome.
>>
>>>
>>>> I agree that monolith is completely uncommon tool and I would not expect
>>>> the majority of users to have it installed, but the same functionality
>>>> utilising built-in url.el (as a default) should be acceptable.
>>>
>>> The question is: which functionality? A simple downloading tool or a
>>> full archival tool? Achieving similar functionality to org-board or
>>> monolith would a big task, since they aim to download an archival
>>> version of a webpage (including all resources). In addition, with
>>> archiving you also quickly run into the complexity of versioning based
>>> on time archived. There's also the challenge of mapping the downloaded
>>> files to metadata (specifically the original url). Org-board currently
>>> handles both of these very well.
>>
>> If you mean adding a timestamp and original URL, I don't think its our 
>> argument
>> point, because user totally can do it manually, or automatic this task in 
>> some
>> kind of way. WDYT?
>>
>>>
>>> I suppose there would be a few options depending on what the aims are:
>>>
>>> 1. At the simple end, include little more than than a quick and dirty
>>>way of downloading a single resource (html, pdf, jpeg) using url.el
>>>or wget (or optionally, monolith) and putting that in the attachment
>>>folder. Those who want full archiving of all resources could use
>>>other tools like org-board or org-web-tools.
>>
>> the [u] url downloading method already did the simple task.
>>
>>>
>>> 2. At the (much) more complex end, it would be to code out a robust
>>>archiving solution on top of url.el or wget.
>>
>> 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.
>>
>> Isn't Org Mode build up from small things? Can just become a big tool at 
>&

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

2020-05-28 Thread stardiviner

I added monolith link to defcustom option docstring now. Update patch again.
  
From 6c667461b45e93059c6f801e485f7da4bfc3606c Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 29 May 2020 09:46:15 +0800
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.")
 ((?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
+  (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))
+   ((eq method 'archive) (org-attach-url-archive-page file attach-file)))
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
-- 
2.26.2


stardiviner  writes:

> I attached the patch.
>
> I think this feature will be helpful for use who archive web page data usually
> like me. To be more portable, I also added an defcustom option for other
> external command. And use an if condition to detect whether external command
> available, else warning user.


-- 
[ 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 updated] Re: [Feature] add a new org-attach dispatcher command to offline save web page

2020-05-28 Thread stardiviner

I adopted some part of my patch, and make function name and docstring more clear
after this mail thread long discussion.
  
From 7e682ccd8d0d2a567de1bbbc0c8e02ee59e156bb Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Fri, 29 May 2020 09:46:15 +0800
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 | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 57d1360fc..14ac0f828 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.")
 ((?b) org-attach-buffer
  "Select a buffer and attach its contents to the task.")
 ((?n ?\C-n) org-attach-new
@@ -467,6 +469,30 @@ (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
+  (file-name-nondirectory (executable-find "monolith"))
+  "The command used to offline archive web page."
+  :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 +530,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))
+   ((eq method 'archive) (org-attach-url-archive-page file attach-file)))
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
-- 
2.26.2


stardiviner  writes:

> I attached the patch.
>
> I think this feature will be helpful for use who archive web page data usually
> like me. To be more portable, I also added an defcustom option for other
> external command. And use an if condition to detect whether external command
> available, else warning user.


-- 
[ 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: [Feature] add a new org-attach dispatcher command to offline save web page

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


Matthew Lundin  writes:

> Ihor Radchenko  writes:
>
>> My view on this is bare-bones download, in a spirit of org-attach
>> itself. There is already 'url method in org-attach-attach, but it is
>> hard-coded to url-retrieve-synchronously. It would be handy if user
>> could configure alternative retrievers (like monolith, wget, curl, or
>> some user-defined function).
>
> Thanks. I'm learning about this for the first time after using
> org-attach for years! I have no idea why I've never noticed it.
>
>> Note that monolith does not crawl the website. It only collects
>> everything needed to show the page as you see it in browser into single
>> html file. This behaviour is what one expects to obtain when saving a
>> full web-page from browser.
>
> Agreed. This looks like the way to go. Keep it simple and abstract the
> call to url-copy-file to allow the user to configure the command for
> downloading the page/file. 

I tried to adopt my code to fit this design. But later, I realized this two
things are totally different functionality. url-retrieve-synchronously is used
to download URL file. Not for offline archiving.

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7QcEAUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOJpgf/Yzib6/loAB+N3CMY7LBKxmH/xZ7d
u+isMgMlB2b9lVcC0BojwVG8Vo372Midjzu0+TJr2KuU/l9QV8xLqK90FOsLKzha
y2gbCghl2ehPvIfIKfI/LUPW3NOFIq01T4RYHgpEQ2GCWBdpNZ6Hki3fnvou2YzO
oIdtyablG5tZowvgRNQDNSg8XvaLTkkPqvXQUX1n7wba+buMADmns+rc3OTWBQqW
BHa8HC0X0n4TIcGy/pnet7+ooJtkHT05Ua9W0SrsaQthbaoqiDrfEyirL3Izm89D
rKYTo8dM7hKWLp7gQckPH6TYa8eiK0oQjp1riHa7myB2DjeWRqz2tKs2VA==
=JzUc
-END PGP SIGNATURE-



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

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


Thanks, Ihor, your explanation is helpful a lot!!!

Ihor Radchenko  writes:

>> My uneasiness has more to do with the specificity of the dependence on
>> monolith and the way that is hard-coded into the patch. When it comes to
>> patches, I think priority should go to those that are configurable,
>> accessible, and useful for everyone as opposed to those that have
>> hard-coded work-flows or highly-specific user configurations.
>
> Agree. Though I can see a use of having monolith as one of the options
> to help people discover what kind of tools they can use. I personally
> had a hard time finding command-line cli like monolith. Actually, it is
> the first time I heard about some offline tool handling js without a
> need to write python or ruby code. 
>
>> The question is: which functionality? A simple downloading tool or a
>> full archival tool? Achieving similar functionality to org-board or
>> monolith would a big task, since they aim to download an archival
>> version of a webpage (including all resources). 
>
> My view on this is bare-bones download, in a spirit of org-attach
> itself. There is already 'url method in org-attach-attach, but it is
> hard-coded to url-retrieve-synchronously. It would be handy if user
> could configure alternative retrievers (like monolith, wget, curl, or
> some user-defined function).
>
> Note that monolith does not crawl the website. It only collects
> everything needed to show the page as you see it in browser into single
> html file. This behaviour is what one expects to obtain when saving a
> full web-page from browser.
>
>> In addition, with
>> archiving you also quickly run into the complexity of versioning based
>> on time archived. 
>
> I guess that org-attach-git can be used for versioning, but I don't
> think that versioning is within scope of this patch. Monolith does not
> even support versioning.
>
>> There's also the challenge of mapping the downloaded
>> files to metadata (specifically the original url). Org-board currently
>> handles both of these very well.
>
> org-board is a great package, but it is not built-in. I do not think
> that all the org-board functionality needs to be included into
> org-attach. At least not within scope of this patch as I understand it.
>
> Best,
> Ihor
>
> Matthew Lundin  writes:
>
>> Ihor Radchenko  writes:
>>
>>> It does not mean that attaching URL directly is not worth including
>>> into org. This sounds pretty common use case, especially considering
>>> the number of packages providing similar feature. You mentioned
>>> org-board, but there is also org-download and org-web-tools.
>>
>> My uneasiness has more to do with the specificity of the dependence on
>> monolith and the way that is hard-coded into the patch. When it comes to
>> patches, I think priority should go to those that are configurable,
>> accessible, and useful for everyone as opposed to those that have
>> hard-coded work-flows or highly-specific user configurations.
>>
>>> I agree that monolith is completely uncommon tool and I would not expect
>>> the majority of users to have it installed, but the same functionality
>>> utilising built-in url.el (as a default) should be acceptable.
>>
>> The question is: which functionality? A simple downloading tool or a
>> full archival tool? Achieving similar functionality to org-board or
>> monolith would a big task, since they aim to download an archival
>> version of a webpage (including all resources). In addition, with
>> archiving you also quickly run into the complexity of versioning based
>> on time archived. There's also the challenge of mapping the downloaded
>> files to metadata (specifically the original url). Org-board currently
>> handles both of these very well.
>>
>> I suppose there would be a few options depending on what the aims are:
>>
>> 1. At the simple end, include little more than than a quick and dirty
>>way of downloading a single resource (html, pdf, jpeg) using url.el
>>or wget (or optionally, monolith) and putting that in the attachment
>>folder. Those who want full archiving of all resources could use
>>other tools like org-board or org-web-tools.
>>
>> 2. At the (much) more complex end, it would be to code out a robust
>>archiving solution on top of url.el or wget.
>>
>> 3. Another, possibly simpler option... Add a command to the dispatcher
>>that allows the user to invoke a custom function that is called with
>>the attachment directory as the default-directory. 

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

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


Matthew Lundin  writes:

> Ihor Radchenko  writes:
>
>> It does not mean that attaching URL directly is not worth including
>> into org. This sounds pretty common use case, especially considering
>> the number of packages providing similar feature. You mentioned
>> org-board, but there is also org-download and org-web-tools.
>
> My uneasiness has more to do with the specificity of the dependence on
> monolith and the way that is hard-coded into the patch. When it comes to
> patches, I think priority should go to those that are configurable,
> accessible, and useful for everyone as opposed to those that have
> hard-coded work-flows or highly-specific user configurations.

I don't think it's hardcoded, As I said in my first email, It's an `defcustom',
isn't it? User totally can change that. And I used `executable-find', the value
will be `nil' when monolith is not available. And I don't have ability to
archive same functionality with wget or curl. And as I said before, PATCH
welcome.

>
>> I agree that monolith is completely uncommon tool and I would not expect
>> the majority of users to have it installed, but the same functionality
>> utilising built-in url.el (as a default) should be acceptable.
>
> The question is: which functionality? A simple downloading tool or a
> full archival tool? Achieving similar functionality to org-board or
> monolith would a big task, since they aim to download an archival
> version of a webpage (including all resources). In addition, with
> archiving you also quickly run into the complexity of versioning based
> on time archived. There's also the challenge of mapping the downloaded
> files to metadata (specifically the original url). Org-board currently
> handles both of these very well.

If you mean adding a timestamp and original URL, I don't think its our argument
point, because user totally can do it manually, or automatic this task in some
kind of way. WDYT?

>
> I suppose there would be a few options depending on what the aims are:
>
> 1. At the simple end, include little more than than a quick and dirty
>way of downloading a single resource (html, pdf, jpeg) using url.el
>or wget (or optionally, monolith) and putting that in the attachment
>folder. Those who want full archiving of all resources could use
>other tools like org-board or org-web-tools.

the [u] url downloading method already did the simple task.

>
> 2. At the (much) more complex end, it would be to code out a robust
>archiving solution on top of url.el or wget.

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.

Isn't Org Mode build up from small things? Can just become a big tool at once?

>
> 3. Another, possibly simpler option... Add a command to the dispatcher
>that allows the user to invoke a custom function that is called with
>the attachment directory as the default-directory. This would enable
>more end-user flexibility, such as the ability to use
>wkhtmtoimage/wkhtmltopdf, monolith, phantom.js, archive.is, etc.
>

This is leaved to `defcustom' option. I will improve the download function to
have enough elasticity.

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7QbYMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOFvAgAjTPtt5ZikNZnkp1gfuEGunVzblk6
D6O+qgZAamT0EpR2nwK9U+x470KZAhXiLURkVb0l9/6uvA6MQZtj+umX/Qer/6bw
vB4RICWenFKyyBMy9U1pZ9WzTNw2ZNfeaEiJ0XlgXx9ZPGjBgcLi/7FSM4NybV4O
qbGwHbp4AzZ4mJOrMchNwlQfDYpg381xDewnHeuwtkVeBc34HpuFEGYKdmtOJ16S
mnL/5LrbI7MahlIZuiqyAzeyU3DkSvFOC/ovvch9YlAk1SeK/BslUcaGrwl/Il70
XG/28XaAvVW2OYrO9vOmwpdoguQqARhKeMuof6p85waf1OF8itd97P95Lw==
=V/fu
-END PGP SIGNATURE-



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

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


Ihor Radchenko  writes:

>> If have better solution, I totally agree with that.
>
> In the current state, your patch will be pretty much useless for users
> without technical background.
>
> url-retrieve-synchronously + save-buffer should be a better default. It
> will be available for all users.
>

I don't know how to implement similar functionality like monolith with
url-retrieve-synchronously + save-buffer. PATCH welcome.

> Ideally, there should be several customisation options. Something like:
>  - url-retrieve-synchronously
>  - curl
>  - wget
>  - monolith

Of course curl and wget is alternative options, just still same problem. Don't
know how to download web page as a single file and save it as archive file. If
use other ways, it's just another org-board. Then this patch will be 
unnecessary.

>
> Also, it would be great if you provide some description about each
> customisation in the docstring. For example, a link to github page of
> monolith and a brief description how it is different from other url
> retrieval methods should be useful for general user.

This is good solution, I will improve option description.

>
> Best,
> Ihor
>
>
> stardiviner  writes:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>>
>> Ihor Radchenko  writes:
>>
>>>> This looks helpful, but I think this should be an add-on rather than
>>>> integrated into the org-attach. I'm glad to learn about monolith, but
>>>> far fewer users are likely to have it installed than have wget or curl
>>>> installed. You might also want to check out org-board, which has similar
>>>> functionality:
>>>
>>> It does not mean that attaching URL directly is not worth including into
>>> org. This sounds pretty common use case, especially considering the number
>>> of packages providing similar feature. You mentioned org-board, but
>>> there is also org-download and org-web-tools.
>>
>> That's right, this phenomenon represents an obviously situation, Org Mode 
>> should
>> have this functionality.
>>
>>>
>>> I agree that monolith is completely uncommon tool and I would not expect
>>> the majority of users to have it installed, but the same functionality
>>> utilising built-in url.el (as a default) should be acceptable.
>>
>> If have better solution, I totally agree with that.
>>
>>>
>>> Best,
>>> Ihor
>>>
>>>
>>> Matthew Lundin  writes:
>>>
>>>> stardiviner  writes:
>>>>
>>>>> I attached the patch.
>>>>>
>>>>> I think this feature will be helpful for use who archive web page data 
>>>>> usually
>>>>> like me. To be more portable, I also added an defcustom option for other
>>>>> external command. And use an if condition to detect whether external 
>>>>> command
>>>>> available, else warning user.
>>>>
>>>> This looks helpful, but I think this should be an add-on rather than
>>>> integrated into the org-attach. I'm glad to learn about monolith, but
>>>> far fewer users are likely to have it installed than have wget or curl
>>>> installed. You might also want to check out org-board, which has similar
>>>> functionality:
>>>>
>>>> https://github.com/scallywag/org-board
>>>>
>>>> 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-
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7PXKoUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsOiMQf9EY7ES42hWxdjgFqiN0UqPGssRd+l
>> fcvhb+yiT5/71TYA8YbQOF0Pa2SpUBgGUw+hcHUd9aDXxAP+4ucmP4bZ/vx29UTN
>> T7YpOvuc5ZkafiN5bWghij1dLYhfi2CMDGGduU9rvjSleaRMhoX12wo8OM2qBHDm
>> 2bqWHrZsGVPsNlAK3ymN3PdmwOtxktRVUxWZOug3ZF6LYnEHWRp/rb6lvS2BF3Ej
>> qNazerYVcpfDsOiCWTSrjos2gnITT2pSlnxmrQFO69Pvex+T2dEJL7raNyuXi3Qd
>> jn5uayrnHn4ZeUwSfmAQiqvq2TsFZ5zvtH0nKM+4tp/6gSgEuTw9gYaoBQ==
>> =qrFy
>> -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
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7P4CwUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMnIgf+MR3SvdlaxKofkSPZjYknvJ/MwUy4
iJOFYe0VRUXcNyjkQVGToNVVM50rWodR29LSXy8F1WbvgjDZb0arktsjOpjy+0Oq
R/7JiE7Y8lXYPlmn+Gcqoijcuoo0tNNaE8ia6U9uYbhp8I1Whd0Jhx5kWiXCxlWe
AMf2Yz4mw2CJc67W1MVUPM/2nq8+GhduLmY7UPw56A6ph+H2HD/AO+FzgL0dlivP
lV3EKCc7j5kA5uzXqbqfWJZdylH4cUbzdHHePsW+EpWodF/tcJcGJmlIm/PUNuEX
MsIkkKQt7QFLvr47vROVrJczEjT70ZdjWqjTZf5/esEsRUhb+m8uDbgc5g==
=c9Pj
-END PGP SIGNATURE-



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

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


Matthew Lundin  writes:

> stardiviner  writes:
>
>> I attached the patch.
>>
>> I think this feature will be helpful for use who archive web page data 
>> usually
>> like me. To be more portable, I also added an defcustom option for other
>> external command. And use an if condition to detect whether external command
>> available, else warning user.
>
> This looks helpful.

Yes, this is helpful. Especially for archiving modern web pages.

> but I think this should be an add-on rather than integrated into the
> org-attach.

I more like an alternative version of [C-c C-a u] version which not downloading
the file, just download the web page instead.

> I'm glad to learn about monolith, but far fewer users are likely to have it
> installed than have wget or curl installed.

This option is not enabled by default or forced, The defcustom option will try
to find the command. It's just an option. Many Windows user also neither have
wget nor curl installed. That considering will ban lots of functionality. I did
an search in Org Mode source code, I found some items like org-feed.el which
using wget and curl. Like most Babel series, ob-plantuml.el etc, they all reply
on external stuff.

You might also want to check out org-board, which has similar
> functionality:
>
> https://github.com/scallywag/org-board
>

I have used org-board before, but it's just not perfect for my need (well,
personal experience just). There are some disadvantages, like complex operation,
too many steps to archive web page, many files (bad for Org directory backup)
etc. And wget or curl is bad for archive modern web pages. They are old for old
web pages.

The only disadvantage of my patch is that "monolith" is not in Emacs or Org Mode
built-in directly. Org Mode is an open source project, so it does not contains
not open source stuff, I agree. I don't think a line of code ~(executable-find
"monolith")~ is against this principle.

Best 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-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7PXNYUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOTwQf+MyArcTpZG1CdzSiYTIFkp7P8/2Bo
L5CM11djHyv4CVtR+vJJOR3REQrkn6Wl86S82uG/YhJ5R2bn+DELZTnsSI1M1f63
W40UcLkgpZ/8+lWi/m2MvoB8mW64vdE54uXKvbQHaY21RreVi5IaR7VstMsuwLVw
BngcypAr+0yGqCPsoD7ulal74YZLQR6o1WogvHERAwpMiDbJwwfh1HNVH2/2xYYv
SuOX+6LCAOAkMGUr3TA8eWs1cttxoqdRLIINVB1mriq9GcjxV9fi6I9pXmA2xhcu
ICaY+lwive+1/grZ/0y5klaE/0bsecGq6FCEUuynxWvnatn6T4Nx7wZK6A==
=LcTW
-END PGP SIGNATURE-



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

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


Ihor Radchenko  writes:

>> This looks helpful, but I think this should be an add-on rather than
>> integrated into the org-attach. I'm glad to learn about monolith, but
>> far fewer users are likely to have it installed than have wget or curl
>> installed. You might also want to check out org-board, which has similar
>> functionality:
>
> It does not mean that attaching URL directly is not worth including into
> org. This sounds pretty common use case, especially considering the number
> of packages providing similar feature. You mentioned org-board, but
> there is also org-download and org-web-tools.

That's right, this phenomenon represents an obviously situation, Org Mode should
have this functionality.

>
> I agree that monolith is completely uncommon tool and I would not expect
> the majority of users to have it installed, but the same functionality
> utilising built-in url.el (as a default) should be acceptable.

If have better solution, I totally agree with that.

>
> Best,
> Ihor
>
>
> Matthew Lundin  writes:
>
>> stardiviner  writes:
>>
>>> I attached the patch.
>>>
>>> I think this feature will be helpful for use who archive web page data 
>>> usually
>>> like me. To be more portable, I also added an defcustom option for other
>>> external command. And use an if condition to detect whether external command
>>> available, else warning user.
>>
>> This looks helpful, but I think this should be an add-on rather than
>> integrated into the org-attach. I'm glad to learn about monolith, but
>> far fewer users are likely to have it installed than have wget or curl
>> installed. You might also want to check out org-board, which has similar
>> functionality:
>>
>> https://github.com/scallywag/org-board
>>
>> 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-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7PXKoUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOiMQf9EY7ES42hWxdjgFqiN0UqPGssRd+l
fcvhb+yiT5/71TYA8YbQOF0Pa2SpUBgGUw+hcHUd9aDXxAP+4ucmP4bZ/vx29UTN
T7YpOvuc5ZkafiN5bWghij1dLYhfi2CMDGGduU9rvjSleaRMhoX12wo8OM2qBHDm
2bqWHrZsGVPsNlAK3ymN3PdmwOtxktRVUxWZOug3ZF6LYnEHWRp/rb6lvS2BF3Ej
qNazerYVcpfDsOiCWTSrjos2gnITT2pSlnxmrQFO69Pvex+T2dEJL7raNyuXi3Qd
jn5uayrnHn4ZeUwSfmAQiqvq2TsFZ5zvtH0nKM+4tp/6gSgEuTw9gYaoBQ==
=qrFy
-END PGP SIGNATURE-



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

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


Matthew Lundin  writes:

> stardiviner  writes:
>
>> I attached the patch.
>>
>> I think this feature will be helpful for use who archive web page data 
>> usually
>> like me. To be more portable, I also added an defcustom option for other
>> external command. And use an if condition to detect whether external command
>> available, else warning user.
>
> This looks helpful.

Yes, this is helpful. Especially for archiving modern web pages.

> but I think this should be an add-on rather than integrated into the
> org-attach.

I more like an alternative version of [C-c C-a u] version which not downloading
the file, just download the web page instead.

> I'm glad to learn about monolith, but far fewer users are likely to have it
> installed than have wget or curl installed.

This option is not enabled by default or forced, The defcustom option will try
to find the command. It's just an option. Many Windows user also neither have
wget nor curl installed. That considering will ban lots of functionality. I did
an search in Org Mode source code, I found some items like org-feed.el which
using wget and curl. Like most Babel series, ob-plantuml.el etc, they all reply
on external stuff.

You might also want to check out org-board, which has similar
> functionality:
>
> https://github.com/scallywag/org-board
>

I have used org-board before, but it's just not perfect for my need (well,
personal experience just). There are some disadvantages, like complex operation,
too many steps to archive web page, many files (bad for Org directory backup)
etc. And wget or curl is bad for archive modern web pages. They are old for old
web pages.

The only disadvantage of my patch is that "monolith" is not in Emacs or Org Mode
built-in directly. Org Mode is an open source project, so it does not contains
not open source stuff, I agree. I don't think a line of code ~(executable-find
"monolith")~ is against this principle.

Best 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-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7PXCgUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNBgQf/TCfGrMuLzGQSx0N1zzLmd2nX+tTj
6CUJd82SWpHqwI4QZX1BNd8JLpp5OKOw8o3LZi9y5UigOIxrh8DG51vUn+sJBvl5
iaBx3ao/K6Ff1ytMFnCcs+d9ohCj9mUTD1ZSt3LYjG1tJI1uqEoPi16smd84KSUQ
Q8QqYauYarotF+JityGBII3RqpY1GlH5xWYFauE/t5KVPaf8tOueYwbm9FehOWuq
ZKDzmuNkDnJfLRcz7ovEMJk0wrk6mwTjIYKhnrZiPDj9vGyR7ZfrRC0yZDjYgwaG
p9vDZkFwTbPeQUrE1BJOo4N/h2HNoNB0b2ojpvgm52PnlvYvQEyWJxVaLg==
=FsnW
-END PGP SIGNATURE-



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

2020-05-27 Thread stardiviner

I attached the patch.

I think this feature will be helpful for use who archive web page data usually
like me. To be more portable, I also added an defcustom option for other
external command. And use an if condition to detect whether external command
available, else warning user.

-- 
[ 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
  
From fcf78b5a5447ae81479e7839df001da659ede5e3 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Wed, 27 May 2020 17:42:24 +0800
Subject: [PATCH] * org-attach.el: add a new command to offline save web page

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

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

* lisp/org-attach.el (org-attach-offline-url-with-monolith): A command
invoke external command "monolith" to offline save web page.
---
 lisp/org-attach.el | 26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 57d1360fc..0d13e0da1 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-offline
+ "Attach an offline version of web page URL (use monolith).")
 ((?b) org-attach-buffer
  "Select a buffer and attach its contents to the task.")
 ((?n ?\C-n) org-attach-new
@@ -467,6 +469,27 @@ (defun org-attach-url (url)
   (let ((org-attach-method 'url))
 (org-attach-attach url)))
 
+(defun org-attach-url-offline (url)
+  (interactive "MURL of the web page be offline to attach: \n")
+  (let ((org-attach-method 'offline))
+(org-attach-attach url)))
+
+(defcustom org-attach-url-offline-command (executable-find "monolith")
+  "The command used to offline save web page."
+  :type 'string
+  :safe #'stringp
+  :group 'org-attach)
+
+(defun org-attach-offline-url-with-monolith (url target-file)
+  "Save an offline archive of web page with monolith."
+  (if org-attach-url-offline-command
+  (make-process
+   :name "org-attach-offline"
+   :command (list org-attach-url-offline-command url "-o" target-file)
+   :sentinel (lambda (proc event) (message "org-attach-offline finished!"))
+   :buffer "*org-attach-offline*")
+(warn "You must have a command availble for offline save web page!\n Set variable `org-attach-url-offline-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 +527,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))
+   ((eq method 'offline) (org-attach-offline-url-with-monolith file attach-file)))
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
-- 
2.26.2



signature.asc
Description: PGP signature


Re: (almost a patch) Receiving more output from a Common Lisp evaluation in Org buffer

2020-05-24 Thread stardiviner
 to embrace full potential of Org
> features and implement multi-block results as default for Common Lisp
> evaluation in Org, like in the following example:
>
> #+begin_src lisp
> (progn (time 0) (ignore-errors (/ 1 0)) (princ "wow") t)
> #+end_src
>
> #+RESULTS:
> #+begin_values lisp
> T
> #+end_values
> #+begin_errors lisp
> ; in: LET ((*DEFAULT-PATHNAME-DEFAULTS* #P"/home/akater/"))
> ; (/ 1 0)
> ; 
> ; caught STYLE-WARNING:
> ;   Lisp error during constant folding:
> ;   arithmetic error DIVISION-BY-ZERO signalled
> ;   Operation was (/ 1 0).
> ; 
> ; compilation unit finished
> ;   caught 1 STYLE-WARNING condition
> #+end_errors
> #+begin_trace lisp
> Evaluation took:
>   0.000 seconds of real time
>   0.03 seconds of total run time (0.03 user, 0.00 system)
>   100.00% CPU
>   476 processor cycles
>   0 bytes consed
>   
>
> #+end_trace
> #+begin_output
> wow
> #+end_output
>

I have some considering. Multi-block return might will cause other options hard
to handle the result block. For example ~:cache~, ~:results replace~, and use 
result
as source block input data. WDYT?

> while simply hiding empty blocks, if any, for convenience.
>
> Note that currently, when “output” is specified, “values” is simply
> lost, and vice versa. Implementing multi-block results would fix this
> shortcoming too.
>
> However, I did not try to implement this yet.
>
> * Conclusion
> How do we sync with SLIME if you're OK with this? How do we treat the
> case of vcs Org + stable SLIME?

Might on Org Mode side, add an function to detect SLIME output, or SLIME version
to make sure ~:results trace~ is usable. If not, warn user to update SLIME. 
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
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7LD5oUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOfywgApWgakIbbyqXschl80ynG/4feY+CN
dE2M+65SG3PKwO41DpfAo85n8JKSRqODYPzxRZSWU6nX1su/q7+e3sxkXN/WEIHW
Di47Xbq5G9OgBT+Hs9lK5sGHrvL2c7RfPnXi8WNhyPriMrRBQc35n4ZG6OyVpnOG
Q3o+RZdcDN3Jyxpp1w0iPzpfx0m6Qh7NGdfg9Gqb+uuKgCH+Nqixy/Oy/yYxdvwZ
wLgZWqdwu4kV7LUNEf/nqLmQm2K74v5N9+Ysa1ChaQFpfBADbXIDCyZhV2Qqw0QJ
6FnmL0xM1Ajs9yvPe0ilb6UV1bvGCkCMcLPQ9lcr7qs4xju49SpFH0q45Q==
=Ug7d
-END PGP SIGNATURE-



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

2020-05-24 Thread stardiviner

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.

It's not the URL file size problem, sometime network is bad. I meet some
situations like downloading 1M file might use 5 minutes. Not 1M file or 1G file
difference.

>
>> 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.)

Aha, I forgot the patch. I attached now. The patch does not provide an async
function to download. Just provide an easy way for user to use other async
functions.

>
> 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)?

Actually I did check out url-copy-file-synchronously source code, try to mimic
an async version function. But seems I can't implement it. I will post an email
to Emacs-dev mailing list whether this can be improved.

>
> Until Emacs has a function to copy a URL's contents asynchronously,
> I'd rather not add this functionality in Org.

Emacs async functionality is always bad. Waiting for Emacs get better async
support might need a very long time.

I still think simply provide an simple entry for user to change downloading
function is a simpler option. 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
  
From 61e26e148e68deb03f26dddb2a88beae5b6869f7 Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Wed, 29 Apr 2020 21:38:34 +0800
Subject: [PATCH] lisp/org-attach.el: support custom url file downloading
 function

lisp/org-attach.el (org-attach-url-function): make download function as
a defcustom option. So that user can use async function or other
functions instead.
---
 lisp/org-attach.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 57d1360fc..e33551f40 100644
--- a/lisp/org-attach.el
+++ b/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
@@ -504,7 +510,7 @@ (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) (apply org-attach-url-function file (list attach-file
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
-- 
2.26.2



signature.asc
Description: PGP signature


Re: Improving Org Mode for VSCode - Thinking Aloud

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


Bastien  writes:

> Hi,
>
> stardiviner  writes:
>
>> And I really don't think suggesting improvement of Org Mode on VS Code is an
>> good idea here.
>
> This list is both about Org as a set of tools for GNU Emacs and Org as
> a text format used for .org files.
>
> So any topic that is relevant to either Org as an Emacs mode or Org as
> a text format is relevant here.
>
> This also mean that, yes, our focus is not on discussing how the org
> format is supported on *any* tools.  I don't think we should forbid
> such discussions, it's just that they will be more effective when
> brought on these other tools forums.

Sounds reasonable.

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7KaxYUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNxhwgAlacQmq8LfixBW8PN2fFqXsD/Hmw2
TwT5+8aoJKTgOtaD1q5ewzff9z3Utlt8Y+ufUJ/nUk313SuXZTEkjXt+H7FlvG+4
grskFve6OYbaY+XH2iXyHEn2lONP2ZSfvlSa+Kiww/odlwSlr5jKcj1WfKBhCWtu
XZEM2b20bgz4YrgHm+sZehKWwX8N5SLZsgnmv2O1WE4uAhBRHySGJXPJdCIg+uPY
2JzegcU590YGTwp5Qnt1H6jUA9AfIzA1xQkhUuhrWe1UVVHomECu2pY/49JC0dlj
YBXJM44r5ky5geBsul3mer6H0tmuX+Fm5h+Q/u/3NEbc4WvvsXci3mKztw==
=glLj
-END PGP SIGNATURE-



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

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


Ihor Radchenko  writes:

>> I remember I found this code on emacs.stackexchange.com website.
>>
>> I did a Google search now, I found someone indeed proposed this feature. 
>> Here is
>> the email archive:
>>
>> https://lists.gnu.org/archive/html/emacs-orgmode/2019-08/msg00013.html
>>
>> I saw this thread is stopped. Seems no patch provided. Does anyone want to 
>> implement it?
>
> See the attached.
>
> Best,
> Ihor
>

This is great. Nicolas, can you review this patch? If ok, I hope this new
feature can be added. WDYT?

>
>
> stardiviner  writes:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>>
>> John Kitchin  writes:
>>
>>> Where did you find that code?  I recall this was some kind of prototype
>>> code, and maybe it never got fully developed. I think desk was shorthand
>>> for description.
>>
>> I remember I found this code on emacs.stackexchange.com website.
>>
>> I did a Google search now, I found someone indeed proposed this feature. 
>> Here is
>> the email archive:
>>
>> https://lists.gnu.org/archive/html/emacs-orgmode/2019-08/msg00013.html
>>
>> I saw this thread is stopped. Seems no patch provided. Does anyone want to 
>> implement it?
>>
>>>
>>> On Sat, May 23, 2020 at 8:24 AM stardiviner  wrote:
>>>
>>>> -BEGIN PGP SIGNED MESSAGE-
>>>> Hash: SHA256
>>>>
>>>>
>>>> I found some examples setting org-link-parameters with ":desk", like this:
>>>>
>>>> #+begin_src emacs-lisp
>>>> (defun org-id-link-desk (link desk)
>>>>   "Description function for id: link."
>>>>   (let ((id (cadr (split-string link ":"
>>>> (org-with-point-at (org-id-find id 'marker)
>>>>   (s-join "/" (org-get-outline-path 'with-self)
>>>>
>>>> (org-link-set-parameters "id" :desk #'org-id-link-desk)
>>>> #+end_src
>>>>
>>>> But I have not found any mention in help of variable
>>>> ~org-link-parameters~. Also I
>>>> checked org mode source code by search, no matching of ":desk" found. Did
>>>> I miss
>>>> something?
>>>>
>>>> - --
>>>> [ 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-
>>>>
>>>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7JFckUHG51bWJjaGls
>>>> ZEBnbWFpbC5jb20ACgkQG13xyVromsONBggAy0z465LkTx1EYBo4GWZdObWXct8O
>>>> Fjz24HGzin/ffISIhytm0r4w5GE2Rb2/m+BwAsfHEDDvLu1mwU3HvLugXmIk0OUA
>>>> u9qRLHJ4Po1/Y1CRR0o/OHHnbTjhA/7ppljRcN0klwd6J0PDrSE3K/XOhV94xyfK
>>>> k0fUBhtQeTdW/uzx49hs14QlNQ5i6+HJWd1g/viXI+v0EIYJDV3PLwS6CFJWnvo3
>>>> Yi210RM87uKi8vWFcFP7fEW2dYDV5MRsKmQ8v9AKLcCW9+T6Zq3tI7Srxn7ZwFsQ
>>>> mFxZdLFyDlQq0M4VG0WL/epwr0f4B2SUZ3BcOEYrwv7N+7sfMN2cCWI8jQ==
>>>> =8aOD
>>>> -END PGP SIGNATURE-
>>>>
>>>> --
>>> John
>>>
>>> ---
>>> Professor John Kitchin
>>> Doherty Hall A207F
>>> Department of Chemical Engineering
>>> Carnegie Mellon University
>>> Pittsburgh, PA 15213
>>> 412-268-7803
>>> @johnkitchin
>>> http://kitchingroup.cheme.cmu.edu
>>
>>
>> - -- 
>> [ 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-
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7JtzoUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsMC4wf+Nzj7X+SDnSaYoFYWvdx/r0PtSbyJ
>> u4fmiT5TlWYJvx6+S9HVxTSmvR7QEdxWFTLU0zkVFAmuhFIehIDoQpCzunwCGKfl
>> Onn+TLwqm8UaeDS1GXs0yhRLRAgsDqM+jdd7+IKccljRonM1RVYDjFjfdXvh9U9h
>> mDU78HGL/yGg6rzlIHlzh+s0bvkM0xgmivI7zWmk1BF8PQofXcVzdGn3aWFz3rNN
>> clEgmCtOX/t7gRzn8H8Ydq+vg+J15OliNjWBRZ1Op26msaOYe+nly8tGAbfwqDgB
>> SSC4vi42vUbvVNzpjYfR6byqQ4RDxI8th66NJ6yuk0hkCnTHe69h1gQuqw==
>> =Q210
>> -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
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7KVpYUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMKtAgAn/ZdO3hWa60Rt4jvyA4xxJnWV8n4
oqva8Psq3NJNswpiruUoEOWV2OftQxe8HmyKHlAdOAnmpoIfLV21vp7YE85T8OBj
zpIOziQJdoMw/5KYImVRRZwwtpZ5nBdur90WO6vhhbhtCXnfGKBv1sQ0oXDHaxsq
TFWkt1Adqgc40xCAgSuaRoXq5k15kt4IvFYlwLfNybK57GcSxOCJUUQvfjaBPLEr
j9N6ZhgaJMHWdTPFunez1z+2XpJKI4i1W2JcOdaqT6CA5sgRFbEFUdsfIipuJi0v
Wq2O2sao7L2L/uzIKmEZavNgEWi7ohjcuKldMu65pA9gXgD6zUrmodUq+A==
=Ymys
-END PGP SIGNATURE-



Re: Replace Org's C-TAB with C-M-TAB - objection?

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


Bastien  writes:

> Hi all,
>
> C-TAB in Org is bound to `org-force-cycle-archived' to allow to cycle
> through archived subtrees.
>
> In the Emacs tab-bar mode, it is now bound to `tab-next', which needs
> to work globally.
>
> So Org's binding and tab-bar's one are in conflict, as reported here:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41325
>
> I suggest binding `org-force-cycle-archived' to C-M-TAB: any objection?
>
> Thanks,

I object this change. Emacs tab-bar is not enabled by default. When conflict,
user can customize keybinding. I don't think it's very necessary to change.

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7KVPcUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNH7gf+NdaEwp1Up/jxbebM65JcBky/Cu6I
9rFQvFOzQ/dIQDb6IpMzOqJta8AwPIXL5tXebs4Af16D8kO5fL+q/noUoxBE7IUA
CQiGlAW3HAeIPFomnkLwSubctfbORJhwmVPoKoNkVoH98eTwuAXQVORzwDpaU7/2
NasQO6KJ1VJ48v8ipXamVO/KcDIYl4zRv5inXcpsigIpXMQ1tkeNAZUB6thaH1xz
3lDy5nSBozfrDZXq8maYV+Oa5cklR6OuNN+0VHk7HBci5vlKHAuMygLXL7M2ftIZ
HkOs56aSlKwql7BzNUnkJuGx5KQVizG6cQy9ide9rjWwf5iZPn6mR8jIbg==
=JWH3
-END PGP SIGNATURE-



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

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


John Kitchin  writes:

> Where did you find that code?  I recall this was some kind of prototype
> code, and maybe it never got fully developed. I think desk was shorthand
> for description.

I remember I found this code on emacs.stackexchange.com website.

I did a Google search now, I found someone indeed proposed this feature. Here is
the email archive:

https://lists.gnu.org/archive/html/emacs-orgmode/2019-08/msg00013.html

I saw this thread is stopped. Seems no patch provided. Does anyone want to 
implement it?

>
> On Sat, May 23, 2020 at 8:24 AM stardiviner  wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>>
>> I found some examples setting org-link-parameters with ":desk", like this:
>>
>> #+begin_src emacs-lisp
>> (defun org-id-link-desk (link desk)
>>   "Description function for id: link."
>>   (let ((id (cadr (split-string link ":"
>> (org-with-point-at (org-id-find id 'marker)
>>   (s-join "/" (org-get-outline-path 'with-self)
>>
>> (org-link-set-parameters "id" :desk #'org-id-link-desk)
>> #+end_src
>>
>> But I have not found any mention in help of variable
>> ~org-link-parameters~. Also I
>> checked org mode source code by search, no matching of ":desk" found. Did
>> I miss
>> something?
>>
>> - --
>> [ 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-
>>
>> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7JFckUHG51bWJjaGls
>> ZEBnbWFpbC5jb20ACgkQG13xyVromsONBggAy0z465LkTx1EYBo4GWZdObWXct8O
>> Fjz24HGzin/ffISIhytm0r4w5GE2Rb2/m+BwAsfHEDDvLu1mwU3HvLugXmIk0OUA
>> u9qRLHJ4Po1/Y1CRR0o/OHHnbTjhA/7ppljRcN0klwd6J0PDrSE3K/XOhV94xyfK
>> k0fUBhtQeTdW/uzx49hs14QlNQ5i6+HJWd1g/viXI+v0EIYJDV3PLwS6CFJWnvo3
>> Yi210RM87uKi8vWFcFP7fEW2dYDV5MRsKmQ8v9AKLcCW9+T6Zq3tI7Srxn7ZwFsQ
>> mFxZdLFyDlQq0M4VG0WL/epwr0f4B2SUZ3BcOEYrwv7N+7sfMN2cCWI8jQ==
>> =8aOD
>> -END PGP SIGNATURE-
>>
>> --
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu


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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7JtzoUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMC4wf+Nzj7X+SDnSaYoFYWvdx/r0PtSbyJ
u4fmiT5TlWYJvx6+S9HVxTSmvR7QEdxWFTLU0zkVFAmuhFIehIDoQpCzunwCGKfl
Onn+TLwqm8UaeDS1GXs0yhRLRAgsDqM+jdd7+IKccljRonM1RVYDjFjfdXvh9U9h
mDU78HGL/yGg6rzlIHlzh+s0bvkM0xgmivI7zWmk1BF8PQofXcVzdGn3aWFz3rNN
clEgmCtOX/t7gRzn8H8Ydq+vg+J15OliNjWBRZ1Op26msaOYe+nly8tGAbfwqDgB
SSC4vi42vUbvVNzpjYfR6byqQ4RDxI8th66NJ6yuk0hkCnTHe69h1gQuqw==
=Q210
-END PGP SIGNATURE-



Re: Improving Org Mode for VSCode - Thinking Aloud

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


George Mauer  writes:

> With VSCode becoming ever-popular it seems like there might be some value
> in getting org mode working there simply as a way of promoting org as an
> excellent literate coding notebook.
>
> VSCode already has a halfway decent org-mode but it doesn’t support
> anything from Babel. I’m trying to think of relatively easy ways of adding
> that ability. Here’s a thought: Most of babel that technically works
> against the document itself, it doesn’t really need much document
> integration with the editor. So could you get it working in vscode so long
> as someone has a properly configured version of emacs installed locally?
> “Evaluate/Export/etc” would just write the document, then use emacs to run
> the appropriate commands on it and refresh the document view.

Use Emacs as backend for Org Mode Babel to run in VS Code, This sound a bit of
overthinking. Why not just use Org Mode in Emacs directly? As my personal
opinion, Org Mode is just a document format (of course it's deeply integrated
with Emacs!!) But VS Code can do it in similar way. I really suggest you think
it clearly. And help VS Code team archive this.

And I really don't think suggesting improvement of Org Mode on VS Code is an
good idea here.

Any idea welcome of course. :)

>
> Of course features like the separate editor for src blocks and
> folding #results would be nice too, but if the basics could work that would
> be a huge win for org.
>
> Any thoughts on the feasibility of 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
  
-BEGIN PGP SIGNATURE-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7JtLwUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPYtAf/btEBa1N/8/ew6EAeISdGyC8LFNCg
7fnR4AvPPeKuRfrXy9IOyKsLtgtmFKkkYeYteoRxnrpqXaZq5q+fjul3CAynzj4Y
KexofiEpLxIrqnuaBjXg7mJxkTMMEKOgPKV62ndFUER52mHtUzNccqNBfrS6nJzE
Mk66JtFyxw/2fyk/qFhv7WTSWm1xGzedqH9O14Jz9s9WdvAtVsmFjSZf05cqUbsS
OPNnHdeCxffDUInnTsnzTFPzJ4vjwugyRAV1SSCkziKqF0WMzAsdox9OkpatWcFd
WFIEp+B0VUtFmDyPvYIx7EMFgnyoRB/00OwtcI0XcT8081+yxc8zc9j5ZQ==
=KFat
-END PGP SIGNATURE-



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

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


I found some examples setting org-link-parameters with ":desk", like this:

#+begin_src emacs-lisp
(defun org-id-link-desk (link desk)
  "Description function for id: link."
  (let ((id (cadr (split-string link ":"
(org-with-point-at (org-id-find id 'marker)
  (s-join "/" (org-get-outline-path 'with-self)

(org-link-set-parameters "id" :desk #'org-id-link-desk)
#+end_src

But I have not found any mention in help of variable ~org-link-parameters~. 
Also I
checked org mode source code by search, no matching of ":desk" found. Did I miss
something?

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7JFckUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsONBggAy0z465LkTx1EYBo4GWZdObWXct8O
Fjz24HGzin/ffISIhytm0r4w5GE2Rb2/m+BwAsfHEDDvLu1mwU3HvLugXmIk0OUA
u9qRLHJ4Po1/Y1CRR0o/OHHnbTjhA/7ppljRcN0klwd6J0PDrSE3K/XOhV94xyfK
k0fUBhtQeTdW/uzx49hs14QlNQ5i6+HJWd1g/viXI+v0EIYJDV3PLwS6CFJWnvo3
Yi210RM87uKi8vWFcFP7fEW2dYDV5MRsKmQ8v9AKLcCW9+T6Zq3tI7Srxn7ZwFsQ
mFxZdLFyDlQq0M4VG0WL/epwr0f4B2SUZ3BcOEYrwv7N+7sfMN2cCWI8jQ==
=8aOD
-END PGP SIGNATURE-



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

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


Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> 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?
>
> [[#cusom]], [[*headline]], [[(coderef)]] or, simply [[target]], are
> internal links, with a special syntax. In particular, they do not go
> through the `org-link-parameters' process.
>
> We could integrate them in that variable, i.e., extract the "follow"
> function from `org-link-open', handle completion, storage, with
> dedicated functions, etc.

That's a good solution, will be simple for future links manipulation.

>
> Help welcome.

Sure, anything I can help you can say.

>
> Meanwhile, your best bet is to defadvice `org-activate-links'.

I read the function `org-activate-links' source code, I guess you mean I can
advice on the `properties' let-binding variable. Add `'display' text property,
right? I don't know how to add advice for this functionality. Do you have any
sample code for hinting? I will be much thankful.

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-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7IeYsUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNjbggAlcDuPz9vXMC62NSZYf0WRIwD0893
UTsRr8sLlVWtIQV7eZ764mDrd7uOwzNnYTcBS2MbopzLs7sBRg4i6hmqKhAJFCYf
RuNJNnWg8oNQhiOTuN7eBRMIIv7k741T5H/8F4MdzX3KvtXhjoNjFm2BUdtwtWLl
UMAbazuRaDtjY3+sPtcGkXk6ZmkNtCh3LoPMYkfeq4dGXWantvlxDO6EYoJI+Klm
mPlqKXRSsVaZLbzxqAuqrQhIZog2gq+0nla2uqKTAocdNtTvWGqtlEbMd5p/BYB3
f/YGeFfJH5FeXIiuxZuFK83sVtpf1H3jtenHWQciuj+sqKgRN9acOi+bdg==
=tMva
-END PGP SIGNATURE-



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

2020-05-21 Thread stardiviner
-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-



Re: emacs + org-mode in virtual machine/docker/...

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


John Kitchin  writes:

> Has anyone had any success in creating or using any kind of virtual machine
> that can work across platforms to run emacs+org-mode?
>

That's interesting idea I used to want to take a try with Vagrant. I saw 
Vagrant has some similar images already.

>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu


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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7GkG8UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsN8oQf8CykuY6T4lJyaUq7T0DvLeLUpqWe5
frCH4maX33hHkxluBk60SF2ySY4b2Htd28htEkND+K/ojZpWGZ27bCFjlk5cF1Ho
2ZchFdZfeyrzE9vvDwMl4Np/xNmND79+u7Pn8Rqn5ufi12kN9ukjIhZkmBnemqJX
lrLZduLSNc8nrAynD4wL4M7fVep5OGcOWs3pIZTDPQKJJtIM2cRmTF6eCKck28nW
2kldKTV3qTqNgEpVJQmZvsHGOoHa+ylFZc3hp+Fbx+FNshYi/JX6ZrGrZIz+opjG
5qOzlEKJh8h6BeGVJdD+RtMXLVgHgw8+oK52rB75IN8x8DTuNeSboWx9xg==
=99G9
-END PGP SIGNATURE-



[SOLVED] Re: How to defint functions for other org link parameters like :face :display etc?

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


John Kitchin  writes:

> Here is a real minimal example:
>
> #+BEGIN_SRC emacs-lisp
> (defun a-func (start end path bracketp)
>   (let ((d (concat "@" path)))
> (set-text-properties start end `(display ,d
>
>
> (org-link-set-parameters "alink"
>  :activate-func 'a-func)
> #+END_SRC
>
> it has some problems, and you might need to add additional cursor-sensor
> type functions to remove the properties for editing, for example. That will
> be tricky to get just right.

Yes, I added simile mechanism code. I already finished this extension. Thank you
because of mostly based on your help.

Here is the repo https://github.com/stardiviner/org-link-beautify

>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Tue, May 19, 2020 at 6:53 PM stardiviner  wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>>
>> John Kitchin  writes:
>>
>> > I don't know if :display is for that, I think it is mostly related to
>> > should a link with description only show the description, or should it be
>> > full and show link and description.
>> >
>> > You probably want the :activate option, where you could use something
>> like
>> > an overlay on the link. I don't have time to make an example for that
>> right
>> > now. the gist is you make an activate function, and you can add a
>> > text-property or overlay  display on the link. You probably need to check
>> > that the property isn't there already to avoid adding overlays on
>> > every fontification.
>> >
>> >
>> >
>> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/#org069cbfa
>> > John
>>
>> I see, let me take a try on ~:active-func~ parameter. Thanks a lot, John.
>>
>> Regards
>>
>> >
>> > ---
>> > Professor John Kitchin
>> > Doherty Hall A207F
>> > Department of Chemical Engineering
>> > Carnegie Mellon University
>> > Pittsburgh, PA 15213
>> > 412-268-7803
>> > @johnkitchin
>> > http://kitchingroup.cheme.cmu.edu
>> >
>> >
>> >
>> > On Tue, May 19, 2020 at 9:21 AM stardiviner  wrote:
>> >
>> >> -BEGIN PGP SIGNED MESSAGE-
>> >> Hash: SHA256
>> >>
>> >>
>> >> John Kitchin  writes:
>> >>
>> >> > My go to reference is
>> >> >
>> >>
>> https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
>> >>
>> >> Really thanks, John. I have read your blog article. Found most of link
>> >> parameters examples. But still confused me, I'm wandering how to define
>> a
>> >> function for link parameter ":display" to append an all-the-icons
>> unicode
>> >> icon
>> >> on link. I only found one ~:display 'full~ example in your article.
>> >>
>> >> an you show an example using a function for ~:display~? Thanks in
>> advanced.
>> >>
>> >> >
>> >> > On Tue, May 19, 2020 at 6:56 AM stardiviner 
>> wrote:
>> >> >
>> >> >> -BEGIN PGP SIGNED MESSAGE-
>> >> >> Hash: SHA256
>> >> >>
>> >> >>
>> >> >> I'm write an extension to beautify org link with colors and unicode
>> >> icons
>> >> >> for
>> >> >> better intuitive looks. But I don't know how to write those
>> functions.
>> >> >>
>> >> >> I checked out this info page ([[info:org#Adding Hyperlink
>> >> >> Types][info:org#Adding Hyperlink Types]]) of org mode.
>> >> >>
>> >> >> But have not found ~org-link-set-parameters~ other parameters code
>> >> >> examples. I
>> >> >> hope some examples can be added for the all other parameters.
>> >> >>
>> >> >> - --
>> >> >> [ stardiviner ]
>> >> >>I try to make every word tell the meaning that I want to
>> express.
>> >> >>
>> >> >>Blog: https://stardiviner.github.io/
>

Re: [Suggestion] add an API function for getting link description

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


Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> I found org link can't get link description easily.
>>
>> I googled it how to get link description. Found this solution. But it's not 
>> intuitive.
>>
>> #+begin_src emacs-lisp
>> (defun get-description-at-point ()
>>   (interactive)
>>   (let ((link (org-element-context)))
>> (message "%s" (buffer-substring (org-element-property :contents-begin 
>> link)
>> (org-element-property :contents-end 
>> link)
>> #+end_src
>>
>> Why now support this?
>>
>> #+begin_src emacs-lisp
>> (org-element-property :desc (org-element-context))
>> #+end_src
>>
>> Maybe the key ~:desc~ could be more meaningful detailed.
>
> Links with description are not leaf elements in the AST. I.e., the
> parser needs to go deeper. As any non-leaf object, as, e.g., bold, it
> has :contents-begin and :contents-end properties. Adding :desc would
> duplicate information for no good reason.

Hmm, I get the reason. Thanks for explanation.

>
> I see no problem writing an helper function once, and use it often.
>
> Besides, there are other, slightly different implementations of this
> function, e.g.,
>
>   (defun get-description-at-point-2 ()
> (and (org-at-regexp-p org-link-bracket-re) (match-string 2)))
>
> This one is fuzzier, it will get description in fake links too (e.g., in
> comments, property drawers…), but will be faster. So there is no single
> function that fits every need.
>

Good to know another faster implementation. Thankful.

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-

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7FtAMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsNQBQf/RiEZsKS5NXhcta1RGftiUYGPah4l
GQX0hrc+x/1Edm8ZGDLDXFy81LQVo1Min2dNxmEFnGqNjp8stfX6LYC5oxbt1Ye5
2FpejBGNyxvjZ/LpPwsIRr4xt3wlp2aNhoKO6VrqbLxJtxf92/Y9rccLBxNmzH7z
xBXSDqrf5xBv+NC8hPTKbvPbo2b9OcJrFkF8cyBWU3T64iMqs6+F5TdmBZwOscXB
NSu8Qha5+1QCz8pukk2iTvilzi37rdxRweOBDWvjKRmVdAQk35IoPop2Ip37OmRo
tVqOx6Cc/7n0zTyhsYN36N5CsacPlR9FagzaroZ/9Jsp5DJCwtVh4YXU8A==
=t/oC
-END PGP SIGNATURE-



Re: [Question] why my org-link-set-parameters :face function does not work?

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


John Kitchin  writes:

> On Tue, May 19, 2020 at 6:51 PM stardiviner  wrote:
>
>> I actually borrowed code from your code example, Because I want to do the
>> following:
>>
>
> Where did you find code that uses org-element-property on a link like this?
> This won’t work with org-link-set-parameters because the face function does
> not get an org-element, it gets only the path part of it.
>

Aha, I see. Thanks for point this out. I have not realized Org only pass the
path instead of whole link. I will take a note of this in my notebook.

>> I guess the issue is on the let-binding which invoked
>> ~org-element-property~. But
>> I can't edebug this function. When I =C-u C-M-x= set edebug on the
>> function, and
>> toggle ~font-lock-mode~ on Org Mode buffer, this function is not entering
>> edebug.
>> Don't know how to make Emacs enter this function edebug status.
>>
>
> I don’t think you can use edebug in font lock functions. I always use the
> old fashioned (message “%s” thing-i-want-to-see) approach.
>
> Maybe there is some fancy way to do it, e.g. font-lock-studio, but I don’t
> do it often enough to be fluent in fancy things!
>

Seems this is the way to debug it. Thanks again. :)

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7Fs28UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsM9Uwf/UIxjUkz5aVau8SJEp0DgonNxyYab
lEWns2iyz4F89rY3i0CMjt3T7HR7VMdgEHLZFtDwvQPda6vqD/4wLzQdWikirXjA
F7hl+CWop0lQW2VPPswatFuHyJd/WOsqR541bnv6Mwlk0/rO/OrRV6FOzoDqCeEW
2IsjZufigeNpn7xxiuU0T8JmvGQF1TLl3aYdEzDaq/RZleFVwoy1lFwEir4aENj1
FTumDx39STgIQujtuQa8QdiBg6F88RS5m1yAoVZY0EXYWnGXl8OFAfRYb8gLvGV9
v5eCdELIeSPc2ADWEb4Snm2C4uuk7CBkBWJzpdtZ/5ylgTZL8O/pwbdRsg==
=fzCV
-END PGP SIGNATURE-



[Suggestion] add an API function for getting link description

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


I found org link can't get link description easily.

I googled it how to get link description. Found this solution. But it's not 
intuitive.

#+begin_src emacs-lisp
(defun get-description-at-point ()
  (interactive)
  (let ((link (org-element-context)))
(message "%s" (buffer-substring (org-element-property :contents-begin link)
(org-element-property :contents-end 
link)
#+end_src

Why now support this?

#+begin_src emacs-lisp
(org-element-property :desc (org-element-context))
#+end_src

Maybe the key ~:desc~ could be more meaningful detailed.

WDYT? Nicolas

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7E++0UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPYzAgAgpAgmgYJGvQME1T+cniWWAcfLDLh
tHNrV9vmfPdmtKtMQsLBACkmHysGBt4jsxZXPB96nhpK7vc0Vo7WPSUum7jW4M4q
GVC2bj9+gb/ZS4dYXnSHxzHTz62c5NRLHAj6jSuHow1cAtkuE/J5yT7M4ziECo4P
NnSuOZaBpHdAfWLFfkQYM4PG0Nrawfe+fy5BTqthXLchExtvMAD2tdgOrI4fxaIV
wfptEog/l6fzNfwpEW9XUUqaxqlFFPoN1GBVS3nPEuW/tInaOJgINL0giEN0ZSa6
P5czGgE9Zsdolw+v96rgqiInH3zRDFLDV8DiVrYxYig2wJ+xg0He2h6HNQ==
=44DQ
-END PGP SIGNATURE-



  1   2   3   4   5   6   >