将剪贴板上的图像粘贴到Emacs Org模式文件而不保存 [英] Paste an image on clipboard to Emacs Org mode file without saving it

查看:116
本文介绍了将剪贴板上的图像粘贴到Emacs Org模式文件而不保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Emacs Org模式作为研究日志时,有时我想通过屏幕快照图像跟踪某些事情,而我绝对不想保存它们。因此,我想知道是否有任何方法可以将这些图形插入到组织模式文件中,例如用单词从剪贴板中对其进行处理?

As I'm using the Emacs Org mode as a research log, sometime I want to keep track of something via screenshot images, and I definitely don't want to save them. So I'm wondering is there any way to insert those figures into my org mode file, like with word coping them from clipboard?

推荐答案

所需的确切功能目前尚未实现,但我对将大量图像保存到研究日志中表示怀疑如果您的意见是您绝对不想保存它们。

The exact functionality you want isn't currently implemented, but I would be skeptical of saving lots of images into a research log if your opinion is that you "definitely don't want to save them."

无论如何,组织模式邮件列表中已经表达了您想要的功能,最近几年的时间-检查

Anyways, the functionality you desire has been expressed in the org-mode mailing list a couple of times in recent years - check

http:// comments.gmane.org/gmane.emacs.orgmode/33770

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg50862.html

第一个链接包含一些代码,以启动屏幕快照实用程序(通过ImageMagick)以[唯一地]保存文件并在组织模式缓冲区中插入内联链接。

The first link includes some code to launch a screenshot utility (via ImageMagick) to [uniquely] save the file and insert an inline link in your org-mode buffer.

如该线程中所述,对代码进行了改进并添加到了org-mode hacks页面-该页面包含许多有用的gem s:

As stated in that thread, the code was improved upon and added to org-mode hacks page - which has lots of useful gems:

http://orgmode.org/worg/org -hacks.html

(defun my-org-screenshot ()
  "Take a screenshot into a time stamped unique-named file in the
same directory as the org-buffer and insert a link to this file."
  (interactive)
  (setq filename
        (concat
         (make-temp-name
          (concat (buffer-file-name)
                  "_"
                  (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
  (call-process "import" nil nil nil filename)
  (insert (concat "[[" filename "]]"))
  (org-display-inline-images))

这篇关于将剪贴板上的图像粘贴到Emacs Org模式文件而不保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