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

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

functions to download mailing list archives


From: GH
Subject: functions to download mailing list archives
Date: Mon, 13 Jun 2022 00:30:00 +0200

I love mailing lists,

so Im writing functions to interact with ~lists.gnu.org~ http interfaces

For example this function to download lists mbox archives:

#+begin_src elisp

(defun lists-mbox-recursive-download (url-head id date)
  "Download ID mailing lists archives as mbox files from server
URL-HEAD using a DATE filter.

URL-HEAD is the mailing list server url, example:
https://lists.gnu.org";
  (with-current-buffer "*eww*"
    (shr-next-link)
    (if (string-match (format "%s/archive/mbox/%s/%s\\(.+\\)" url-head id date)
                      (thing-at-point 'url))
        (eww-download))
    (if (save-excursion (shr-next-link))
        (lists-mbox-recursive-download url-head id date))))

#+end_src

I call that function from this another func:

#+begin_src elisp

(defun lists-load-archive (url-head id)
  (if (y-or-n-p "Load as mbox files?")
      (prog1 (eww-browse-url (format "%s/archive/mbox/%s/" url-head id))
        (if (y-or-n-p "Download archive mboxes?")
            (let ((date (read-number "Date filter: " 20))
                  (eww-download-directory (read-file-name "Download directory: 
")))
              (lists-mbox-recursive-download url-head id date))))
    (eww-browse-url (format "%s/archive/html/%s/" url-head id))))

#+end_src

test it:

(lists-load-archive "https://lists.gnu.org"; "help-gnu-emacs")


But sadly the recursion stop with this warning:

file-local-name: Lisp nesting exceeds `max-lisp-eval-depth'

any idea to fix?



reply via email to

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