Merge from emacs--devo--0, emacs--rel--22
authorMiles Bader <miles@gnu.org>
Mon, 5 May 2008 01:31:53 +0000 (01:31 +0000)
committerMiles Bader <miles@gnu.org>
Mon, 5 May 2008 01:31:53 +0000 (01:31 +0000)
Patches applied:

 * emacs--devo--0  (patch 1125, 1127-1128, 1130-1131, 1137-1138, 1141, 1143)

   - Merge from gnus--devo--0
   - Update from CVS

 * emacs--rel--22  (patch 257, 259)

   - Merge from gnus--rel--5.10

2008-05-04  Juri Linkov  <juri@jurta.org>

   * lisp/mailcap.el (mailcap-replace-in-string): New compatibility alias.
   (mailcap-file-default-commands): Use mailcap-replace-in-string
   instead of replace-regexp-in-string, and mailcap-delete-duplicates
   instead of delete-dups.  Use [ \t\n]* for whitespace in regexp.

2008-05-02  Juanma Barranquero  <lekktu@gmail.com>

   * lisp/gmm-utils.el (gmm, gmm-verbose, gmm-lazy, gmm-customize-mode)
   (gmm-image-load-path-for-library): Fix typos in docstrings.
   (gmm-message): Reflow docstring.

2008-04-25  Juanma Barranquero  <lekktu@gmail.com>

   * lisp/smime.el (smime-sign-region, smime-encrypt-region)
   (smime-decrypt-region):
   Remove redundant calls to `generate-new-buffer-name'.

2008-04-24  Stefan Monnier  <monnier@iro.umontreal.ca>

   * lisp/sieve-manage.el (sieve-string-bytes): Remove.
   (sieve-manage-putscript): Use length instead: `string-bytes' gives the
   correct byte-length only if the process's coding-system is the same as
   the one used internally by Emacs to represent strings.

Revision: emacs@sv.gnu.org/gnus--devo--0--patch-488

lisp/ChangeLog
lisp/gmm-utils.el
lisp/mailcap.el
lisp/sieve-manage.el
lisp/smime.el

index a3563e3..c6ecd12 100644 (file)
@@ -1,3 +1,10 @@
+2008-05-04  Juri Linkov  <juri@jurta.org>
+
+       * mailcap.el (mailcap-replace-in-string): New compatibility alias.
+       (mailcap-file-default-commands): Use mailcap-replace-in-string
+       instead of replace-regexp-in-string, and mailcap-delete-duplicates
+       instead of delete-dups.  Use [ \t\n]* for whitespace in regexp.
+
 2008-05-03  Reiner Steib  <reiner.steib@gmx.de>
 
        * gnus-sum.el (gnus-propagate-marks): Fix custom version.
        (gnus-use-marks): Define gnus-use-marks.
        (gnus-propagate-marks): Rename variable to something more sensible.
 
+2008-05-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * gmm-utils.el (gmm, gmm-verbose, gmm-lazy, gmm-customize-mode)
+       (gmm-image-load-path-for-library): Fix typos in docstrings.
+       (gmm-message): Reflow docstring.
+
 2008-04-28  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * mail-source.el (mail-source-set-1, mail-source-bind): Moved
        auth-source code out of the macro to clean it up and fix bugs.
 
