all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: emacs-orgmode@gnu.org
Subject: [PATCH] * lisp/org-w3m.el: Get text property directly, not using macro `w3m-anchor'.
Date: Sat, 22 May 2010 16:29:19 +0200	[thread overview]
Message-ID: <1274538559-13584-2-git-send-email-dmaus@ictsoc.de> (raw)
In-Reply-To: <1274538559-13584-1-git-send-email-dmaus@ictsoc.de>

---
 lisp/ChangeLog  |    4 ++++
 lisp/org-w3m.el |   10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8653197..b3a3529 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
 2010-05-22  David Maus  <dmaus@ictsoc.de>
 
+	* org-w3m.el (org-w3m-copy-for-org-mode)
+	(org-w3m-get-next-link-start, org-w3m-get-prev-link-start):
+	Get text property directly, not using macro `w3m-anchor'.
+
 	* org.el (org-clone-subtree-with-time-shift): Remove duplicate
 	code preparing the clone.
 
diff --git a/lisp/org-w3m.el b/lisp/org-w3m.el
index 7108794..7ae96f8 100644
--- a/lisp/org-w3m.el
+++ b/lisp/org-w3m.el
@@ -41,7 +41,7 @@
 ;;
 
 (require 'org)
-(declare-function w3m-anchor "ext:w3m-util" (position))
+
 
 (defun org-w3m-copy-for-org-mode ()
   "Copy current buffer content or active region with `org-mode' style links.
@@ -68,7 +68,7 @@ so that it can be yanked into an Org-mode buffer with links working correctly."
         ;; store current point before jump next anchor
         (setq temp-position (point))
         ;; move to next anchor when current point is not at anchor
-        (or (w3m-anchor (point)) (org-w3m-get-next-link-start))
+        (or (get-text-property (point) 'w3m-href-anchor) (org-w3m-get-next-link-start))
         (if (<= (point) transform-end)  ; if point is inside transform bound
             (progn
               ;; get content between two links.
@@ -77,7 +77,7 @@ so that it can be yanked into an Org-mode buffer with links working correctly."
                                                (buffer-substring
                                                 temp-position (point)))))
               ;; get link location at current point.
-              (setq link-location (w3m-anchor (point)))
+              (setq link-location (get-text-property (point) 'w3m-href-anchor))
               ;; get link title at current point.
               (setq link-title (buffer-substring (point)
                                                  (org-w3m-get-anchor-end)))
@@ -115,7 +115,7 @@ so that it can be yanked into an Org-mode buffer with links working correctly."
     (while (next-single-property-change (point) 'w3m-anchor-sequence)
       ;; jump to next anchor
       (goto-char (next-single-property-change (point) 'w3m-anchor-sequence))
-      (when (w3m-anchor (point))
+      (when (get-text-property (point) 'w3m-href-anchor)
         ;; return point when current is valid link
         (throw 'reach nil))))
   (point))
@@ -126,7 +126,7 @@ so that it can be yanked into an Org-mode buffer with links working correctly."
     (while (previous-single-property-change (point) 'w3m-anchor-sequence)
       ;; jump to previous anchor
       (goto-char (previous-single-property-change (point) 'w3m-anchor-sequence))
-      (when (w3m-anchor (point))
+      (when (get-text-property (point) 'w3m-href-anchor)
         ;; return point when current is valid link
         (throw 'reach nil))))
   (point))
-- 
1.7.1

  reply	other threads:[~2010-05-22 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-22 14:29 [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor' David Maus
2010-05-22 14:29 ` David Maus [this message]
2010-05-22 14:30 ` David Maus
2010-05-26 20:19   ` John Wiegley
2010-05-26 20:21   ` John Wiegley
2010-05-27  8:06     ` David Maus

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

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

  git send-email \
    --in-reply-to=1274538559-13584-2-git-send-email-dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.