(defvar nnheader-read-timeout
(if (string-match "windows-nt\\|os/2\\|emx\\|cygwin"
(symbol-name system-type))
- 1.0 ; why?
+ ;; http://thread.gmane.org/v9655t3pjo.fsf@marauder.physik.uni-ulm.de
+ ;;
+ ;; IIRC, values lower than 1.0 didn't/don't work on Windows/DOS.
+ ;;
+ ;; There should probably be a runtime test to determine the timing
+ ;; resolution, or a primitive to report it. I don't know off-hand
+ ;; what's possible. Perhaps better, maybe the Windows/DOS primitive
+ ;; could round up non-zero timeouts to a minimum of 1.0?
+ 1.0
0.1)
"How long nntp should wait between checking for the end of output.
Shorter values mean quicker response, but are more CPU intensive.")
(autoload 'gnus-buffer-live-p "gnus-util"))
;; mm-util stuff.
+(defvar mm-emacs-mule t "True in Emacs with Mule.")
+
(unless (featurep 'mm-util)
;; Should keep track of `mm-image-load-path' in mm-util.el.
(defun nnheader-image-load-path (&optional package)
'ignore))
(defalias 'mm-encode-coding-string 'encode-coding-string)
(defalias 'mm-decode-coding-string 'decode-coding-string)
+ (defalias 'mm-encode-coding-region 'encode-coding-region)
+ (defalias 'mm-decode-coding-region 'decode-coding-region)
+ (defalias 'mm-set-buffer-file-coding-system 'set-buffer-file-coding-system)
;; Should keep track of `mm-detect-coding-region' in mm-util.el.
(defun nnheader-detect-coding-region (start end)
;; Should keep track of `mm-with-unibyte-buffer' in mm-util.el.
(defmacro nnheader-with-unibyte-buffer (&rest forms)
- "Create a temporary buffer, and evaluate FORMS there like `progn'.
+ "Create a temporary buffer, and evaluate FORMS there like `progn'.
Use unibyte mode for this."
- `(let (default-enable-multibyte-characters)
- (with-temp-buffer ,@forms)))
+ `(let (default-enable-multibyte-characters)
+ (with-temp-buffer ,@forms)))
(put 'nnheader-with-unibyte-buffer 'lisp-indent-function 0)
(put 'nnheader-with-unibyte-buffer 'edebug-form-spec '(body))
(put 'mm-with-unibyte-buffer 'lisp-indent-function 0)
(put 'mm-with-unibyte-buffer 'edebug-form-spec '(body))
(defalias 'mm-with-unibyte-buffer 'nnheader-with-unibyte-buffer)
+ ;; Should keep track of `mm-with-multibyte-buffer' in mm-util.el.
+ (defmacro nnheader-with-multibyte-buffer (&rest forms)
+ "Create a temporary buffer, and evaluate FORMS there like `progn'.
+Use multibyte mode for this."
+ `(let ((default-enable-multibyte-characters t))
+ (with-temp-buffer ,@forms)))
+ (put 'nnheader-with-multibyte-buffer 'lisp-indent-function 0)
+ (put 'nnheader-with-multibyte-buffer 'edebug-form-spec '(body))
+ (put 'mm-with-multibyte-buffer 'lisp-indent-function 0)
+ (put 'mm-with-multibyte-buffer 'edebug-form-spec '(body))
+ (defalias 'mm-with-multibyte-buffer 'nnheader-with-multibyte-buffer)
+
;; Should keep track of `mm-with-unibyte-current-buffer' in mm-util.el.
(defmacro nnheader-with-unibyte-current-buffer (&rest forms)
"Evaluate FORMS with current current buffer temporarily made unibyte.
;; Should keep track of `mm-guess-mime-charset' in mm-util.el.
(defun nnheader-guess-mime-charset ()
- "Guess the default MIME charset from the language environment."
- (let ((language-info
- (and (boundp 'current-language-environment)
- (assoc current-language-environment
- language-info-alist)))
- item)
- (cond
- ((null language-info)
- 'iso-8859-1)
- ((setq item
- (cadr
- (or (assq 'coding-priority language-info)
- (assq 'coding-system language-info))))
- (if (fboundp 'coding-system-get)
- (or (coding-system-get item 'mime-charset)
- item)
- item))
- ((setq item (car (last (assq 'charset language-info))))
- (if (eq item 'ascii)
- 'iso-8859-1
- (charsets-to-mime-charset (list item))))
- (t
- 'iso-8859-1))))
+ "Guess the default MIME charset from the language environment."
+ (let ((language-info
+ (and (boundp 'current-language-environment)
+ (assoc current-language-environment
+ language-info-alist)))
+ item)
+ (cond
+ ((null language-info)
+ 'iso-8859-1)
+ ((setq item
+ (cadr
+ (or (assq 'coding-priority language-info)
+ (assq 'coding-system language-info))))
+ (if (fboundp 'coding-system-get)
+ (or (coding-system-get item 'mime-charset)
+ item)
+ item))
+ ((setq item (car (last (assq 'charset language-info))))
+ (if (eq item 'ascii)
+ 'iso-8859-1
+ (charsets-to-mime-charset (list item))))
+ (t
+ 'iso-8859-1))))
(defalias 'mm-guess-mime-charset 'nnheader-guess-mime-charset)
(defalias 'mm-char-int 'char-int)
(defalias 'mm-string-make-unibyte
(if (fboundp 'string-make-unibyte)
'string-make-unibyte
- 'identity)))
+ 'identity))
+
+ (defalias 'mm-char-or-char-int-p
+ (cond
+ ((fboundp 'char-or-char-int-p) 'char-or-char-int-p)
+ ((fboundp 'char-valid-p) 'char-valid-p)
+ (t 'identity))))
;; mail-parse stuff.
(unless (featurep 'mail-parse)
(nnheader-insert-file-contents file)))))))
(defun nnheader-find-file-noselect (&rest args)
+ "Open a file with some variables bound.
+See `find-file-noselect' for the arguments."
(let ((format-alist nil)
(auto-mode-alist (nnheader-auto-mode-alist))
(default-major-mode 'fundamental-mode)