emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-eww.el: Fix org-store-link for eww-mode
Date: Wed, 26 Nov 2014 11:12:36 +0100	[thread overview]
Message-ID: <84d28a2ru3.fsf@tm6592.fritz.box> (raw)

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

Hello!

Find a small fix to keep up with the eww evolvement.

I'll try to push the patch immediately since it is so small, resides in
contrib and already helps me.


But of course any comments are welcome, as always, thanks.
-- 
http://www.wahlzone.de
GPG: 0x49010A040A3AE6F2

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1246 bytes --]

From 00500afb8ced99ccaf9334ca183bc572bb6ae29a Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahlsoft@gmail.com>
Date: Wed, 26 Nov 2014 10:38:43 +0100
Subject: [PATCH] org-eww.el: Fix org-store-link for eww-mode

* contrib/lisp/org-eww.el (org-eww-store-link): Depending on the Emacs
  version use the appropriate interface to store the url of an
  eww-mode buffer.

This patch fixes the org-store-link feature for eww-mode buffers for
Emacs 25.
---
 contrib/lisp/org-eww.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-eww.el b/contrib/lisp/org-eww.el
index 26a1e09..08dac11 100644
--- a/contrib/lisp/org-eww.el
+++ b/contrib/lisp/org-eww.el
@@ -54,9 +54,14 @@
   (when (eq major-mode 'eww-mode)
     (org-store-link-props
      :type "eww"
-     :link eww-current-url
+     :link (if (< emacs-major-version 25)
+	       eww-current-url
+	     (eww-current-url))
      :url (url-view-url t)
-     :description (or eww-current-title eww-current-url))))
+     :description (if (< emacs-major-version 25)
+		      (or eww-current-title eww-current-url)
+		    (or (plist-get eww-data :title)
+			  (eww-current-url))))))
 
 \f
 ;; Some auxiliary functions concerning links in eww buffers
-- 
2.1.3


             reply	other threads:[~2014-11-26 10:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 10:12 Marco Wahl [this message]
2014-12-01 13:38 ` [PATCH] org-eww.el: Fix org-store-link for eww-mode Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84d28a2ru3.fsf@tm6592.fritz.box \
    --to=marcowahlsoft@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).