org-eww.el 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ;;; org-eww.el --- Storing link in eww-mode for Org-mode
  2. ;; Copyright (C) 2014 Free Software Foundation, Inc.
  3. ;; Author: Marco Wahl <marcowahlsoft>a<gmailcom>
  4. ;; Keywords: link, eww
  5. ;; Homepage: http://orgmode.org
  6. ;;
  7. ;; This file is not part of GNU Emacs.
  8. ;;
  9. ;; This program is free software: you can redistribute it and/or modify
  10. ;; it under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation, either version 3 of the License, or
  12. ;; (at your option) any later version.
  13. ;; This program is distributed in the hope that it will be useful,
  14. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;; GNU General Public License for more details.
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  19. ;;; Commentary:
  20. ;; When this module is active `org-store-link' (often on key C-c l) in
  21. ;; a eww buffer stores a link to the current url of the eww buffer.
  22. ;; `org-eww-store-link' below is almost the same as
  23. ;; `org-w3m-store-link' of the org-w3m module.
  24. ;; Hint: There are further features in module org-w3m which might be
  25. ;; interesting for org-eww also.
  26. ;;; Code:
  27. (require 'org)
  28. (add-hook 'org-store-link-functions 'org-eww-store-link)
  29. (defun org-eww-store-link ()
  30. "Store a link to the url of a eww buffer."
  31. (when (eq major-mode 'eww-mode)
  32. (org-store-link-props
  33. :type "eww"
  34. :link eww-current-url
  35. :url (url-view-url t)
  36. :description (or eww-current-title eww-current-url))))
  37. (provide 'org-eww)
  38. ;;; org-eww.el ends here