all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mailrc
@ 2021-12-01  0:22 Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; only message in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-12-01  0:22 UTC (permalink / raw)
  To: help-gnu-emacs

;;; -*- lexical-binding: t -*-
;;;
;;; this file:
;;;   http://user.it.uu.se/~embe8573/emacs-init/gnus/mailrc.el
;;;   https://dataswamp.org/~incal/emacs-init/gnus/mailrc.el

(require 'cl-lib)
(require 'subr-x)

(defun mailrc-read-name ()
  (save-excursion
    (goto-char (point-at-bol))
    (let*((peol (point-at-eol))
          (beg  (search-forward "\"" peol t))
          (end  (search-forward "<"  peol t)))
      (when (and beg end)
        (string-trim
         (buffer-substring-no-properties beg (1- end)) )))))

(defun mailrc-read-mail ()
  (save-excursion
    (goto-char (point-at-bol))
    (let*((peol (point-at-eol))
          (beg  (search-forward "<" peol t))
          (end  (search-forward ">" peol t)))
      (when (and beg end)
        (string-trim
         (buffer-substring-no-properties beg (1- end)) )))))

(let ((mailrc-all-mails '()))
  (defun parse-mailrc-line ()
    (let*((name  (mailrc-read-name))
          (mail  (mailrc-read-mail))
          (entry (and name mail (list name mail))) )
      (when entry
        (push entry mailrc-all-mails) )))
  (declare-function parse-mailrc-line nil)

  (defun parse-mailrc-file ()
    (interactive)
    (save-excursion
      (goto-char (point-min))
      (cl-loop while (zerop (forward-line 1))
               do (parse-mailrc-line) ))
    mailrc-all-mails)
  (declare-function parse-mailrc-file nil) )

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-01  0:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-01  0:22 mailrc Emanuel Berg via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.