summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-09-06 18:04:02 +0000
committerRichard M. Stallman <rms@gnu.org>1995-09-06 18:04:02 +0000
commit183d2ef6105e22c13bb36cdf844192c41838a4fe (patch)
tree0c596d00084e6b9b5428a36e404bb713f05ca19a /lisp
parent259451b351d7fc9f871880e9a8824d8bd89af4f3 (diff)
downloademacs-183d2ef6105e22c13bb36cdf844192c41838a4fe.tar.gz
(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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/info.el16
1 files changed, 12 insertions, 4 deletions
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-mode-map>\\[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)))))