emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor'
@ 2010-05-22 14:29 David Maus
  2010-05-22 14:29 ` [PATCH] * lisp/org-w3m.el: Get text property directly, not using " David Maus
  2010-05-22 14:30 ` [PATCH] org-wl: Remove dependency on w3m " David Maus
  0 siblings, 2 replies; 6+ messages in thread
From: David Maus @ 2010-05-22 14:29 UTC (permalink / raw)
  To: emacs-orgmode

Fixes reported by David Maus in mid:87632mk4ha.wl%dmaus@ictsoc.de.

HTH
  -- David

David Maus (1):
  * lisp/org-w3m.el: Get text property directly, not using macro
    `w3m-anchor'.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] * lisp/org-w3m.el: Get text property directly, not using macro `w3m-anchor'.
  2010-05-22 14:29 [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor' David Maus
@ 2010-05-22 14:29 ` David Maus
  2010-05-22 14:30 ` [PATCH] org-wl: Remove dependency on w3m " David Maus
  1 sibling, 0 replies; 6+ messages in thread
From: David Maus @ 2010-05-22 14:29 UTC (permalink / raw)
  To: emacs-orgmode

---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor'
  2010-05-22 14:29 [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor' David Maus
  2010-05-22 14:29 ` [PATCH] * lisp/org-w3m.el: Get text property directly, not using " David Maus
@ 2010-05-22 14:30 ` David Maus
  2010-05-26 20:19   ` John Wiegley
  2010-05-26 20:21   ` John Wiegley
  1 sibling, 2 replies; 6+ messages in thread
From: David Maus @ 2010-05-22 14:30 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 201 bytes --]


Again, forgot to mention: Patch is available on

git://github.com/dmj/dmj-org-mode.git quickfix

HTH
 -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor'
  2010-05-22 14:30 ` [PATCH] org-wl: Remove dependency on w3m " David Maus
@ 2010-05-26 20:19   ` John Wiegley
  2010-05-26 20:21   ` John Wiegley
  1 sibling, 0 replies; 6+ messages in thread
From: John Wiegley @ 2010-05-26 20:19 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

David Maus <dmaus@ictsoc.ed> writes:

> Again, forgot to mention: Patch is available on

David, Can you please explain for me the rationale behind this change?

Thanks, John

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor'
  2010-05-22 14:30 ` [PATCH] org-wl: Remove dependency on w3m " David Maus
  2010-05-26 20:19   ` John Wiegley
@ 2010-05-26 20:21   ` John Wiegley
  2010-05-27  8:06     ` David Maus
  1 sibling, 1 reply; 6+ messages in thread
From: John Wiegley @ 2010-05-26 20:21 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

David Maus <dmaus@ictsoc.ed> writes:

> Again, forgot to mention: Patch is available on

David, Can you please explain for me the rationale behind this change?

Thanks, John

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor'
  2010-05-26 20:21   ` John Wiegley
@ 2010-05-27  8:06     ` David Maus
  0 siblings, 0 replies; 6+ messages in thread
From: David Maus @ 2010-05-27  8:06 UTC (permalink / raw)
  To: John Wiegley; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 766 bytes --]

John Wiegley wrote:
>David Maus <dmaus@ictsoc.ed> writes:

>> Again, forgot to mention: Patch is available on

>David, Can you please explain for me the rationale behind this change?

Sure: The problem is, that `w3m-anchor' is not a function, but a
macro.  So it must be present when byte compiling org-w3m.el to be
properly expanded.  Declaring it an external function via
`declare-function' shuts up the byte compiler but seems to place a
function call into the byte compiled code that fails in runtime
because `w3m-anchor' isn't a function.

This results in error when using byte compiled Org mode.[1]

HTH
  -- David

[1] http://article.gmane.org/gmane.emacs.orgmode/25348
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-27 19:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-22 14:29 [PATCH] org-wl: Remove dependency on w3m macro `w3m-anchor' David Maus
2010-05-22 14:29 ` [PATCH] * lisp/org-w3m.el: Get text property directly, not using " David Maus
2010-05-22 14:30 ` [PATCH] org-wl: Remove dependency on w3m " David Maus
2010-05-26 20:19   ` John Wiegley
2010-05-26 20:21   ` John Wiegley
2010-05-27  8:06     ` David Maus

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).