diff options
author | Sebastien Delafond <seb@debian.org> | 2013-08-11 16:27:56 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
commit | 53b246b7d66bfa03ab9bcf47d4647913b401e3d6 (patch) | |
tree | b5ea4e732c2219456d13048feb05b37b22a76391 /lisp/org-w3m.el | |
parent | 8606e2621fc00fd8b334a06924aeef3aab7a2e4d (diff) | |
parent | e32a45ed36d6000db4b39171149072d11b77af72 (diff) |
Imported Debian patch 8.0.7-1
Diffstat (limited to 'lisp/org-w3m.el')
-rw-r--r-- | lisp/org-w3m.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/org-w3m.el b/lisp/org-w3m.el index bad2003..a2f2916 100644 --- a/lisp/org-w3m.el +++ b/lisp/org-w3m.el @@ -1,6 +1,6 @@ ;;; org-w3m.el --- Support from copy and paste from w3m to Org-mode -;; Copyright (C) 2008-2012 Free Software Foundation, Inc. +;; Copyright (C) 2008-2013 Free Software Foundation, Inc. ;; Author: Andy Stewart <lazycat dot manatee at gmail dot com> ;; Keywords: outlines, hypermedia, calendar, wp @@ -8,12 +8,12 @@ ;; ;; This file is part of GNU Emacs. ;; -;; GNU Emacs is free software: you can redistribute it and/or modify +;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; GNU Emacs is distributed in the hope that it will be useful, +;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. @@ -43,6 +43,19 @@ (require 'org) +(defvar w3m-current-url) +(defvar w3m-current-title) + +(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 |