help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: functions to download mailing list archives


From: GH
Subject: Re: functions to download mailing list archives
Date: Thu, 16 Jun 2022 14:27:59 +0200

Emanuel Berg <incal@dataswamp.org> writes:

> Uh oh, I smell trouble! And the byte compiler says ...

>   Warning: ‘beginning-of-buffer’ is for interactive use only;
>   use ‘(goto-char (point-min))’ instead.

>   Error: ‘add-to-list’ can’t use lexical var ‘url-list’; use
>   ‘push’ or ‘cl-pushnew’

> Acutally I don't know if your were lexical, anyway it should
> be so regardless of whatever ...

yes I use lexical, fixed thanks

#+begin_src elisp

;;; -*- lexical-binding: t; -*-

(defun lists-mbox-url-list (url-head id date)
  (with-current-buffer "*eww*"
    (goto-char (point-min))
    (let ((url-list '()))
      (while (save-excursion
               (text-property-search-forward 'shr-url nil nil t))
        (shr-next-link)
        (let ((url (thing-at-point 'url)))
          (if (and url
                   (string-match (format "%s/archive/mbox/%s/%s\\(.+\\)" 
url-head id date)
                                 url))
              (push url url-list))))
      url-list)))

#+end_src

> Warning: the function ‘eww-download-callback’ is not known to be
> defined.

uh? is a vanilla func

eww-download-callback is a compiled Lisp function in ‘eww.el’.

(eww-download-callback STATUS URL DIR)

> Warning: the function ‘shr-next-link’ is not known to be defined.

shr-next-link is an interactive compiled Lisp function in ‘shr.el’.

(shr-next-link)

Skip to the next link.



Now it compile without warnings for me



reply via email to

[Prev in Thread] Current Thread [Next in Thread]