emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Pasting an image with org-download in org-capture buffer
@ 2022-12-08 15:12 Alexei Gilev
  2022-12-08 16:08 ` Max Nikulin
  0 siblings, 1 reply; 4+ messages in thread
From: Alexei Gilev @ 2022-12-08 15:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

<https://emacs.stackexchange.com/posts/14684/timeline>

Hi,

I'm pretty sure somebody must have come with a solution for this basic task.

I want to paste a screenshot while in org-capture buffer.

However, org-download takes saves the screenshot image in a (already
existing otherwise created) folder with the same name as the buffer the
org-capture will save the text into.

However, org-capture buffers are indirect buffers, so the buffer-file-name
is nil, so it fails.

How is it possible to tell Emacs to get this info from the org-capture
buffer rule itself? How to get this path and save the images while in the
org-capture indirect buffer?

The other solution is just to capture, and then open it and paste the
image, but that defeats the purpose of the org-capture buffer itself.

Thanks so much in advance,

A.

[-- Attachment #2: Type: text/html, Size: 8000 bytes --]

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

* Re: Pasting an image with org-download in org-capture buffer
  2022-12-08 15:12 Pasting an image with org-download in org-capture buffer Alexei Gilev
@ 2022-12-08 16:08 ` Max Nikulin
  2022-12-10 10:08   ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Max Nikulin @ 2022-12-08 16:08 UTC (permalink / raw)
  To: Alexei Gilev, emacs-orgmode

On 08/12/2022 22:12, Alexei Gilev wrote:
> 
> However, org-capture buffers are indirect buffers, so the 
> |buffer-file-name is nil, so it fails.|

Org sources are full of

     (buffer-file-name (buffer-base-buffer))

expressions. Unfortunately there are enough bugs due to direct usage of 
`buffer-file-name' as well.

You might be interested in org-attach as an alternative (I do not have a 
ready to use recipe for your particular task), but recently added 
`org--confirm-resource-safe' is affected by this kind of bugs.


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

* Re: Pasting an image with org-download in org-capture buffer
  2022-12-08 16:08 ` Max Nikulin
@ 2022-12-10 10:08   ` Ihor Radchenko
  2022-12-10 12:27     ` Max Nikulin
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2022-12-10 10:08 UTC (permalink / raw)
  To: Max Nikulin; +Cc: Alexei Gilev, emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> ... but recently added 
> `org--confirm-resource-safe' is affected by this kind of bugs.

May you elaborate?
`org--confirm-resource-safe' uses variable, not a function.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: Pasting an image with org-download in org-capture buffer
  2022-12-10 10:08   ` Ihor Radchenko
@ 2022-12-10 12:27     ` Max Nikulin
  0 siblings, 0 replies; 4+ messages in thread
From: Max Nikulin @ 2022-12-10 12:27 UTC (permalink / raw)
  To: emacs-orgmode

On 10/12/2022 17:08, Ihor Radchenko wrote:
> Max Nikulin writes:
> 
>> ... but recently added
>> `org--confirm-resource-safe' is affected by this kind of bugs.
> 
> May you elaborate?
> `org--confirm-resource-safe' uses variable, not a function.

I called `org-tree-to-inderect-buffer', switched to the created buffer 
and tried to evaluate value of the `buffer-file-name' variable. At least 
in Emacs-26.3 I get nil. I suppose, it is the reason why 
(buffer-file-name (buffer-base-buffer)) composition is used instead of 
the variable in other expressions.



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

end of thread, other threads:[~2022-12-10 12:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-08 15:12 Pasting an image with org-download in org-capture buffer Alexei Gilev
2022-12-08 16:08 ` Max Nikulin
2022-12-10 10:08   ` Ihor Radchenko
2022-12-10 12:27     ` Max Nikulin

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