[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re-search-forward always finds the same link
From: |
Christoph Conrad |
Subject: |
re-search-forward always finds the same link |
Date: |
Thu, 09 Feb 2006 09:18:53 +0100 |
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
I have written the following function. It fetches a page from the web.
In that page are links to archive pages, which should also be fetched,
and appended to the buffer. The problem: re-search-forward always
matches the same archive link, as if it would be start again from
beginning-of-buffer.
(defun advaita-all()
(interactive)
(with-temp-buffer
;; get base page
(shell-command
"lynx -dump http://advaitavedantameditations.blogspot.com/"
(current-buffer))
(let ((eob (save-excursion (end-of-buffer) (point))))
;; append to base page all archive pages that are referenced in
;; the base page
(while (re-search-forward " \\(http://.*_archive.html$\\)" eob t)
(let ((link (match-string 1)))
(save-excursion
(message (concat "Processing link: " link))
(end-of-buffer)
(shell-command (concat "lynx -dump " link) (current-buffer)))))
(write-region (point-min) (point-max) "~/Privat/advaita-all.txt"))))
Changing the two lines
;; (end-of-buffer)
;; (shell-command (concat "lynx -dump " link) (current-buffer)))))
(goto-char (point-max))
(insert (shell-command-to-string (concat "lynx -dump " link))))))
and it works.
In GNU Emacs 22.0.50.1 (i686-pc-linux-gnu)
of 2006-02-05 on brabbelbox
X server distributor `The X.Org Foundation', version 11.0.60802000
configured using `configure 'CC=gcc''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: address@hidden
locale-coding-system: iso-8859-15
default-enable-multibyte-characters: t
Major mode: Default-Major
Minor modes in effect:
partial-completion-mode: t
recentf-mode: t
minibuffer-electric-default-mode: t
auto-image-file-mode: t
erc-autojoin-mode: t
erc-button-mode: t
erc-ring-mode: t
erc-pcomplete-mode: t
erc-track-mode: t
erc-fill-mode: t
erc-netsplit-mode: t
erc-irccontrols-mode: t
erc-noncommands-mode: t
global-cwarn-mode: t
outline-minor-mode: t
delete-selection-mode: t
pc-selection-mode: t
show-paren-mode: t
icomplete-mode: t
tooltip-mode: t
auto-compression-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
unify-8859-on-decoding-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- re-search-forward always finds the same link,
Christoph Conrad <=