I need to get weblinks from a buffer (http....) and put them into scratch buffer. This code partially works, but the weblinks are inserted in the same buffer.
I'm new at programming.
(defun get-weblinks () "Get weblinks from a buffer" (interactive) (let (p1 p2 url) (while (search-forward "http") (backward-char 4) (setq p1 (point)) (search-forward "jpg") (setq p2 (point)) (setq url (buffer-substring p1 p2)) (insert url "\n") )))
How can I finish the function?
Thank you for your help.