comparison lisp/minibuf.el @ 673:685b588e92d8

[xemacs-hg @ 2001-10-30 05:13:26 by andyp] merge of windows 21.4.5 codeline
author andyp
date Tue, 30 Oct 2001 05:13:31 +0000
parents 5bdbc721d46a
children a543dd3d410f
comparison
equal deleted inserted replaced
672:42a8626b741e 673:685b588e92d8
1662 :user-data dir-p 1662 :user-data dir-p
1663 :reference-buffer minibuf 1663 :reference-buffer minibuf
1664 :activate-callback 'read-file-name-activate-callback) 1664 :activate-callback 'read-file-name-activate-callback)
1665 (goto-char (point-min) completion-buf))))) 1665 (goto-char (point-min) completion-buf)))))
1666 1666
1667 (defun read-file-name-1 (history prompt dir default 1667 (defun read-file-name-1 (type history prompt dir default
1668 must-match initial-contents 1668 must-match initial-contents
1669 completer) 1669 completer)
1670 (if (should-use-dialog-box-p) 1670 (if (should-use-dialog-box-p)
1671 (condition-case nil 1671 (condition-case nil
1672 (let ((file 1672 (let ((file
1673 (apply #'make-dialog-box 1673 (apply #'make-dialog-box
1674 'file `(:title ,(capitalize-string-as-title 1674 type `(:title ,(capitalize-string-as-title
1675 ;; Kludge: Delete ": " off the end. 1675 ;; Kludge: Delete ": " off the end.
1676 (replace-in-string prompt ": $" "")) 1676 (replace-in-string prompt ": $" ""))
1677 ,@(and dir (list :initial-directory 1677 ,@(and dir (list :initial-directory
1678 dir)) 1678 dir))
1679 :file-must-exist ,must-match 1679 :file-must-exist ,must-match
1680 ,@(and initial-contents 1680 ,@(and initial-contents
1681 (list :initial-filename 1681 (list :initial-filename
1682 initial-contents)))))) 1682 initial-contents))))))
1683 ;; hack -- until we implement reading a directory properly, 1683 ;; hack -- until we implement reading a directory properly,
1684 ;; allow a file as indicating the directory it's in 1684 ;; allow a file as indicating the directory it's in
1685 (if (and (eq completer 'read-directory-name-internal) 1685 (if (and (eq completer 'read-directory-name-internal)
1686 (not (file-directory-p file))) 1686 (not (file-directory-p file)))
1687 (file-name-directory file) 1687 (file-name-directory file)
1728 specified, and `insert-default-directory' is non-nil, DIR or the current 1728 specified, and `insert-default-directory' is non-nil, DIR or the current
1729 directory will be used. 1729 directory will be used.
1730 Sixth arg HISTORY specifies the history list to use. Default is 1730 Sixth arg HISTORY specifies the history list to use. Default is
1731 `file-name-history'. 1731 `file-name-history'.
1732 DIR defaults to current buffer's directory default." 1732 DIR defaults to current buffer's directory default."
1733 (read-file-name-1 1733 (read-file-name-1
1734 (or history 'file-name-history) 1734 'file (or history 'file-name-history)
1735 prompt dir (or default 1735 prompt dir (or default
1736 (and initial-contents 1736 (and initial-contents
1737 (abbreviate-file-name (expand-file-name 1737 (abbreviate-file-name (expand-file-name
1738 initial-contents dir) t)) 1738 initial-contents dir) t))
1739 (and buffer-file-truename 1739 (and buffer-file-truename
1759 Fifth arg INITIAL-CONTENTS specifies text to start with. 1759 Fifth arg INITIAL-CONTENTS specifies text to start with.
1760 Sixth arg HISTORY specifies the history list to use. Default is 1760 Sixth arg HISTORY specifies the history list to use. Default is
1761 `file-name-history'. 1761 `file-name-history'.
1762 DIR defaults to current buffer's directory default." 1762 DIR defaults to current buffer's directory default."
1763 (read-file-name-1 1763 (read-file-name-1
1764 (or history 'file-name-history) 1764 'directory (or history 'file-name-history)
1765 prompt dir (or default default-directory) must-match initial-contents 1765 prompt dir (or default default-directory) must-match initial-contents
1766 'read-directory-name-internal)) 1766 'read-directory-name-internal))
1767 1767
1768 1768
1769 ;; Environment-variable and ~username completion hack 1769 ;; Environment-variable and ~username completion hack
1770 (defun read-file-name-internal-1 (string dir action completer) 1770 (defun read-file-name-internal-1 (string dir action completer)
1771 (if (not (string-match 1771 (if (not (string-match