aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Danjou2011-02-01 23:46:27 +0000
committerKatsumi Yamaoka2011-02-01 23:46:27 +0000
commit39cde66c5e6c226586187fe13d91fd2c65eb4649 (patch)
tree664bb498045cbff062838dcb623c3062a6a5e5c0
parente8e4d5c88e04390481b3156c0e5efe40979d8519 (diff)
downloademacs-39cde66c5e6c226586187fe13d91fd2c65eb4649.tar.gz
emacs-39cde66c5e6c226586187fe13d91fd2c65eb4649.zip
mm-uu.el (mm-uu-type-alist): Add support for git format-patch diff format.
mm-decode.el (mm-inline-media-tests): Do not check for diff-mode it's standard in Emacs nowadays. color.el (color-gradient): Add a color-gradient function.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/color.el14
-rw-r--r--lisp/gnus/ChangeLog8
-rw-r--r--lisp/gnus/mm-decode.el12
-rw-r--r--lisp/gnus/mm-uu.el6
5 files changed, 34 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5bed23d3059..627c61deaeb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12011-02-01 Julien Danjou <julien@danjou.info>
2
3 * color.el (color-gradient): Add a color-gradient function.
4
12011-02-01 Sam Steingold <sds@gnu.org> 52011-02-01 Sam Steingold <sds@gnu.org>
2 6
3 * simple.el (special-mode-map): Bind "h" to `describe-mode'; 7 * simple.el (special-mode-map): Bind "h" to `describe-mode';
diff --git a/lisp/color.el b/lisp/color.el
index 5c95fffbfad..3874e33bfbb 100644
--- a/lisp/color.el
+++ b/lisp/color.el
@@ -47,6 +47,20 @@ RED GREEN BLUE must be values between 0 and 1 inclusively."
47 (- 1.0 (cadr color)) 47 (- 1.0 (cadr color))
48 (- 1.0 (caddr color))))) 48 (- 1.0 (caddr color)))))
49 49
50(defun color-gradient (start stop step-number)
51 "Return a list with STEP-NUMBER colors from START to STOP.
52The color list builds a color gradient starting at color START to
53color STOP. It does not include the START and STOP color in the
54resulting list."
55 (loop for i from 1 to step-number
56 with red-step = (/ (- (car stop) (car start)) (1+ step-number))
57 with green-step = (/ (- (cadr stop) (cadr start)) (1+ step-number))
58 with blue-step = (/ (- (caddr stop) (caddr start)) (1+ step-number))
59 collect (list
60 (+ (car start) (* i red-step))
61 (+ (cadr start) (* i green-step))
62 (+ (caddr start) (* i blue-step)))))
63
50(defun color-complement-hex (color) 64(defun color-complement-hex (color)
51 "Return the color that is the complement of COLOR, in hexadecimal format." 65 "Return the color that is the complement of COLOR, in hexadecimal format."
52 (apply 'color-rgb->hex (color-complement color))) 66 (apply 'color-rgb->hex (color-complement color)))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index aa1d64026c4..a5c37092756 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,11 @@
12011-02-01 Julien Danjou <julien@danjou.info>
2
3 * mm-uu.el (mm-uu-type-alist): Add support for git format-patch diff
4 format.
5
6 * mm-decode.el (mm-inline-media-tests): Do not check for diff-mode it's
7 standard in Emacs nowadays.
8
12011-02-01 Stefan Monnier <monnier@iro.umontreal.ca> 92011-02-01 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * message.el (message-expand-name): Don't trust the return value of 11 * message.el (message-expand-name): Don't trust the return value of
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index d7bc882a844..3909e12186f 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -223,17 +223,9 @@ before the external MIME handler is invoked."
223 ("text/plain" mm-inline-text identity) 223 ("text/plain" mm-inline-text identity)
224 ("text/enriched" mm-inline-text identity) 224 ("text/enriched" mm-inline-text identity)
225 ("text/richtext" mm-inline-text identity) 225 ("text/richtext" mm-inline-text identity)
226 ("text/x-patch" mm-display-patch-inline 226 ("text/x-patch" mm-display-patch-inline identity)
227 (lambda (handle)
228 ;; If the diff-mode.el package is installed, the function is
229 ;; autoloaded. Checking (locate-library "diff-mode") would be trying
230 ;; to cater to broken installations. OTOH checking the function
231 ;; makes it possible to install another package which provides an
232 ;; alternative implementation of diff-mode. --Stef
233 (fboundp 'diff-mode)))
234 ;; In case mime.types uses x-diff (as does Debian's mime-support-3.40). 227 ;; In case mime.types uses x-diff (as does Debian's mime-support-3.40).
235 ("text/x-diff" mm-display-patch-inline 228 ("text/x-diff" mm-display-patch-inline identity)
236 (lambda (handle) (fboundp 'diff-mode)))
237 ("application/emacs-lisp" mm-display-elisp-inline identity) 229 ("application/emacs-lisp" mm-display-elisp-inline identity)
238 ("application/x-emacs-lisp" mm-display-elisp-inline identity) 230 ("application/x-emacs-lisp" mm-display-elisp-inline identity)
239 ("application/x-shellscript" mm-display-shell-script-inline identity) 231 ("application/x-shellscript" mm-display-shell-script-inline identity)
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 7f96f449da9..14b44198303 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -158,6 +158,12 @@ This can be either \"inline\" or \"attachment\".")
158 mm-uu-diff-extract 158 mm-uu-diff-extract
159 nil 159 nil
160 mm-uu-diff-test) 160 mm-uu-diff-test)
161 (git-format-patch
162 "^diff --git "
163 "^-- "
164 mm-uu-diff-extract
165 nil
166 mm-uu-diff-test)
161 (message-marks 167 (message-marks
162 ;; Text enclosed with tags similar to `message-mark-insert-begin' and 168 ;; Text enclosed with tags similar to `message-mark-insert-begin' and
163 ;; `message-mark-insert-end'. Don't use those variables to avoid 169 ;; `message-mark-insert-end'. Don't use those variables to avoid