emacs-commit
[Top][All Lists]
Advanced

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

[Emacs-commit] emacs/lisp/mh-e mh-utils.el mh-gnus.el mh-acros...


From: Bill Wohler
Subject: [Emacs-commit] emacs/lisp/mh-e mh-utils.el mh-gnus.el mh-acros...
Date: Wed, 11 Jan 2006 21:02:35 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         
Changes by:     Bill Wohler <address@hidden>    06/01/11 21:02:35

Modified files:
        lisp/mh-e      : mh-utils.el mh-gnus.el mh-acros.el ChangeLog 

Log message:
        * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
        mh-gnus.el.
        
        * mh-gnus.el: Require mh-acros.
        (mh-defmacro-compat, mh-defun-compat): Move to mh-acros.el.
        
        * mh-utils.el (url-unreserved-chars, url-hexify-string): Define if not
        defined. Copied from url-util.el in Emacs22 for Emacs 21.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-utils.el.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-gnus.el.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-acros.el.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/ChangeLog.diff?tr1=1.111&tr2=1.112&r1=text&r2=text

Patches:
Index: emacs/lisp/mh-e/ChangeLog
diff -u emacs/lisp/mh-e/ChangeLog:1.111 emacs/lisp/mh-e/ChangeLog:1.112
--- emacs/lisp/mh-e/ChangeLog:1.111     Wed Jan 11 19:50:07 2006
+++ emacs/lisp/mh-e/ChangeLog   Wed Jan 11 21:02:35 2006
@@ -1,5 +1,19 @@
 2006-01-11  Bill Wohler  <address@hidden>
 
