aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-10-19 22:20:47 +0000
committerKatsumi Yamaoka2010-10-19 22:20:47 +0000
commit2e76c12c577989479dc497fc3afdef3e04b263a1 (patch)
treec1ccb6b7640cc926cd564a2f7e1127ecbb708578
parent7f0789c9db1b26329e22157479d449d29ea50d34 (diff)
downloademacs-2e76c12c577989479dc497fc3afdef3e04b263a1.tar.gz
emacs-2e76c12c577989479dc497fc3afdef3e04b263a1.zip
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.
-rw-r--r--doc/misc/gnus.texi2
-rw-r--r--lisp/gnus/ChangeLog13
-rw-r--r--lisp/gnus/nndoc.el27
-rw-r--r--lisp/gnus/nnmairix.el12
-rw-r--r--lisp/gnus/shr.el23
5 files changed, 70 insertions, 7 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 1a1f0d48eb9..c0b504ef5b3 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -14872,7 +14872,7 @@ The address of the server, like @samp{imap.gmail.com}.
14872 14872
14873@item nnimap-server-port 14873@item nnimap-server-port
14874If the server uses a non-standard port, that can be specified here. A 14874If the server uses a non-standard port, that can be specified here. A
14875typical port would be @samp{imap} or @samp{imaps}. 14875typical port would be @code{"imap"} or @code{"imaps"}.
14876 14876
14877@item nnimap-stream 14877@item nnimap-stream
14878How @code{nnimap} should connect to the server. Possible values are: 14878How @code{nnimap} should connect to the server. Possible values are:
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 4c77c73db1d..f05cec4dd18 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,16 @@
12010-10-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * nndoc.el (nndoc-type-alist): Add git support.
4 (nndoc-git-type-p): New function.
5 (nndoc-transform-git-article): Ditto.
6 (nndoc-transform-git-headers): Ditto.
7
8 * shr.el (shr-parse-style): New function.
9 (shr-tag-span): Ditto.
10
11 * nnmairix.el (nnmairix-summary-mode-hook): Move nnmairix's `$' command
12 to `G G' to avoid collisions.
13
12010-10-19 Katsumi Yamaoka <yamaoka@jpl.org> 142010-10-19 Katsumi Yamaoka <yamaoka@jpl.org>
2 15
3 * shr.el: Load kinsoku if necessary. 16 * shr.el: Load kinsoku if necessary.
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el
index 6c9ef1cef87..5d946f5a6ec 100644
--- a/lisp/gnus/nndoc.el
+++ b/lisp/gnus/nndoc.el
@@ -138,6 +138,14 @@ from the document.")
138 (generate-head-function . nndoc-generate-lanl-gov-head) 138 (generate-head-function . nndoc-generate-lanl-gov-head)
139 (article-transform-function . nndoc-transform-lanl-gov-announce) 139 (article-transform-function . nndoc-transform-lanl-gov-announce)
140 (subtype preprints guess)) 140 (subtype preprints guess))
141 (git
142 (file-begin . "\n- Log ---.*")
143 (article-begin . "^commit ")
144 (head-begin . "^Author: ")
145 (body-begin . "^$")
146 (file-end . "\n-----------------------------------------------------------------------")
147 (article-transform-function . nndoc-transform-git-article)
148 (header-transform-function . nndoc-transform-git-headers))
141 (rfc822-forward 149 (rfc822-forward
142 (article-begin . "^\n+") 150 (article-begin . "^\n+")
143 (body-end-function . nndoc-rfc822-forward-body-end-function) 151 (body-end-function . nndoc-rfc822-forward-body-end-function)
@@ -193,6 +201,7 @@ from the document.")
193(defvoo nndoc-prepare-body-function nil) 201(defvoo nndoc-prepare-body-function nil)
194(defvoo nndoc-generate-head-function nil) 202(defvoo nndoc-generate-head-function nil)
195(defvoo nndoc-article-transform-function nil) 203(defvoo nndoc-article-transform-function nil)
204(defvoo nndoc-header-transform-function nil)
196(defvoo nndoc-article-begin-function nil) 205(defvoo nndoc-article-begin-function nil)
197(defvoo nndoc-generate-article-function nil) 206(defvoo nndoc-generate-article-function nil)
198(defvoo nndoc-dissection-function nil) 207(defvoo nndoc-dissection-function nil)
@@ -234,6 +243,8 @@ from the document.")
234 (insert (format "Lines: %d\n" (nth 4 entry))) 243 (insert (format "Lines: %d\n" (nth 4 entry)))
235 (insert ".\n"))) 244 (insert ".\n")))
236 245
246 (when nndoc-header-transform-function
247 (funcall nndoc-header-transform-function))
237 (nnheader-fold-continuation-lines) 248 (nnheader-fold-continuation-lines)
238 'headers))))) 249 'headers)))))
239 250
@@ -373,6 +384,7 @@ from the document.")
373 nndoc-file-end nndoc-article-begin 384 nndoc-file-end nndoc-article-begin
374 nndoc-body-begin nndoc-body-end-function nndoc-body-end 385 nndoc-body-begin nndoc-body-end-function nndoc-body-end
375 nndoc-prepare-body-function nndoc-article-transform-function 386 nndoc-prepare-body-function nndoc-article-transform-function
387 nndoc-header-transform-function
376 nndoc-generate-head-function nndoc-body-begin-function 388 nndoc-generate-head-function nndoc-body-begin-function
377 nndoc-head-begin-function 389 nndoc-head-begin-function
378 nndoc-generate-article-function 390 nndoc-generate-article-function
@@ -649,6 +661,21 @@ from the document.")
649(defun nndoc-slack-digest-type-p () 661(defun nndoc-slack-digest-type-p ()
650 0) 662 0)
651 663
664(defun nndoc-git-type-p ()
665 (and (search-forward "\n- Log ---" nil t)
666 (search-forward "\ncommit " nil t)
667 (search-forward "\nAuthor: " nil t)))
668
669(defun nndoc-transform-git-article (article)
670 (goto-char (point-min))
671 (when (re-search-forward "^Author: " nil t)
672 (replace-match "From: " t t)))
673
674(defun nndoc-transform-git-headers ()
675 (goto-char (point-min))
676 (while (re-search-forward "^Author: " nil t)
677 (replace-match "From: " t t)))
678
652(defun nndoc-lanl-gov-announce-type-p () 679(defun nndoc-lanl-gov-announce-type-p ()
653 (when (let ((case-fold-search nil)) 680 (when (let ((case-fold-search nil))
654 (re-search-forward "^\\\\\\\\\n\\(Paper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+\\|arXiv:\\)" nil t)) 681 (re-search-forward "^\\\\\\\\\n\\(Paper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+\\|arXiv:\\)" nil t))
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el
index 0b7f0a40bd3..f63a860875a 100644
--- a/lisp/gnus/nnmairix.el
+++ b/lisp/gnus/nnmairix.el
@@ -188,17 +188,17 @@
188(defun nnmairix-summary-mode-hook () 188(defun nnmairix-summary-mode-hook ()
189 "Nnmairix summary mode keymap." 189 "Nnmairix summary mode keymap."
190 (define-key gnus-summary-mode-map 190 (define-key gnus-summary-mode-map
191 (kbd "$ t") 'nnmairix-search-thread-this-article) 191 (kbd "G G t") 'nnmairix-search-thread-this-article)
192 (define-key gnus-summary-mode-map 192 (define-key gnus-summary-mode-map
193 (kbd "$ f") 'nnmairix-search-from-this-article) 193 (kbd "G G f") 'nnmairix-search-from-this-article)
194 (define-key gnus-summary-mode-map 194 (define-key gnus-summary-mode-map
195 (kbd "$ m") 'nnmairix-widget-search-from-this-article) 195 (kbd "G G m") 'nnmairix-widget-search-from-this-article)
196 (define-key gnus-summary-mode-map 196 (define-key gnus-summary-mode-map
197 (kbd "$ g") 'nnmairix-create-search-group-from-message) 197 (kbd "G G g") 'nnmairix-create-search-group-from-message)
198 (define-key gnus-summary-mode-map 198 (define-key gnus-summary-mode-map
199 (kbd "$ o") 'nnmairix-goto-original-article) 199 (kbd "G G o") 'nnmairix-goto-original-article)
200 (define-key gnus-summary-mode-map 200 (define-key gnus-summary-mode-map
201 (kbd "$ u") 'nnmairix-remove-tick-mark-original-article)) 201 (kbd "G G u") 'nnmairix-remove-tick-mark-original-article))
202 202
203(add-hook 'gnus-group-mode-hook 'nnmairix-group-mode-hook) 203(add-hook 'gnus-group-mode-hook 'nnmairix-group-mode-hook)
204(add-hook 'gnus-summary-mode-hook 'nnmairix-summary-mode-hook) 204(add-hook 'gnus-summary-mode-hook 'nnmairix-summary-mode-hook)
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index d16899c14b7..e360eab9064 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -410,6 +410,29 @@ Return a string with image data."
410(defun shr-tag-s (cont) 410(defun shr-tag-s (cont)
411 (shr-fontize-cont cont 'strike-through)) 411 (shr-fontize-cont cont 'strike-through))
412 412
413(defun shr-tag-span (cont)
414 (let ((start (point))
415 (color (cdr (assq 'color (shr-parse-style (cdr (assq :style cont)))))))
416 (shr-generic cont)
417 (when color
418 (let ((overlay (make-overlay start (point))))
419 (overlay-put overlay 'face (cons 'foreground-color color))))))
420
421(defun shr-parse-style (style)
422 (when style
423 (let ((plist nil))
424 (dolist (elem (split-string style ";"))
425 (when elem
426 (setq elem (split-string elem ":"))
427 (when (and (car elem)
428 (cadr elem))
429 (let ((name (replace-regexp-in-string "^ +\\| +$" "" (car elem)))
430 (value (replace-regexp-in-string "^ +\\| +$" "" (cadr elem))))
431 (push (cons (intern name obarray)
432 value)
433 plist)))))
434 plist)))
435
413(defun shr-tag-a (cont) 436(defun shr-tag-a (cont)
414 (let ((url (cdr (assq :href cont))) 437 (let ((url (cdr (assq :href cont)))
415 (start (point)) 438 (start (point))