Mercurial > emacs
changeset 13004:0ed37da6f0f3
(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.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 06 Sep 1995 18:04:02 +0000 |
parents | 4711396531e8 |
children | 35c7fa318961 |
files | lisp/info.el |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/info.el Wed Sep 06 17:07:53 1995 +0000 +++ b/lisp/info.el Wed Sep 06 18:04:02 1995 +0000 @@ -124,6 +124,7 @@ (if (eq system-type 'ms-dos) '( (".gz" . "gunzip") (".z" . "gunzip") + (".inf" . nil) ("" . nil)) '( (".info.Z" . "uncompress") (".info.Y" . "unyabba") @@ -152,6 +153,11 @@ (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 @@ (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 @@ (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 @@ (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)))))