Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

О сломанном mail-citation-hook в emacs-22.3

10 views
Skip to first unread message

Aleksey Cheusov

unread,
Mar 6, 2009, 5:13:27 PM3/6/09
to
Когда-то я писал сюда о сломанном сюда о сломанном
mail-citation-hook в emacs-22.3.
Чтобы исправить проблему, нужно

(setq message-cite-function 'message-cite-original)

По умолчанию в 22.3 эта переменная равна
'message-cite-original-without-signature

А вот раньше была равна 'message-cite-original

--
Best regards, Aleksey Cheusov.

Alexey Kretov

unread,
Apr 8, 2009, 9:46:42 PM4/8/09
to
Hello, Aleksey !

Прошу прощения, а вы этим фидошным квотингом emacs gnus не поделитесь?
Hигде никак не найду.

--
Best regards,
Alexey Kretov

Aleksey Cheusov

unread,
Apr 11, 2009, 5:06:44 AM4/11/09
to
AK> Hello, Aleksey !

AK> Прошу прощения, а вы этим фидошным квотингом emacs gnus не поделитесь?
AK> Hигде никак не найду.

(defun mygnus-email-to-full-name (email)
(cond ((and email (string-match "^\\s-*\"?\\(.*?\\)\"?\\s-*<[^>]+>" email))
(match-string 1 email))
((and email (string-match "(\\s-*\"?\\([^)]+?\\)\"?\\s-*)" email))
(match-string 1 email))
(t "noname")
))

(defun mygnus-full-name-to-initials (full-name)
(let ((splitted-name
(delete "" (split-string (if full-name full-name "") "\\s-+"))))
(mapconcat (lambda (s) (substring s 0 1))
(if splitted-name splitted-name "")
"")))

(defun mygnus-citation ()
(let* ((beg (point))
(end (mark t))
(from (message-fetch-reply-field "From"))
(newsgroup (message-fetch-reply-field "Newsgroups"))
(initials (mygnus-full-name-to-initials
(mygnus-email-to-full-name from)))
(initials (concat " " initials))
)
(save-excursion
(if (or (null newsgroup)
(not (string-match "fido7" newsgroup)))
(setq initials ""))
(narrow-to-region beg end)
(goto-char (point-min))
(search-forward "\n\n")
(delete-region (point-min) (point))
(while (not (eobp))
(beginning-of-line)
(unless (eolp)
(if (re-search-forward "^ *\\(\\w*\\)\\(>\\)" (point-at-eol) t)
(replace-match " \\1>\\2")
(insert initials "> ")))
(forward-line 1))
(widen))))

(setq message-cite-function 'message-cite-original)
(add-hook 'mail-citation-hook 'mygnus-citation)

0 new messages