summaryrefslogtreecommitdiff
path: root/lisp/mail/binhex.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mail/binhex.el')
-rw-r--r--lisp/mail/binhex.el26
1 files changed, 10 insertions, 16 deletions
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index 896f82d7bcc..035bb32fa12 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -29,12 +29,6 @@
;;; Code:
-(eval-and-compile
- (defalias 'binhex-char-int
- (if (fboundp 'char-int)
- 'char-int
- 'identity)))
-
(defgroup binhex nil
"Decoding of BinHex (binary-to-hexadecimal) data."
:group 'mail
@@ -83,10 +77,8 @@ input and write the converted data to its standard output."
"^[^:]...............................................................$")
(defconst binhex-end-line ":$") ; unused
-(defvar binhex-temporary-file-directory
- (cond ((fboundp 'temp-directory) (temp-directory))
- ((boundp 'temporary-file-directory) temporary-file-directory)
- ("/tmp/")))
+(make-obsolete-variable 'binhex-temporary-file-directory
+ 'temporary-file-directory "28.1")
(defun binhex-insert-char (char &optional count ignored buffer)
"Insert COUNT copies of CHARACTER into BUFFER."
@@ -152,14 +144,14 @@ input and write the converted data to its standard output."
(defun binhex-string-big-endian (string)
(let ((ret 0) (i 0) (len (length string)))
(while (< i len)
- (setq ret (+ (ash ret 8) (binhex-char-int (aref string i)))
+ (setq ret (+ (ash ret 8) (aref string i))
i (1+ i)))
ret))
(defun binhex-string-little-endian (string)
(let ((ret 0) (i 0) (shift 0) (len (length string)))
(while (< i len)
- (setq ret (+ ret (ash (binhex-char-int (aref string i)) shift))
+ (setq ret (+ ret (ash (aref string i) shift))
i (1+ i)
shift (+ shift 8)))
ret))
@@ -169,11 +161,11 @@ input and write the converted data to its standard output."
(let ((pos (point-min)) len)
(vector
(prog1
- (setq len (binhex-char-int (char-after pos)))
+ (setq len (char-after pos))
(setq pos (1+ pos)))
(buffer-substring pos (setq pos (+ pos len)))
(prog1
- (setq len (binhex-char-int (char-after pos)))
+ (setq len (char-after pos))
(setq pos (1+ pos)))
(buffer-substring pos (setq pos (+ pos 4)))
(buffer-substring pos (setq pos (+ pos 4)))
@@ -285,7 +277,7 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(file-name (expand-file-name
(concat (binhex-decode-region-internal start end t)
".data")
- binhex-temporary-file-directory)))
+ temporary-file-directory)))
(save-excursion
(goto-char start)
(when (re-search-forward binhex-begin-line nil t)
@@ -296,7 +288,7 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(generate-new-buffer " *binhex-work*")))
(buffer-disable-undo work-buffer)
(insert-buffer-substring cbuf firstline end)
- (cd binhex-temporary-file-directory)
+ (cd temporary-file-directory)
(apply 'call-process-region
(point-min)
(point-max)
@@ -325,6 +317,8 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(binhex-decode-region-external start end)
(binhex-decode-region-internal start end)))
+(define-obsolete-function-alias 'binhex-char-int #'identity "28.1")
+
(provide 'binhex)
;;; binhex.el ends here