emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] FW: [RFC] Link-type for attachments, more attach options


From: Gustav Wikström
Subject: Re: [O] FW: [RFC] Link-type for attachments, more attach options
Date: Sat, 17 Nov 2018 12:13:12 +0000

Hi Ihor,

I'm not sure I follow your suggestion regarding changing the implementation. 
But anyhow I don't think the implementation is heavy and at risk of cumbersome 
code duplication. My opinion ofc 😊

I like the idea of a function that would symbolically links folders from 
"ID"-folder structure to a hierarchy-folder structure, based on the name and 
path of the org-file  and its headings containing the links. I probably 
wouldn't use it much myself though. Not until org-mode starts working better 
with multiple files, allowing us to more easily define "org-mode libraries".

/G 

> -----Original Message-----
> From: Ihor Radchenko <address@hidden>
> Sent: den 3 november 2018 04:38
> To: Gustav Wikström <address@hidden>; Marco Wahl <address@hidden>
> Cc: emacs-orgmode <address@hidden>
> Subject: Re: [O] FW: [RFC] Link-type for attachments, more attach options
> 
> Hi Gustav,
> 
> Thanks for the patch!
> I am a heavy user of org attachments, so it is pleasant that someone
> spent a time to implement this useful feature into org.
> 
> A comment regarding the code.
> Your new link types appears to reimplement some of the code for the
> "file:" links.
> Would it make more sense to implement the "attachment:" link type as
> abbreviation?
> I mean something like the code below:
> 
> ````
> (defun yant/process-att-abbrev (arg)
>   "Return `org-attach-dir' for the current entry."
>   (s-concat (org-attach-dir 'CREATE) arg))
> 
> (add-to-list 'org-link-abbrev-alist (cons "att" 
> "file:%(yant/process-att-abbrev)"))
> 
> (defun org-att-link-complete (&optional arg)
>   "Completion function for att: link."
>   (let* ((ref-dir (org-attach-dir 'CREATE))
>        (filelink (let ((default-directory ref-dir))
>                    (org-file-complete-link)))
>        (filepath (apply #'s-concat (cdr (s-split ":" filelink)))))
>     (format "att:%s" filepath)))
> 
> (org-link-set-parameters "att"
>                        :complete #'org-att-link-complete)
> ````
> 
> Also, is anyone interested in automatic placing of org attachments into
> a folder structure, which mirrors the org path?
> Something like in the following Stack Exchange question:
> https://emacs.stackexchange.com/questions/26412/human-readable-directory-tree-with-org-
> attach
> 
> Best,
> Ihor
> 
> Gustav Wikström <address@hidden> writes:
> 
> > Hi Marco,
> >
> > Nice to hear you like it! Yeah, I'm pretty happy with that functionality as 
> > well. Use it
> all the time to quickly add links to attached files.
> >
> > One use case I have for this (as an example) is for projects and tasks. I 
> > have a
> 'tasks.org' file with nodes for each of my tasks and each of my projects. 
> Usually, if the
> task is about some digital work, there are files involved with it. So I have 
> a convention
> to add folders next to the 'tasks.org' file with names like 'YYMM 
> [task/project title]',
> and attach the folder to each task/project node. C-c C-l attached RET then 
> makes it super-
> easy to refer to particular files within that folder, from within the node in 
> the
> 'tasks.org' file!
> >
> > Another use case is for my 'digital brain', where it's also fairly common 
> > for me to have
> attachment folders where I want to refer to files within them. Images for 
> example, that
> then will be displayed in the org-mode file. Haven't settled on whether I 
> should use auto-
> managed ID's for these folders, or :ATTACH_DIR: properties though. Currently 
> using a bit
> of both...
> >
> > I'm not familiar with the 'next' branch and the plans for integrating it 
> > into 'master'.
> But if 'master' is to offensive to merge into straight away, 'next' sounds 
> like a good
> option!
> >
> > Kind regards
> > Gustav
> >
> > -----Original Message-----
> > From: Marco Wahl <address@hidden>
> > Sent: den 1 november 2018 17:01
> > To: Gustav Wikström <address@hidden>
> > Subject: Re: FW: [RFC] Link-type for attachments, more attach options
> >
> > The following message is a courtesy copy of an article that has been posted 
> > to
> gmane.emacs.orgmode as well.
> >
> > Hi Gustav,
> >
> > I played a bit with your proposition.  I like it; in particular the 
> > completion function
> to insert links from the attachment directory with
> >
> >     C-c C-l attached RET
> >
> > It seems natural to me to have a more specific link type for attached files.
> >
> > In my opinion your patch should be applied to the 'next' branch.
> >
> >
> > My 2ct,
> >         Marco
> >

reply via email to

[Prev in Thread] Current Thread [Next in Thread]