From 38fea12ab8cceb98a642044eeba65e65426504b5 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Wed, 31 May 2000 14:16:27 +0000 Subject: Added hack to completion.el to avoid adding every prefix as completion. --- generic/proof-compat.el | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/generic/proof-compat.el b/generic/proof-compat.el index 9b864185..31b57cb3 100644 --- a/generic/proof-compat.el +++ b/generic/proof-compat.el @@ -30,17 +30,6 @@ "Non-nil if Proof General is running on a win32 system.")) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Misc backward compatibility -;;; - -(or (fboundp 'process-live-p) -(defun process-live-p (obj) - "Return t if OBJECT is a process that is alive" - (memq (process-status proc) '(open run stop)))) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; XEmacs compatibility @@ -58,6 +47,14 @@ ;;; FSF compatibility ;;; +;; completion not autoloaded in FSF 20.6.1; we must call +;; dynamic-completion-mode after loading it. +(or (fboundp 'complete) + (autoload 'complete "completion")) +(unless proof-running-on-XEmacs + (eval-after-load "completion" + '(dynamic-completion-mode))) + ;; These days cl is dumped with XEmacs (20.4,21.1) but not FSF Emacs ;; 20.2. Would rather it was autoloaded but the autoloads are broken @@ -65,7 +62,6 @@ (require 'cl) ;; Give a warning, - (or (fboundp 'warn) (defun warn (str &rest args) "Issue a warning STR. Defined by PG for FSF compatibility." @@ -73,7 +69,6 @@ (sit-for 2))) ;; Modeline redrawing (actually force-mode-line-update is alias on XEmacs) - (or (fboundp 'redraw-modeline) (defun redraw-modeline (&rest args) "Dummy function for Proof General on FSF Emacs." @@ -176,6 +171,20 @@ Otherwise treat \\ in NEWTEXT string as special: nil (or history 'shell-command-history))))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; A naughty hack to completion.el +;;; +;;; At the moment IMO completion too eagerly adds stuff to +;;; its database: the completion-before-command function +;;; makes every suffix be added as a completion! + +(eval-after-load "completion" +'(defun completion-before-command () + (if (and (symbolp this-command) (get this-command 'completion-function)) + (funcall (get this-command 'completion-function))))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Old Emacs version compatibility @@ -188,6 +197,12 @@ Otherwise treat \\ in NEWTEXT string as special: "Dummy function for PG; please upgrade your Emacs." nil)) +(or (fboundp 'process-live-p) +(defun process-live-p (obj) + "Return t if OBJECT is a process that is alive" + (memq (process-status proc) '(open run stop)))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -206,9 +221,6 @@ Otherwise treat \\ in NEWTEXT string as special: (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. -- cgit v1.2.3