瀏覽代碼

org-w3m.el (org-w3m-store-link): New function

* org-w3m.el (org-w3m-store-link): New function.
Bastien Guerry 12 年之前
父節點
當前提交
12fd14b858
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      lisp/org-w3m.el

+ 11 - 0
lisp/org-w3m.el

@@ -43,6 +43,17 @@
 
 (require 'org)
 
+
+(add-hook 'org-store-link-functions 'org-w3m-store-link)
+(defun org-w3m-store-link ()
+  "Store a link to a w3m buffer."
+  (when (eq major-mode 'w3m-mode)
+    (org-store-link-props
+     :type "w3m"
+     :link w3m-current-url
+     :url (url-view-url t)
+     :description (or w3m-current-title w3m-current-url))))
+
 (defun org-w3m-copy-for-org-mode ()
   "Copy current buffer content or active region with `org-mode' style links.
 This will encode `link-title' and `link-location' with