all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* feature request: modify org-attach to also create new (non-text) attachments
@ 2019-07-20 21:56 Simon Campese
  2020-02-04  8:09 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Campese @ 2019-07-20 21:56 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

while in orgmode, I frequently create some handwritten notes (using
a wacom tablet and xournalpp) and attach it to the current
headline. My ad-hoc solution is the following trivial modification of
org-attach-new (only the second to last line has changed):

(defun org-attach-new-external (file)
  "Create a new attachment FILE for the current task.
The attachment is created as an Emacs buffer."
  (interactive "sCreate attachment named: ")
  (when (and org-attach-file-list-property (not org-attach-inherited))
    (org-entry-add-to-multivalued-property
     (point) org-attach-file-list-property file))
  (let ((attach-dir (org-attach-dir t)))
    (org-attach-tag)
    (call-process "~/bin/myscript.sh" nil nil nil (expand-file-name file attach-dir))
    (message "New attachment %s" file)))

Here, ~/bin/myscript.sh $FILE creates a new xopp-file $FILE by copying from
an empty template and then opens it in xournalpp. Another use case could
be audio/video recordings, for example during a meeting.

It would be nice to add this functionality directly to
org-attach by generalizing the above function
'org-attach-new-external' and associating it to the key 'N'. This
function would

1. ask the user for a filename and a program, taken from some variable,
say 'org-attach-new-external-programs-alist' which contains entries of
the form ("short_name" . "program"). Each program of this list should,
when called via 'program $filename', create a file $filename in some way
(by copying from a template and then letting the user edit, starting an
audio recording etc.) 

2. build the filename, optionally using some function stored in
'org-attach-new-create-filename-function' which takes the user input as an
argument (to for example automatically insert the date, the name of the
org-headline etc.)

3. call 'program $filename' and exit


What do you think?


Best regards,

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: feature request: modify org-attach to also create new (non-text) attachments
  2019-07-20 21:56 feature request: modify org-attach to also create new (non-text) attachments Simon Campese
@ 2020-02-04  8:09 ` Bastien
  2020-02-05  5:10   ` stardiviner
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2020-02-04  8:09 UTC (permalink / raw)
  To: Simon Campese; +Cc: emacs-orgmode

Hi Simon,

Simon Campese <emacs-orgmode@campese.de> writes:

> while in orgmode, I frequently create some handwritten notes (using
> a wacom tablet and xournalpp) and attach it to the current
> headline. My ad-hoc solution is the following trivial modification of
> org-attach-new (only the second to last line has changed):

if this is still relevant, can you send a patch against org-attach.el
from the master branch?

See https://orgmode.org/worg/org-contribute.html on how to contribute.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: feature request: modify org-attach to also create new (non-text) attachments
  2020-02-04  8:09 ` Bastien
@ 2020-02-05  5:10   ` stardiviner
  0 siblings, 0 replies; 3+ messages in thread
From: stardiviner @ 2020-02-05  5:10 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Simon Campese


Bastien <bzg@gnu.org> writes:

> Hi Simon,
>
> Simon Campese <emacs-orgmode@campese.de> writes:
>
>> while in orgmode, I frequently create some handwritten notes (using
>> a wacom tablet and xournalpp) and attach it to the current
>> headline. My ad-hoc solution is the following trivial modification of
>> org-attach-new (only the second to last line has changed):
>
> if this is still relevant, can you send a patch against org-attach.el
> from the master branch?
>
> See https://orgmode.org/worg/org-contribute.html on how to contribute.
>
> Thanks,

Agreed, I like this method. I have this needs too. Hope this can be added into org-attach. Simon :)

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-05  5:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-20 21:56 feature request: modify org-attach to also create new (non-text) attachments Simon Campese
2020-02-04  8:09 ` Bastien
2020-02-05  5:10   ` stardiviner

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.