emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103077: mm-uu.el (mm-uu-type-alist):


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103077: mm-uu.el (mm-uu-type-alist): Add support for git format-patch diff format.
Date: Tue, 01 Feb 2011 23:46:27 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103077
author: Julien Danjou <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2011-02-01 23:46:27 +0000
message:
  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.
modified:
  lisp/ChangeLog
  lisp/color.el
  lisp/gnus/ChangeLog
  lisp/gnus/mm-decode.el
  lisp/gnus/mm-uu.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-01 21:37:12 +0000
+++ b/lisp/ChangeLog    2011-02-01 23:46:27 +0000
@@ -1,3 +1,7 @@
+2011-02-01  Julien Danjou  <address@hidden>
+
+       * color.el (color-gradient): Add a color-gradient function.
+
 2011-02-01  Sam Steingold  <address@hidden>
 
        * simple.el (special-mode-map): Bind "h" to `describe-mode';

=== modified file 'lisp/color.el'
--- a/lisp/color.el     2011-01-25 04:08:28 +0000
+++ b/lisp/color.el     2011-02-01 23:46:27 +0000
@@ -47,6 +47,20 @@
           (- 1.0 (cadr color))
           (- 1.0 (caddr color)))))
 
+(defun color-gradient (start stop step-number)
+  "Return a list with STEP-NUMBER colors from START to STOP.
+The color list builds a color gradient starting at color START to
+color STOP. It does not include the START and STOP color in the
+resulting list."
+  (loop for i from 1 to step-number
+        with red-step = (/ (- (car stop) (car start)) (1+ step-number))
+        with green-step = (/ (- (cadr stop) (cadr start)) (1+ step-number))
+        with blue-step = (/ (- (caddr stop) (caddr start)) (1+ step-number))
+        collect (list
+                 (+ (car start) (* i red-step))
+                 (+ (cadr start) (* i green-step))
+                 (+ (caddr start) (* i blue-step)))))
+
 (defun color-complement-hex (color)
   "Return the color that is the complement of COLOR, in hexadecimal format."
   (apply 'color-rgb->hex (color-complement color)))

=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-02-01 14:09:20 +0000
+++ b/lisp/gnus/ChangeLog       2011-02-01 23:46:27 +0000
@@ -1,3 +1,11 @@
+2011-02-01  Julien Danjou  <address@hidden>
+
+       * 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.
+
 2011-02-01  Stefan Monnier  <address@hidden>
 
        * message.el (message-expand-name): Don't trust the return value of

=== modified file 'lisp/gnus/mm-decode.el'
--- a/lisp/gnus/mm-decode.el    2011-01-25 23:51:40 +0000
+++ b/lisp/gnus/mm-decode.el    2011-02-01 23:46:27 +0000
@@ -223,17 +223,9 @@
     ("text/plain" mm-inline-text identity)
     ("text/enriched" mm-inline-text identity)
     ("text/richtext" mm-inline-text identity)
-    ("text/x-patch" mm-display-patch-inline
-     (lambda (handle)
-       ;; If the diff-mode.el package is installed, the function is
-       ;; autoloaded.  Checking (locate-library "diff-mode") would be trying
-       ;; to cater to broken installations.  OTOH checking the function
-       ;; makes it possible to install another package which provides an
-       ;; alternative implementation of diff-mode.  --Stef
-       (fboundp 'diff-mode)))
+    ("text/x-patch" mm-display-patch-inline identity)
     ;; In case mime.types uses x-diff (as does Debian's mime-support-3.40).
-    ("text/x-diff" mm-display-patch-inline
-     (lambda (handle) (fboundp 'diff-mode)))
+    ("text/x-diff" mm-display-patch-inline identity)
     ("application/emacs-lisp" mm-display-elisp-inline identity)
     ("application/x-emacs-lisp" mm-display-elisp-inline identity)
     ("application/x-shellscript" mm-display-shell-script-inline identity)

=== modified file 'lisp/gnus/mm-uu.el'
--- a/lisp/gnus/mm-uu.el        2011-01-25 04:08:28 +0000
+++ b/lisp/gnus/mm-uu.el        2011-02-01 23:46:27 +0000
@@ -158,6 +158,12 @@
      mm-uu-diff-extract
      nil
      mm-uu-diff-test)
+    (git-format-patch
+     "^diff --git "
+     "^-- "
+     mm-uu-diff-extract
+     nil
+     mm-uu-diff-test)
     (message-marks
      ;; Text enclosed with tags similar to `message-mark-insert-begin' and
      ;; `message-mark-insert-end'.  Don't use those variables to avoid


reply via email to

[Prev in Thread] Current Thread [Next in Thread]