+       * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here
+       from mh-gnus.el.
+
+       * mh-gnus.el: Require mh-acros.
+       (mh-defmacro-compat, mh-defun-compat): Move to mh-acros.el.
+
+       * mh-utils.el (mh-x-image-url-cache-canonicalize): Use
+       url-hexify-string to remove special characters from filenames
+       (closes SF #1396499). Note that this invalidates the existing
+       names in your cache so you might as well remove
+       ~/Mail/.mhe-x-image-cache/* now.
+       (url-unreserved-chars, url-hexify-string): Define if not defined.
+       Copied from url-util.el in Emacs22 for Emacs 21.
+
        * mh-buffers.el: New file. Contains constants and code from
        mh-index.el and mh-utils.el.
 
@@ -27,12 +41,6 @@
        * mh-comp.el (mh-forward): Cosmetics on prompt when draft exists.
        (mh-send-letter): Add -msgid to mh-send-args (closes SF #725425).
 
-       * mh-utils.el (mh-x-image-url-cache-canonicalize): Use
-       url-hexify-string to remove special characters from filenames
-       (closes SF #1396499). Note that this invalidates the existing
-       names in your cache so you might as well remove
-       ~/Mail/.mhe-x-image-cache/* now.
-       
 2006-01-10  Bill Wohler  <address@hidden>
 
        * mh-comp.el (mh-insert-letter): If you choose a different folder,
Index: emacs/lisp/mh-e/mh-acros.el
diff -u emacs/lisp/mh-e/mh-acros.el:1.12 emacs/lisp/mh-e/mh-acros.el:1.13
--- emacs/lisp/mh-e/mh-acros.el:1.12    Fri Dec 23 08:40:31 2005
+++ emacs/lisp/mh-e/mh-acros.el Wed Jan 11 21:02:35 2006
@@ -1,6 +1,6 @@
 ;;; mh-acros.el --- Macros used in MH-E
 
-;; Copyright (C) 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <address@hidden>
 ;; Maintainer: Bill Wohler <address@hidden>
@@ -74,6 +74,26 @@
     `(when (fboundp ',function)
        (funcall ',function ,@args))))
 
+(defmacro mh-defun-compat (function arg-list &rest body)
+  "This is a macro to define functions which are not defined.
+It is used for functions which were added to Emacs recently.
+If FUNCTION is not defined then it is defined to have argument
+list, ARG-LIST and body, BODY."
+  (let ((defined-p (fboundp function)))
+    (unless defined-p
+      `(defun ,function ,arg-list ,@body))))
+(put 'mh-defun-compat 'lisp-indent-function 'defun)
+
+(defmacro mh-defmacro-compat (function arg-list &rest body)
+  "This is a macro to define functions which are not defined.
+It is used for macros which were added to Emacs recently.
+If FUNCTION is not defined then it is defined to have argument
+list, ARG-LIST and body, BODY."
+  (let ((defined-p (fboundp function)))
+    (unless defined-p
+      `(defmacro ,function ,arg-list ,@body))))
+(put 'mh-defmacro-compat 'lisp-indent-function 'defun)
+
 (defmacro mh-make-local-hook (hook)
   "Make HOOK local if needed.
 XEmacs and versions of GNU Emacs before 21.1 require
Index: emacs/lisp/mh-e/mh-gnus.el
diff -u emacs/lisp/mh-e/mh-gnus.el:1.11 emacs/lisp/mh-e/mh-gnus.el:1.12
--- emacs/lisp/mh-e/mh-gnus.el:1.11     Fri Dec 23 07:40:40 2005
+++ emacs/lisp/mh-e/mh-gnus.el  Wed Jan 11 21:02:35 2006
@@ -1,6 +1,6 @@
 ;;; mh-gnus.el --- Make MH-E compatible with installed version of Gnus.
 
-;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <address@hidden>
 ;; Maintainer: Bill Wohler <address@hidden>
@@ -30,6 +30,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'mh-acros))
+
 ;; Load libraries in a non-fatal way in order to see if certain functions are
 ;; pre-defined.
 (load "mailabbrev" t t)
@@ -39,34 +41,14 @@
 (load "mml" t t)
 (load "smiley" t t)
 
-(defmacro mh-defun-compat (function arg-list &rest body)
-  "This is a macro to define functions which are not defined.
-It is used for Gnus utility functions which were added recently.
-If FUNCTION is not defined then it is defined to have argument
-list, ARG-LIST and body, BODY."
-  (let ((defined-p (fboundp function)))
-    (unless defined-p
-      `(defun ,function ,arg-list ,@body))))
-(put 'mh-defun-compat 'lisp-indent-function 'defun)
-
-(defmacro mh-defmacro-compat (function arg-list &rest body)
-  "This is a macro to define functions which are not defined.
-It is used for Gnus utility functions which were added recently.
-If FUNCTION is not defined then it is defined to have argument
-list, ARG-LIST and body, BODY."
-  (let ((defined-p (fboundp function)))
-    (unless defined-p
-      `(defmacro ,function ,arg-list ,@body))))
-(put 'mh-defmacro-compat 'lisp-indent-function 'defun)
-
-;; Copy of original function from gnus-util.el.
+;; Copy of function from gnus-util.el.
 (mh-defun-compat gnus-local-map-property (map)
   "Return a list suitable for a text property list specifying keymap MAP."
   (cond (mh-xemacs-flag (list 'keymap map))
         ((>= emacs-major-version 21) (list 'keymap map))
         (t (list 'local-map map))))
 
-;; Copy of original function from mm-decode.el.
+;; Copy of function from mm-decode.el.
 (mh-defun-compat mm-merge-handles (handles1 handles2)
   (append (if (listp (car handles1)) handles1 (list handles1))
           (if (listp (car handles2)) handles2 (list handles2))))
@@ -96,11 +78,11 @@
 (mh-defun-compat mm-possibly-verify-or-decrypt (parts ctl)
   nil)
 
-;; Copy of original macro is in mm-decode.el.
+;; Copy of macro in mm-decode.el.
 (mh-defmacro-compat mm-handle-multipart-ctl-parameter (handle parameter)
   `(get-text-property 0 ,parameter (car ,handle)))
 
-;; Copy of original function in mm-decode.el.
+;; Copy of function in mm-decode.el.
 (mh-defun-compat mm-readable-p (handle)
   "Say whether the content of HANDLE is readable."
   (and (< (with-current-buffer (mm-handle-buffer handle)
@@ -110,7 +92,7 @@
          (and (eq (mm-body-7-or-8) '7bit)
               (not (mm-long-lines-p 76))))))
 
-;; Copy of original function in mm-bodies.el.
+;; Copy of function in mm-bodies.el.
 (mh-defun-compat mm-long-lines-p (length)
   "Say whether any of the lines in the buffer is longer than LENGTH."
   (save-excursion
@@ -132,7 +114,7 @@
   "Older versions of Emacs don't have this function."
   nil)
 
-;; Copy of original function in mml.el.
+;; Copy of function in mml.el.
 (mh-defun-compat mml-minibuffer-read-disposition (type &optional default)
   (unless default (setq default
                         (if (and (string-match "\\`text/" type)
Index: emacs/lisp/mh-e/mh-utils.el
diff -u emacs/lisp/mh-e/mh-utils.el:1.37 emacs/lisp/mh-e/mh-utils.el:1.38
--- emacs/lisp/mh-e/mh-utils.el:1.37    Wed Jan 11 19:50:06 2006
+++ emacs/lisp/mh-e/mh-utils.el Wed Jan 11 21:02:35 2006
@@ -1466,6 +1466,30 @@
   "Scale image in INPUT file and write to OUTPUT file using ImageMagick."
   (call-process "convert" nil nil nil "-geometry" "96x48" input output))
 
+;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21.
+(if (not (boundp 'url-unreserved-chars))
+    (defconst url-unreserved-chars
+      '(
+        ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w 
?x ?y ?z
+        ?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W 
?X ?Y ?Z
+        ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9
+        ?- ?_ ?. ?! ?~ ?* ?' ?\( ?\))
+      "A list of characters that are _NOT_ reserved in the URL spec.
+This is taken from RFC 2396."))
+
+;; Copy of function from url-util.el in Emacs 22; needed by Emacs 21.
+(mh-defun-compat url-hexify-string (str)
+  "Escape characters in a string."
+  (mapconcat
+   (lambda (char)
+     ;; Fixme: use a char table instead.
+     (if (not (memq char url-unreserved-chars))
+        (if (> char 255)
+              (error "Hexifying multibyte character %s" str)
+          (format "%%%02X" char))
+       (char-to-string char)))
+   str ""))
+
 (defun mh-x-image-url-cache-canonicalize (url)
   "Canonicalize URL.
 Replace the ?/ character with a ?! character and append .png.




reply via email to

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