emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* 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  8:20 Liu Hui
  2023-10-01 14:28 ` Visuwesh
  0 siblings, 1 reply; 49+ messages in thread
From: Liu Hui @ 2023-09-29  8:20 UTC (permalink / raw)
  To: Visuwesh, Ihor Radchenko; +Cc: Max Nikulin, emacs-orgmode

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 attach method to use when DND action is unspecified.
> +This attach method is used when the DND action is `private'.
> +This is also used when `org-yank-image-save-type' is nil.
> +When nil, use `org-attach-method'."

I think the dnd feature should not be restricted to org-attach. I have
often used it for opening file and inserting file link. How about
supporting them and adding a new variable, such as
org-dnd-default-method?

> +                   ('ask (caddr (org-mks
> +                                 '(("c" "Copy" cp)
> +                                   ("m" "Move" mv)
> +                                   ("l" "Hard link" ln)
> +                                   ("s" "Symbolic link" lns))
> +                                 "How to attach?"
> +                                 "Attach using method")))

It is better to pop up a menu that allows users to proceed with the
mouse, e.g. that in `dired-dnd-do-ask-action'. Options like
'open'/'file link' could be added too.

Thanks for your work.


^ permalink raw reply	[flat|nested] 49+ messages in thread
* 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 14:24 Liu Hui
  2023-10-11 15:36 ` Visuwesh
  0 siblings, 1 reply; 49+ messages in thread
From: Liu Hui @ 2023-10-11 14:24 UTC (permalink / raw)
  To: Visuwesh; +Cc: emacs-orgmode, Ihor Radchenko

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 consistent with org-insert-link.

> + (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
inconvenient compared with a menu popped up just at the mouse
location. How about using x-popup-menu?


^ permalink raw reply	[flat|nested] 49+ messages in thread
[parent not found: <87bkdccihf.fsf.ref@yahoo.com>]

end of thread, other threads:[~2023-12-10 15:05 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-29  8:20 [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)] Liu Hui
2023-10-01 14:28 ` Visuwesh
2023-10-02  0:28   ` Liu Hui
  -- strict thread matches above, loose matches on Subject: below --
2023-10-11 14:24 Liu Hui
2023-10-11 15:36 ` Visuwesh
2023-10-12  5:12   ` Liu Hui
     [not found] <87bkdccihf.fsf.ref@yahoo.com>
2023-09-22 14:52 ` Visuwesh
2023-09-22 16:51   ` Max Nikulin
2023-09-22 17:29     ` Visuwesh
2023-09-24  8:06       ` Max Nikulin
2023-09-23 10:28   ` Ihor Radchenko
2023-09-23 16:55     ` Visuwesh
2023-09-25 13:14       ` Visuwesh
2023-09-26 16:25         ` Max Nikulin
2023-09-27  8:33           ` Visuwesh
2023-10-07 11:56           ` Ihor Radchenko
2023-10-07 12:07         ` Ihor Radchenko
2023-10-07 12:27           ` Visuwesh
2023-10-07 12:36             ` Ihor Radchenko
2023-10-07 14:03             ` Visuwesh
2023-10-08  9:30               ` Ihor Radchenko
2023-10-08 11:21                 ` Visuwesh
2023-10-09 11:12                   ` Ihor Radchenko
2023-10-09 12:17                     ` Visuwesh
2023-10-19  7:34                       ` Visuwesh
2023-10-19  9:44                         ` Ihor Radchenko
2023-10-20  1:52                           ` Po Lu
2023-10-20  7:29                             ` Ihor Radchenko
2023-10-20  7:46                               ` Po Lu
2023-10-20  7:57                                 ` Ihor Radchenko
2023-10-20  8:29                                   ` Po Lu
2023-10-20 10:17                                   ` Visuwesh
2023-10-22  6:19                     ` Visuwesh
2023-10-23  8:58                       ` Ihor Radchenko
2023-10-23 10:12                         ` Visuwesh
2023-10-26 11:39                           ` Po Lu
2023-11-05 12:02                             ` Ihor Radchenko
2023-11-05 17:45                               ` Visuwesh
2023-12-05 13:18                               ` Visuwesh
2023-12-10 13:53                                 ` Ihor Radchenko
2023-12-10 14:47                                   ` Bastien Guerry
2023-12-10 15:07                                     ` Ihor Radchenko
2023-09-24 14:58     ` Max Nikulin
2023-09-25 14:15       ` Visuwesh
2023-09-26 10:24         ` Ihor Radchenko
2023-09-27  8:29           ` Visuwesh
2023-09-28 12:01             ` Max Nikulin
2023-09-24 14:49   ` Max Nikulin
2023-10-06  7:34   ` Po Lu

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).