+2008-04-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * smime.el (smime-sign-region, smime-encrypt-region)
+       (smime-decrypt-region):
+       Remove redundant calls to `generate-new-buffer-name'.
+
 2008-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-registry.el (gnus-registry-split-fancy-with-parent): Don't split
        (auth-source-user-or-password-sftp)
        (auth-source-user-or-password-smtp): Remove server parameter.
 
+2008-04-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * sieve-manage.el (sieve-string-bytes): Remove.
+       (sieve-manage-putscript): Use length instead: `string-bytes' gives the
+       correct byte-length only if the process's coding-system is the same as
+       the one used internally by Emacs to represent strings.
+
 2008-04-24  Luca Capello  <luca@pca.it>  (tiny change)
 
        * mm-encode.el (mm-safer-encoding): Add optional argument `type'.
 2008-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * auth-source.el: Added docs.
-       (auth-sources): Modified format to support server.
+       (auth-sources): Modify format to support server.
        (auth-source-pick, auth-source-user-or-password)
        (auth-source-user-or-password-imap)
        (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh)
        * gnus-art.el (gnus-button-mid-or-mail-heuristic-alist): Add "alpine".
        (gnus-treat-body-boundary): Don't test window-system.
 
-2007-10-28  Leo <sdl.web@gmail.com>  (tiny change)
+2007-10-28  Leo  <sdl.web@gmail.com>  (tiny change)
 
        * gnus-art.el (gnus-treat-emphasize): Don't test window-system.
 
        (spam-stat-buffer-words-with-scores): Don't narrow and change
        syntax table here.  Reported by Andrew Cohen <cohen@andy.bu.edu>.
 
-2004-01-20  Hubert Chan <hubert@uhoreg.ca>:
+2004-01-20  Hubert Chan  <hubert@uhoreg.ca>
 
        * spam.el (spam-use-spamassassin, spam-use-spamassassin-headers)
        (spam-install-hooks, spam-spamassassin, spam-spamassassin-path)
 
 2004-01-12  Kai Grossjohann  <kai.grossjohann@mci.com>
 
-       * message.el (message-expand-name): Use EUDC if the user uses
-       that.
+       * message.el (message-expand-name): Use EUDC if the user uses that.
 
 2004-01-12  Jesper Harder  <harder@ifa.au.dk>
 
index d0e2c08..f27344f 100644 (file)
@@ -33,7 +33,7 @@
 (require 'wid-edit)
 
 (defgroup gmm nil
-  "Utility functions for Gnus, Message and MML"
+  "Utility functions for Gnus, Message and MML."
   :prefix "gmm-"
   :version "22.1" ;; Gnus 5.10.9
   :group 'lisp)
@@ -43,7 +43,7 @@
 (defcustom gmm-verbose 7
   "Integer that says how verbose gmm should be.
 The higher the number, the more messages will flash to say what
-it done.  At zero, it will be totally mute; at five, it will
+it did.  At zero, it will be totally mute; at five, it will
 display most important messages; and at ten, it will keep on
 jabbering all the time."
   :type 'integer
@@ -67,9 +67,11 @@ The concatenation is done with logical ORs."
   "If LEVEL is lower than `gmm-verbose' print ARGS using `message'.
 
 Guideline for numbers:
-1 - error messages, 3 - non-serious error messages, 5 - messages for things
-that take a long time, 7 - not very important messages on stuff, 9 - messages
-inside loops."
+1 - error messages
+3 - non-serious error messages
+5 - messages for things that take a long time
+7 - not very important messages on stuff
+9 - messages inside loops."
   (if (<= level gmm-verbose)
       (apply 'message args)
     ;; We have to do this format thingy here even if the result isn't
@@ -99,7 +101,7 @@ ARGS are passed to `message'."
 (define-widget 'gmm-lazy 'default
   "Base widget for recursive datastructures.
 
-This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility."
+This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility."
   :format "%{%t%}: %v"
   :convert-widget 'widget-value-convert-widget
   :value-create (lambda (widget)
@@ -321,11 +323,11 @@ in \"`data-directory'/images\".
 
 Then this function returns a list of directories which contains
 first the directory in which IMAGE was found, followed by the
-value of `load-path'. If PATH is given, it is used instead of
+value of `load-path'.  If PATH is given, it is used instead of
 `load-path'.
 
 If NO-ERROR is non-nil and a suitable path can't be found, don't
-signal an error. Instead, return a list of directories as before,
+signal an error.  Instead, return a list of directories as before,
 except that nil appears in place of the image directory.
 
 Here is an example that uses a common idiom to provide
@@ -362,7 +364,7 @@ compatibility with versions of Emacs that lack the variable
       (setq image-directory-load-path dir))
 
     ;; If `image-directory-load-path' isn't Emacs' image directory,
-    ;; it's probably a user preference, so use it. Then use a
+    ;; it's probably a user preference, so use it.  Then use a
     ;; relative setting if possible; otherwise, use
     ;; `image-directory-load-path'.
     (cond
@@ -406,7 +408,7 @@ compatibility with versions of Emacs that lack the variable
 
 (defun gmm-customize-mode (&optional mode)
   "Customize customization group for MODE.
-If mode is nil, use `major-mode' of the curent buffer."
+If mode is nil, use `major-mode' of the current buffer."
   (interactive)
   (customize-group
    (or mode
index 7abb97e..cc7c9a3 100644 (file)
     (autoload 'mm-delete-duplicates "mm-util")
     'mm-delete-duplicates))
 
+;; `mailcap-replace-in-string' is an alias like `gnus-replace-in-string'.
+(eval-and-compile
+  (cond
+   ((fboundp 'replace-regexp-in-string)
+    (defun mailcap-replace-in-string  (string regexp newtext &optional literal)
+      "Replace all matches for REGEXP with NEWTEXT in STRING.
+If LITERAL is non-nil, insert NEWTEXT literally.  Return a new
+string containing the replacements.
+This is a compatibility function for different Emacsen."
+      (replace-regexp-in-string regexp newtext string nil literal)))
+   ((fboundp 'replace-in-string)
+    (defalias 'mailcap-replace-in-string 'replace-in-string))))
+
 (defgroup mailcap nil
   "Definition of viewers for MIME types."
   :version "21.1"
@@ -1017,15 +1030,17 @@ If FORCE, re-parse even if already parsed."
   (mailcap-parse-mimetypes)
   (let* ((all-mime-type
          ;; All unique MIME types from file extensions
-         (delete-dups (mapcar (lambda (file)
-                                (mailcap-extension-to-mime
-                                 (file-name-extension file t)))
-                              files)))
+         (mailcap-delete-duplicates
+          (mapcar (lambda (file)
+                    (mailcap-extension-to-mime
+                     (file-name-extension file t)))
+                  files)))
         (all-mime-info
          ;; All MIME info lists
-         (delete-dups (mapcar (lambda (mime-type)
-                                (mailcap-mime-info mime-type 'all))
-                              all-mime-type)))
+         (mailcap-delete-duplicates
+          (mapcar (lambda (mime-type)
+                    (mailcap-mime-info mime-type 'all))
+                  all-mime-type)))
         (common-mime-info
          ;; Intersection of mime-infos from different mime-types;
          ;; or just the first MIME info for a single MIME type
@@ -1040,18 +1055,17 @@ If FORCE, re-parse even if already parsed."
            (car all-mime-info)))
         (commands
          ;; Command strings from `viewer' field of the MIME info
-         (delete-dups
+         (mailcap-delete-duplicates
           (delq nil (mapcar (lambda (mime-info)
                               (let ((command (cdr (assoc 'viewer mime-info))))
                                 (if (stringp command)
-                                    (replace-regexp-in-string
+                                    (mailcap-replace-in-string
                                      ;; Replace mailcap's `%s' placeholder
                                      ;; with dired's `?' placeholder
-                                     "%s" "?"
-                                     (replace-regexp-in-string
+                                     (mailcap-replace-in-string
                                       ;; Remove the final filename placeholder
-                                      "\s*\\('\\)?%s\\1?\s*\\'" "" command nil t)
-                                     nil t))))
+                                      command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" "" t)
+                                     "%s" "?" t))))
                             common-mime-info)))))
     commands))
 
