Mercurial > emacs
changeset 111054:779cd575396a
Merge changes made in Gnus trunk.
gnus.texi (Customizing the IMAP Connection): The port strings are strings.
nnmairix.el (nnmairix-summary-mode-hook): Move nnmairix's `$' command to `G G' to avoid collisions.
shr.el (shr-parse-style, shr-tag-span): New functions.
nndoc.el (nndoc-type-alist): Add git support.
(nndoc-git-type-p, nndoc-transform-git-article, nndoc-transform-git-headers): New functions.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Tue, 19 Oct 2010 22:20:47 +0000 |
parents | b5730f66fbf4 |
children | 982259aceabb |
files | doc/misc/gnus.texi lisp/gnus/ChangeLog lisp/gnus/nndoc.el lisp/gnus/nnmairix.el lisp/gnus/shr.el |
diffstat | 5 files changed, 70 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/misc/gnus.texi Tue Oct 19 20:45:42 2010 +0000 +++ b/doc/misc/gnus.texi Tue Oct 19 22:20:47 2010 +0000 @@ -14872,7 +14872,7 @@ @item nnimap-server-port If the server uses a non-standard port, that can be specified here. A -typical port would be @samp{imap} or @samp{imaps}. +typical port would be @code{"imap"} or @code{"imaps"}. @item nnimap-stream How @code{nnimap} should connect to the server. Possible values are:
--- a/lisp/gnus/ChangeLog Tue Oct 19 20:45:42 2010 +0000 +++ b/lisp/gnus/ChangeLog Tue Oct 19 22:20:47 2010 +0000 @@ -1,3 +1,16 @@ +2010-10-19 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * nndoc.el (nndoc-type-alist): Add git support. + (nndoc-git-type-p): New function. + (nndoc-transform-git-article): Ditto. + (nndoc-transform-git-headers): Ditto. + + * shr.el (shr-parse-style): New function. + (shr-tag-span): Ditto. + + * nnmairix.el (nnmairix-summary-mode-hook): Move nnmairix's `$' command + to `G G' to avoid collisions. + 2010-10-19 Katsumi Yamaoka <yamaoka@jpl.org> * shr.el: Load kinsoku if necessary.
--- a/lisp/gnus/nndoc.el Tue Oct 19 20:45:42 2010 +0000 +++ b/lisp/gnus/nndoc.el Tue Oct 19 22:20:47 2010 +0000 @@ -138,6 +138,14 @@ (generate-head-function . nndoc-generate-lanl-gov-head) (article-transform-function . nndoc-transform-lanl-gov-announce) (subtype preprints guess)) + (git + (file-begin . "\n- Log ---.*") + (article-begin . "^commit ") + (head-begin . "^Author: ") + (body-begin . "^$") + (file-end . "\n-----------------------------------------------------------------------") + (article-transform-function . nndoc-transform-git-article) + (header-transform-function . nndoc-transform-git-headers)) (rfc822-forward (article-begin . "^\n+") (body-end-function . nndoc-rfc822-forward-body-end-function) @@ -193,6 +201,7 @@ (defvoo nndoc-prepare-body-function nil) (defvoo nndoc-generate-head-function nil) (defvoo nndoc-article-transform-function nil) +(defvoo nndoc-header-transform-function nil) (defvoo nndoc-article-begin-function nil) (defvoo nndoc-generate-article-function nil) (defvoo nndoc-dissection-function nil) @@ -234,6 +243,8 @@ (insert (format "Lines: %d\n" (nth 4 entry))) (insert ".\n"))) + (when nndoc-header-transform-function + (funcall nndoc-header-transform-function)) (nnheader-fold-continuation-lines) 'headers))))) @@ -373,6 +384,7 @@ nndoc-file-end nndoc-article-begin nndoc-body-begin nndoc-body-end-function nndoc-body-end nndoc-prepare-body-function nndoc-article-transform-function + nndoc-header-transform-function nndoc-generate-head-function nndoc-body-begin-function nndoc-head-begin-function nndoc-generate-article-function @@ -649,6 +661,21 @@ (defun nndoc-slack-digest-type-p () 0) +(defun nndoc-git-type-p () + (and (search-forward "\n- Log ---" nil t) + (search-forward "\ncommit " nil t) + (search-forward "\nAuthor: " nil t))) + +(defun nndoc-transform-git-article (article) + (goto-char (point-min)) + (when (re-search-forward "^Author: " nil t) + (replace-match "From: " t t))) + +(defun nndoc-transform-git-headers () + (goto-char (point-min)) + (while (re-search-forward "^Author: " nil t) + (replace-match "From: " t t))) + (defun nndoc-lanl-gov-announce-type-p () (when (let ((case-fold-search nil)) (re-search-forward "^\\\\\\\\\n\\(Paper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+\\|arXiv:\\)" nil t))
--- a/lisp/gnus/nnmairix.el Tue Oct 19 20:45:42 2010 +0000 +++ b/lisp/gnus/nnmairix.el Tue Oct 19 22:20:47 2010 +0000 @@ -188,17 +188,17 @@ (defun nnmairix-summary-mode-hook () "Nnmairix summary mode keymap." (define-key gnus-summary-mode-map - (kbd "$ t") 'nnmairix-search-thread-this-article) + (kbd "G G t") 'nnmairix-search-thread-this-article) (define-key gnus-summary-mode-map - (kbd "$ f") 'nnmairix-search-from-this-article) + (kbd "G G f") 'nnmairix-search-from-this-article) (define-key gnus-summary-mode-map - (kbd "$ m") 'nnmairix-widget-search-from-this-article) + (kbd "G G m") 'nnmairix-widget-search-from-this-article) (define-key gnus-summary-mode-map - (kbd "$ g") 'nnmairix-create-search-group-from-message) + (kbd "G G g") 'nnmairix-create-search-group-from-message) (define-key gnus-summary-mode-map - (kbd "$ o") 'nnmairix-goto-original-article) + (kbd "G G o") 'nnmairix-goto-original-article) (define-key gnus-summary-mode-map - (kbd "$ u") 'nnmairix-remove-tick-mark-original-article)) + (kbd "G G u") 'nnmairix-remove-tick-mark-original-article)) (add-hook 'gnus-group-mode-hook 'nnmairix-group-mode-hook) (add-hook 'gnus-summary-mode-hook 'nnmairix-summary-mode-hook)
--- a/lisp/gnus/shr.el Tue Oct 19 20:45:42 2010 +0000 +++ b/lisp/gnus/shr.el Tue Oct 19 22:20:47 2010 +0000 @@ -410,6 +410,29 @@ (defun shr-tag-s (cont) (shr-fontize-cont cont 'strike-through)) +(defun shr-tag-span (cont) + (let ((start (point)) + (color (cdr (assq 'color (shr-parse-style (cdr (assq :style cont))))))) + (shr-generic cont) + (when color + (let ((overlay (make-overlay start (point)))) + (overlay-put overlay 'face (cons 'foreground-color color)))))) + +(defun shr-parse-style (style) + (when style + (let ((plist nil)) + (dolist (elem (split-string style ";")) + (when elem + (setq elem (split-string elem ":")) + (when (and (car elem) + (cadr elem)) + (let ((name (replace-regexp-in-string "^ +\\| +$" "" (car elem))) + (value (replace-regexp-in-string "^ +\\| +$" "" (cadr elem)))) + (push (cons (intern name obarray) + value) + plist))))) + plist))) + (defun shr-tag-a (cont) (let ((url (cdr (assq :href cont))) (start (point))