From: Richard M. Stallman Date: Wed, 6 Sep 1995 18:04:02 +0000 (+0000) Subject: (Info-suffix-list): Add .inf to MSDOS list. X-Git-Tag: emacs-19.34~2856 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9b842cab4956c2be77d1e68e76c7133865a86419;p=emacs.git (Info-suffix-list): Add .inf to MSDOS list. (info-insert-file-contents): Use info-insert-file-contents-1 to set FULLNAME. Use call-process-region to run the decode program. (Info-find-node): Use info-insert-file-contents-1. (info-insert-file-contents-1) [MSDOS]: Don't use the dot in SUFFIX if FILENAME already has one. --- diff --git a/lisp/info.el b/lisp/info.el index 5948840daca..2b8aa560348 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -124,6 +124,7 @@ Marker points nowhere if file has no tag table.") (if (eq system-type 'ms-dos) '( (".gz" . "gunzip") (".z" . "gunzip") + (".inf" . nil) ("" . nil)) '( (".info.Z" . "uncompress") (".info.Y" . "unyabba") @@ -152,6 +153,11 @@ be last in the list.") (ext-len (- (length filename) (length sans-exts) 1)) ;; How many chars of that extension should we keep? (ext-left (max 0 (- 3 (length suffix))))) + ;; SUFFIX starts with a dot. If FILENAME already has one, + ;; get rid of the one in SUFFIX. + (or (and (zerop ext-len) + (not (eq (aref filename (1- (length filename))) ?.))) + (setq suffix (substring suffix 1))) ;; Get rid of the rest of the extension, and add SUFFIX. (concat (substring filename 0 (- (length filename) (- ext-len ext-left))) @@ -180,7 +186,7 @@ Do the right thing if the file has been compressed or zipped." (setq tail (cdr tail))) ;; If we found a file with a suffix, set DECODER according to the suffix ;; and set FULLNAME to the file's actual name. - (setq fullname (concat filename (car (car tail))) + (setq fullname (info-insert-file-contents-1 filename (car (car tail))) decoder (cdr (car tail))) (or tail (error "Can't find %s or any compressed version of it" filename))) @@ -194,7 +200,7 @@ Do the right thing if the file has been compressed or zipped." (let ((buffer-read-only nil) (default-directory (or (file-name-directory fullname) default-directory))) - (shell-command-on-region (point-min) (point-max) decoder t))))) + (call-process-region (point-min) (point-max) decoder t t))))) ;;;###autoload (add-hook 'same-window-buffer-names "*info*") @@ -264,10 +270,12 @@ In standalone mode, \\\\[Info-exit] exits Emacs itself." (let ((suffix-list Info-suffix-list)) (while (and suffix-list (not found)) (cond ((file-exists-p - (concat temp (car (car suffix-list)))) + (info-insert-file-contents-1 + temp (car (car suffix-list)))) (setq found temp)) ((file-exists-p - (concat temp-downcase (car (car suffix-list)))) + (info-insert-file-contents-1 + temp-downcase (car (car suffix-list)))) (setq found temp-downcase))) (setq suffix-list (cdr suffix-list)))) (setq dirs (cdr dirs)))))