index c39a6bb..d328884 100644 (file)
@@ -570,15 +570,14 @@ password is remembered in the buffer."
     (sieve-manage-send (format "HAVESPACE \"%s\" %s" name size))
     (sieve-manage-parse-okno)))
 
-(eval-and-compile
-  (if (fboundp 'string-bytes)
-      (defalias 'sieve-string-bytes 'string-bytes)
-    (defalias 'sieve-string-bytes 'length)))
-
 (defun sieve-manage-putscript (name content &optional buffer)
   (with-current-buffer (or buffer (current-buffer))
     (sieve-manage-send (format "PUTSCRIPT \"%s\" {%d+}%s%s" name
-                              (sieve-string-bytes content)
+                               ;; Here we assume that the coding-system will
+                               ;; replace each char with a single byte.
+                               ;; This is always the case if `content' is
+                               ;; a unibyte string.
+                              (length content)
                               sieve-manage-client-eol content))
     (sieve-manage-parse-okno)))
 
index ddf39cc..564d57a 100644 (file)
@@ -305,7 +305,7 @@ key and certificate itself."
   (smime-new-details-buffer)
   (let* ((certfiles (and (cdr-safe keyfile) (cadr keyfile)))
         (keyfile (or (car-safe keyfile) keyfile))
-        (buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
+        (buffer (generate-new-buffer " *smime*"))
         (passphrase (smime-ask-passphrase (expand-file-name keyfile)))
         (tmpfile (smime-make-temp-file "smime")))
     (if passphrase
@@ -340,7 +340,7 @@ If encryption fails, the buffer is not modified.  Region is assumed to
 have proper MIME tags.  CERTFILES is a list of filenames, each file
 is expected to contain of a PEM encoded certificate."
   (smime-new-details-buffer)
-  (let ((buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
+  (let ((buffer (generate-new-buffer " *smime*"))
        (tmpfile (smime-make-temp-file "smime")))
     (prog1
        (when (prog1
@@ -439,7 +439,7 @@ On success, replaces region with decrypted data and return non-nil.
 Any details (stderr on success, stdout and stderr on error) are left
 in the buffer specified by `smime-details-buffer'."
   (smime-new-details-buffer)
-  (let ((buffer (generate-new-buffer (generate-new-buffer-name " *smime*")))
+  (let ((buffer (generate-new-buffer " *smime*"))
        CAs (passphrase (smime-ask-passphrase (expand-file-name keyfile)))
        (tmpfile (smime-make-temp-file "smime")))
     (if passphrase