diff options
| author | David Aspinall | 2000-05-26 17:47:57 +0000 |
|---|---|---|
| committer | David Aspinall | 2000-05-26 17:47:57 +0000 |
| commit | 23378837871e9828a439cd9ed50cf073b063e78d (patch) | |
| tree | 3547b01292b7cc853377d290e77f067668f5c8c3 | |
| parent | e801931ec4902a199f9efa809783571d53a87056 (diff) | |
Moved compatibility code into proof-compat.el
| -rw-r--r-- | generic/proof-compat.el | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/generic/proof-compat.el b/generic/proof-compat.el index defb1b51..c047b364 100644 --- a/generic/proof-compat.el +++ b/generic/proof-compat.el @@ -25,7 +25,7 @@ (eval-and-compile (defvar proof-running-on-XEmacs (string-match "XEmacs" emacs-version) "Non-nil if Proof General is running on XEmacs.") -;; rough test for XEmacs on win32, anyone't know about FSF there? +;; rough test for XEmacs on win32, anyone know about FSF on win32? (defvar proof-running-on-win32 (fboundp 'win32-long-file-name) "Non-nil if Proof General is running on a win32 system.")) @@ -75,7 +75,44 @@ "Dummy function for Proof General on FSF Emacs." nil)) ;; pretend always interactive. - + +;; In case Emacs is not aware of the function read-shell-command, +;; we duplicate some code adjusted from minibuf.el distributed +;; with XEmacs 21.1.9 +;; +;; This code is still required as of FSF Emacs 20.6.1 +;; +;; da: I think bothering with this just to give completion for +;; when proof-prog-name-ask=t is rather a big overkill! +;; Still, now it's here we'll leave it in as a pleasant surprise +;; for FSF Emacs users. +;; +(or (fboundp 'read-shell-command) +(defvar read-shell-command-map + (let ((map (make-sparse-keymap 'read-shell-command-map))) + (if (not (fboundp 'set-keymap-parents)) + (if (fboundp 'set-keymap-parent) + ;; FSF Emacs 20.2 + (set-keymap-parent map minibuffer-local-map) + ;; Earlier FSF Emacs + (setq map (append minibuffer-local-map map)) + ;; XEmacs versions without read-shell-command? + (set-keymap-parents map minibuffer-local-map))) + (define-key map "\t" 'comint-dynamic-complete) + (define-key map "\M-\t" 'comint-dynamic-complete) + (define-key map "\M-?" 'comint-dynamic-list-completions) + map) + "Minibuffer keymap used by shell-command and related commands.")) + + +(or (fboundp 'read-shell-command) +(defun read-shell-command (prompt &optional initial-input history) + "Just like read-string, but uses read-shell-command-map: +\\{read-shell-command-map}" + (let ((minibuffer-completion-table nil)) + (read-from-minibuffer prompt initial-input read-shell-command-map + nil (or history 'shell-command-history))))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; @@ -107,13 +144,14 @@ (or (fboundp 'font-lock-append-text-property) (autoload 'font-lock-append-text-property "font-lock")) +;; completion not autoloaded in FSF +(or (fboundp 'complete) + (autoload 'complete "completion")) + ;; FIXME: todo: keybinding compat here, esp for mouse. ;; See Isamode and emu.el for ideas. - - - ;; End of proof-compat.el (provide 'proof-compat)
\ No newline at end of file |
