Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-12-10 Thread Ihor Radchenko
Bastien Guerry writes: > Ihor Radchenko writes: > >> Before I proceed with installing it; Bastien, may you please confirm >> Visuwesh's copyright assignment status? > > Confirmed and added to Worg. Thanks Visuwesh for contributing! Thanks for checking! Applied, onto main.

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-12-10 Thread Bastien Guerry
Ihor Radchenko writes: > Before I proceed with installing it; Bastien, may you please confirm > Visuwesh's copyright assignment status? Confirmed and added to Worg. Thanks Visuwesh for contributing! -- Bastien Guerry

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-12-10 Thread Ihor Radchenko
Visuwesh writes: >> Visuwesh, do you want to update your patch accordingly? > > I have now adjusted the patch to insert a space between links when the > Emacs version in <30, and when more than one file is dropped. Thanks! I have no comments on the patch. Before I proceed with installing it;

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-12-05 Thread Visuwesh
[ஞாயிறு நவம்பர் 05, 2023] Ihor Radchenko wrote: > Po Lu writes: > >> I have now installed an interface to this end into Emacs 30. The >> pertinent documentation is under the ``Drag and Drop'' node in the Lisp >> reference manual. > > Thanks! > > [...] > > Visuwesh, do you want to update your

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-11-05 Thread Visuwesh
[ஞாயிறு நவம்பர் 05, 2023] Ihor Radchenko wrote: > Po Lu writes: > >> I have now installed an interface to this end into Emacs 30. The >> pertinent documentation is under the ``Drag and Drop'' node in the Lisp >> reference manual. > [...] > Visuwesh, do you want to update your patch accordingly?

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-11-05 Thread Ihor Radchenko
Po Lu writes: > I have now installed an interface to this end into Emacs 30. The > pertinent documentation is under the ``Drag and Drop'' node in the Lisp > reference manual. Thanks! AFAIU, the relevant paragraph is @cindex dnd-multiple-handler, a symbol property If a handler

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-26 Thread Po Lu
I have now installed an interface to this end into Emacs 30. The pertinent documentation is under the ``Drag and Drop'' node in the Lisp reference manual.

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-23 Thread Visuwesh
[திங்கள் அக்டோபர் 23, 2023] Ihor Radchenko wrote: >>> Also, we might want to add a subsection describing the new customization to >>> 17 Miscellaneous section of the manual. Otherwise, users might have >>> difficulties discovering relevant settings to customize dnd and yank >>> behavior. >> >> I

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-23 Thread Ihor Radchenko
Visuwesh writes: >> Is there any particular reason why you insert a newline after the image >> link? > > I think this can stay here until Po Lu writes the platform-agnostic code > that you requested further down this thread? Sure. >> Also, we might want to add a subsection describing the new

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-22 Thread Visuwesh
[திங்கள் அக்டோபர் 09, 2023] Ihor Radchenko wrote: > Thanks! > >> +(defun org--dnd-attach-file (url action) >> ... >> +(insert >> + (org-link-make-string >> + (concat (if separatep >> + "file:" >> +"attachment:") >> + (if separatep >> +

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-20 Thread Visuwesh
[வெள்ளி அக்டோபர் 20, 2023] Ihor Radchenko wrote: > Po Lu writes: > >>> Because nobody added you manually to the CC in this branch of the >>> discussion. You would only be automatically in the CC in the replies to >>> your message (87bkdccihf@yahoo.com), but not the earlier branches. >> >>

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-20 Thread Po Lu
Ihor Radchenko writes: > Instead of passing dnd data as is from the OS, Emacs can convert it into > a standardized format, independent of the OS. Then, > `dnd-protocol-alist' can allow handlers for such standardized dnd type. > > In our scenario, the dnd data will be dropped file list. Emacs

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-20 Thread Ihor Radchenko
Po Lu writes: >> Because nobody added you manually to the CC in this branch of the >> discussion. You would only be automatically in the CC in the replies to >> your message (87bkdccihf@yahoo.com), but not the earlier branches. > > The follow-up I mentioned lists 87bkdccihf@yahoo.com

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-20 Thread Po Lu
Ihor Radchenko writes: > Because nobody added you manually to the CC in this branch of the > discussion. You would only be automatically in the CC in the replies to > your message (87bkdccihf@yahoo.com), but not the earlier branches. The follow-up I mentioned lists 87bkdccihf@yahoo.com

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-20 Thread Ihor Radchenko
Po Lu writes: > Ihor Radchenko writes: > >> Ideally, we should ask Emacs devs to provide OS-independent interface >> for uri-list handling. I am not a big fan of adding special OS handling >> to Org mode, unless absolutely necessary. > > Inasmuch as I had previously interposed myself into this

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-19 Thread Po Lu
Ihor Radchenko writes: > Ideally, we should ask Emacs devs to provide OS-independent interface > for uri-list handling. I am not a big fan of adding special OS handling > to Org mode, unless absolutely necessary. Inasmuch as I had previously interposed myself into this conversation, it should

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-19 Thread Ihor Radchenko
Visuwesh writes: >>> Is there any particular reason why you insert a newline after the image >>> link? >> >> It is for when you drop multiple files onto a frame. AFAIU/AFAICT >> there's no way to know beforehand if multiple files will be dropped or >> not. I will look into it in bit more

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-19 Thread Visuwesh
[திங்கள் அக்டோபர் 09, 2023] Visuwesh wrote: > [திங்கள் அக்டோபர் 09, 2023] Ihor Radchenko wrote: > >> Thanks! >> >>> +(defun org--dnd-attach-file (url action) >>> ... >>> +(insert >>> + (org-link-make-string >>> + (concat (if separatep >>> + "file:" >>> +

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-11 Thread Liu Hui
Visuwesh 于2023年10月11日周三 23:36写道: > >> + (caddr (read-multiple-choice > >> + "What to do with dropped file?" > >> + '((?a "attach" attach) > >> + (?o "open" open) > >> + (?f "insert file: link" file-link > > > > The dialog box is shown in the center of frame and I find it a little > >

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-11 Thread Visuwesh
[புதன் அக்டோபர் 11, 2023] Liu Hui wrote: > Hi, > > Thanks for your work. I have two minor suggestions about the patch. > >> + (`file-link >> + (let ((filename (dnd-get-local-file-name url))) >> + (insert (org-link-make-string (concat "file:" filename > > I think it is better to abbreviate

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-11 Thread Liu Hui
Hi, Thanks for your work. I have two minor suggestions about the patch. > + (`file-link > + (let ((filename (dnd-get-local-file-name url))) > + (insert (org-link-make-string (concat "file:" filename I think it is better to abbreviate the file name for file-link, so it would be

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-09 Thread Visuwesh
[திங்கள் அக்டோபர் 09, 2023] Ihor Radchenko wrote: > Thanks! > >> +(defun org--dnd-attach-file (url action) >> ... >> +(insert >> + (org-link-make-string >> + (concat (if separatep >> + "file:" >> +"attachment:") >> + (if separatep >> +

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-09 Thread Ihor Radchenko
Thanks! > +(defun org--dnd-attach-file (url action) > ... > +(insert > + (org-link-make-string > + (concat (if separatep > + "file:" > +"attachment:") > + (if separatep > + (expand-file-name (file-name-nondirectory

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-08 Thread Visuwesh
[ஞாயிறு அக்டோபர் 08, 2023] Ihor Radchenko wrote: > Visuwesh writes: > >> This was far easier than I initially thought. Patch attached. > > Thanks! > I tried to install the patch and I have two more comments. > >> +(defun org-yank-image-autogen-filename () >> + "Autogenerate filename for image

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-08 Thread Ihor Radchenko
Visuwesh writes: > This was far easier than I initially thought. Patch attached. Thanks! I tried to install the patch and I have two more comments. > +(defun org-yank-image-autogen-filename () > + "Autogenerate filename for image in clipboard." > + (format-time-string

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-07 Thread Visuwesh
[சனி அக்டோபர் 07, 2023] Visuwesh wrote: > [சனி அக்டோபர் 07, 2023] Ihor Radchenko wrote: > >> Visuwesh writes: >> >>> Attached patch considers your review and also another defcustom to tell >>> how to generate the filename which by default autogenerates a filename >>> based on current time. >> >>

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-07 Thread Ihor Radchenko
Visuwesh writes: > What do you think about adding a defcustom as requested by Liu Hui in > https://yhetil.org/orgmode/caoqtw-p6_w3heepjftkcfey2rpfgjfouhwmseoe2ajnpoi+...@mail.gmail.com/ Looks reasonable. I have no objections. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-07 Thread Visuwesh
[சனி அக்டோபர் 07, 2023] Ihor Radchenko wrote: > Visuwesh writes: > >> Attached patch considers your review and also another defcustom to tell >> how to generate the filename which by default autogenerates a filename >> based on current time. > > Thanks! > I still disagree about :safe, but I can

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-07 Thread Ihor Radchenko
Visuwesh writes: > Attached patch considers your review and also another defcustom to tell > how to generate the filename which by default autogenerates a filename > based on current time. Thanks! I still disagree about :safe, but I can change it myself to something more restrictive like :safe

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-07 Thread Ihor Radchenko
Max Nikulin writes: > ... Current action is to open text files in the > widow under cursor and it is what users may expect. This is not always true. For example, dropping to dired buffers will copy to the opened fired directory. Dropping to message buffers will add an attachment to the email

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-06 Thread Po Lu
Visuwesh writes: > Attached patch adds yank-media and DND handler to attach files in the > clipboard and dropped onto an Emacs frame respectively. > > The yank-media handler for images is well tested, I use it frequently > however, rest of the stuff aren't really tested since I don't use a GUI

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-01 Thread Liu Hui
Visuwesh 于2023年10月1日周日 22:28写道: > Do you think asking during the time of drop > would be a viable option too? I'm thinking of adding the defcustom > org-dnd-default-method with options such as > > . attach -- as implemented here > . open -- open file > . file-link -- insert file

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-10-01 Thread Visuwesh
[வெள்ளி செப்டம்பர் 29, 2023] Liu Hui wrote: > Hi, > > 在 2023/9/27 16:29, Visuwesh 写道: > >> +*** Files and images can be attached by dropping onto Emacs >> + >> +Attachment method other than ~org-attach-method~ for dropped files can >> +be specified using ~org-dnd-default-attach-method~. > >>

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-29 Thread Liu Hui
Hi, 在 2023/9/27 16:29, Visuwesh 写道: > +*** Files and images can be attached by dropping onto Emacs > + > +Attachment method other than ~org-attach-method~ for dropped files can > +be specified using ~org-dnd-default-attach-method~. > +(defcustom org-dnd-default-attach-method nil > + "Default

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-28 Thread Max Nikulin
On 27/09/2023 15:29, Visuwesh wrote: Ihor Radchenko wrote: We can just say :safe nil (omit the keyword). Then, users will be >> prompted and can decide which directories are truly safe for them.> That would be quite annoying IMO. I say we let the user shoot> themselves in the foot. The patch

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-27 Thread Visuwesh
[செவ்வாய் செப்டம்பர் 26, 2023] Max Nikulin wrote: > On 25/09/2023 20:14, Visuwesh wrote: >> + (setq-local dnd-protocol-alist >> + (cons '("^file:///" . org--dnd-local-file-handler) >> +dnd-protocol-alist)) > > Does it mean that `org--dnd-local-file-handler' is

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-27 Thread Visuwesh
[செவ்வாய் செப்டம்பர் 26, 2023] Ihor Radchenko wrote: > Visuwesh writes: > >>> Please, use `make-temp-file' to create files in the temporary >>> directory that may be world writable. Predictable file names there are >>> undesired from security point of view. >> >> What harm does it cause? > >

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-26 Thread Max Nikulin
On 25/09/2023 20:14, Visuwesh wrote: + (setq-local dnd-protocol-alist + (cons '("^file:///" . org--dnd-local-file-handler) +dnd-protocol-alist)) Does it mean that `org--dnd-local-file-handler' is unconditionally called for Org buffers? Current action is to

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-26 Thread Ihor Radchenko
Visuwesh writes: >> Please, use `make-temp-file' to create files in the temporary >> directory that may be world writable. Predictable file names there are >> undesired from security point of view. > > What harm does it cause? /tmp directory can be written by any program and the file, while

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-25 Thread Visuwesh
[ Please keep me in the CC as I don't follow the list. ] [ஞாயிறு செப்டம்பர் 24, 2023] Max Nikulin wrote: > On 23/09/2023 17:28, Ihor Radchenko wrote: >> Visuwesh writes: >> >>> + (let* ((ext (symbol-name (mailcap-mime-type-to-extension mimetype))) >>> + (iname (read-string "Insert

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-25 Thread Visuwesh
[சனி செப்டம்பர் 23, 2023] Visuwesh wrote: >>> +(defun org--image-yank-media-handler (mimetype data) >>> + "Save image DATA of mime-type MIMETYPE and insert link at point. >>> +It is saved as per `org-media-image-save-type'. The name for the >>> +image is prompted and the extension is

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-24 Thread Max Nikulin
On 23/09/2023 17:28, Ihor Radchenko wrote: Visuwesh writes: + (let* ((ext (symbol-name (mailcap-mime-type-to-extension mimetype))) + (iname (read-string "Insert filename for image: ")) It would be nice if we auto-generate the file name here by default. It is what I would expect from

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-24 Thread Max Nikulin
On 22/09/2023 21:52, Visuwesh wrote: Attached patch adds yank-media and DND handler to attach files in the clipboard and dropped onto an Emacs frame respectively. Please, use `make-temp-file' to create files in the temporary directory that may be world writable. Predictable file names there

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-24 Thread Max Nikulin
On 23/09/2023 00:29, Visuwesh wrote: [வெள்ளி செப்டம்பர் 22, 2023] Max Nikulin wrote: When a file is dropped into an Org buffer I would consider inserting a link or storing it in addition to attachment options. The current code already inserts a link to the dropped files. I mean just insert

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-23 Thread Visuwesh
[சனி செப்டம்பர் 23, 2023] Ihor Radchenko wrote: >> +*** Images and files in clipboard can be attached >> + >> +Org can now attach images in clipboard and files copied/cut to the >> +clipboard from file managers using the ~yank-media~ command which also >> +inserts a link to the attached file. >>

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-23 Thread Ihor Radchenko
Visuwesh writes: > The patch compiles cleanly without warnings but I haven't tested _this_ > patch yet, I have these functions in my init.el and have tested those. Thanks for the patch! See my comments below. > +*** Images and files in clipboard can be attached > + > +Org can now attach images

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-22 Thread Visuwesh
[வெள்ளி செப்டம்பர் 22, 2023] Max Nikulin wrote: > On 22/09/2023 21:52, Visuwesh wrote: >> Attached patch adds yank-media and DND handler to attach files in the >> clipboard and dropped onto an Emacs frame respectively. > > Thank you for your work in this area. > > I am not an active DND user, I

Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-22 Thread Max Nikulin
On 22/09/2023 21:52, Visuwesh wrote: Attached patch adds yank-media and DND handler to attach files in the clipboard and dropped onto an Emacs frame respectively. Thank you for your work in this area. I am not an active DND user, I am just curious what cases are supported: - X11 - Wayland -

[BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)]

2023-09-22 Thread Visuwesh
Attached patch adds yank-media and DND handler to attach files in the clipboard and dropped onto an Emacs frame respectively. The yank-media handler for images is well tested, I use it frequently however, rest of the stuff aren't really tested since I don't use a GUI file manager. I tested