X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fbinhex.el;h=76228810bbf90334723fb0695527e9167175ba64;hb=d23ae6d662108ef26a2aa8aaed80377855dc97f3;hp=678b73f012616b41a001add948f5f35cb9e303ea;hpb=455c79decacc0a54e060a1d716bab0306e31e8f6;p=elisp%2Fgnus.git- diff --git a/lisp/binhex.el b/lisp/binhex.el index 678b73f..7622881 100644 --- a/lisp/binhex.el +++ b/lisp/binhex.el @@ -1,5 +1,5 @@ ;;; binhex.el --- elisp native binhex decode -;; Copyright (c) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +;; Copyright (c) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ;; Author: Shenghuo Zhu ;; Keywords: binhex news @@ -25,10 +25,10 @@ ;;; Code: -(autoload 'executable-find "executable") - (eval-when-compile (require 'cl)) +(require 'path-util) + (eval-and-compile (defalias 'binhex-char-int (if (fboundp 'char-int) @@ -36,19 +36,19 @@ 'identity))) (defcustom binhex-decoder-program "hexbin" - "*Non-nil value should be a string that names a uu decoder. + "*Non-nil value should be a string that names a binhex decoder. The program should expect to read binhex data on its standard input and write the converted data to its standard output." :type 'string :group 'gnus-extract) (defcustom binhex-decoder-switches '("-d") - "*List of command line flags passed to the command named by binhex-decoder-program." + "*List of command line flags passed to the command `binhex-decoder-program'." :group 'gnus-extract :type '(repeat string)) (defcustom binhex-use-external - (executable-find binhex-decoder-program) + (exec-installed-p binhex-decoder-program) "*Use external binhex program." :group 'gnus-extract :type 'boolean) @@ -81,13 +81,16 @@ input and write the converted data to its standard output." ((boundp 'temporary-file-directory) temporary-file-directory) ("/tmp/"))) -(if (featurep 'xemacs) - (defalias 'binhex-insert-char 'insert-char) - (defun binhex-insert-char (char &optional count ignored buffer) - (if (or (null buffer) (eq buffer (current-buffer))) - (insert-char char count) - (with-current-buffer buffer - (insert-char char count))))) +(eval-and-compile + (defalias 'binhex-insert-char + (if (featurep 'xemacs) + 'insert-char + (lambda (char &optional count ignored buffer) + "Insert COUNT copies of CHARACTER into BUFFER." + (if (or (null buffer) (eq buffer (current-buffer))) + (insert-char char count) + (with-current-buffer buffer + (insert-char char count))))))) (defvar binhex-crc-table [0 4129 8258 12387 16516 20645 24774 28903 @@ -245,7 +248,7 @@ If HEADER-ONLY is non-nil only decode header and return filename." (>= (buffer-size) data-fork-start))) (progn (binhex-verify-crc work-buffer - 1 data-fork-start) + (point-min) data-fork-start) (setq header (binhex-header work-buffer)) (if header-only (setq tmp nil counter 0)))) (setq tmp (and tmp (not (eq inputpos end)))))