由于我使用 Emacs Org 模式作为研究日志,有时我想通过截图图像跟踪某些内容,我绝对不想保存它们。所以我想知道有什么方法可以将这些数字插入到我的组织模式文件中,就像用文字从剪贴板处理它们一样?
最佳答案
您想要的确切功能目前尚未实现,但如果您认为“绝对不想保存它们”,我会怀疑将大量图像保存到研究日志中。
无论如何,你想要的功能近年来已经在组织模式邮件列表中表达了几次 - 检查
http://comments.gmane.org/gmane.emacs.orgmode/33770
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg50862.html
第一个链接包含一些代码,用于启动屏幕截图实用程序(通过 ImageMagick)以 [唯一] 保存文件并在组织模式缓冲区中插入内联链接。
正如该线程中所述,代码经过改进并添加到 org-mode hacks 页面 - 其中有很多有用的 gem :
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 - 将剪贴板上的图像粘贴到 Emacs Org 模式文件而不保存它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17435995/