+2008-12-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-util.el (mm-substring-no-properties): New function.
+ (mm-string-to-multibyte): Doc fix.
+
+ * mml.el (mml-attach-file): Use mm-substring-no-properties.
+
2008-12-18 Reiner Steib <Reiner.Steib@gmx.de>
* mml.el (mml-attach-file): Strip text properties from file name.
(and (consp elem)
(stringp (car elem))
(string-match (car elem) buffer-name)
- (throw 'return (cdr elem))))))))))))
+ (throw 'return (cdr elem)))))))))
+ (substring-no-properties
+ . (lambda (string &optional from to)
+ "Return a substring of STRING, without text properties.
+It starts at index FROM and ending before TO.
+TO may be nil or omitted; then the substring runs to the end of STRING.
+If FROM is nil or omitted, the substring starts at the beginning of STRING.
+If FROM or TO is negative, it counts from the end.
+
+With one argument, just copy STRING without its properties."
+ (setq string (substring string (or from 0) to))
+ (set-text-properties 0 (length string) nil string)
+ string)))))
(eval-and-compile
(if (featurep 'xemacs)
'string-to-multibyte)
(t
(lambda (string)
- "Return a multibyte string with the same individual chars as string."
+ "Return a multibyte string with the same individual chars as STRING."
(mapconcat
(lambda (ch) (mm-string-as-multibyte (char-to-string ch)))
string "")))))
'type type
;; icicles redefines read-file-name and returns a
;; string w/ text properties :-/
- 'filename (substring-no-properties file)
+ 'filename (mm-substring-no-properties file)
'disposition (or disposition "attachment")
'description description)))