(custom-face-value-create): If face name doesn't end with "face", add
[bpt/emacs.git] / lisp / hippie-exp.el
index df2d88f..830f648 100644 (file)
 
 ;;; Code:
 
+(eval-when-compile (require 'comint))
+
 (defgroup hippie-expand nil
   "Expand text trying various ways to find its expansion."
+  :link '(custom-manual "(autotype)Hippie Expand")
+  :link '(emacs-commentary-link "hippie-exp")
   :group 'abbrev
   :group 'convenience)
 
 (defvar he-search-window ())
 
 ;;;###autoload
-(defvar hippie-expand-try-functions-list '(try-complete-file-name-partially
-                                          try-complete-file-name
-                                          try-expand-all-abbrevs
-                                          try-expand-list
-                                          try-expand-line
-                                          try-expand-dabbrev
-                                          try-expand-dabbrev-all-buffers
-                                          try-expand-dabbrev-from-kill
-                                          try-complete-lisp-symbol-partially
-                                          try-complete-lisp-symbol)
+(defcustom hippie-expand-try-functions-list
+  '(try-complete-file-name-partially
+    try-complete-file-name
+    try-expand-all-abbrevs
+    try-expand-list
+    try-expand-line
+    try-expand-dabbrev
+    try-expand-dabbrev-all-buffers
+    try-expand-dabbrev-from-kill
+    try-complete-lisp-symbol-partially
+    try-complete-lisp-symbol)
   "The list of expansion functions tried in order by `hippie-expand'.
 To change the behavior of `hippie-expand', remove, change the order of,
-or insert functions in this list.")
+or insert functions in this list."
+  :type '(repeat function)
+  :group 'hippie-expand)
 
 ;;;###autoload
 (defcustom hippie-expand-verbose t
@@ -627,6 +634,7 @@ for subsequent calls (for further possible completions of the same
 string).  It returns t if a new completion is found, nil otherwise."
   (let ((expansion ())
        (strip-prompt (and (get-buffer-process (current-buffer))
+                          comint-use-prompt-regexp-instead-of-fields
                           comint-prompt-regexp)))
     (if (not old)
        (progn
@@ -673,6 +681,7 @@ for subsequent calls (for further possible completions of the same
 string).  It returns t if a new completion is found, nil otherwise."
   (let ((expansion ())
        (strip-prompt (and (get-buffer-process (current-buffer))
+                          comint-use-prompt-regexp-instead-of-fields
                           comint-prompt-regexp))
        (buf (current-buffer))
        (orig-case-fold-search case-fold-search))
@@ -699,6 +708,7 @@ string).  It returns t if a new completion is found, nil otherwise."
                      (widen))
                  (goto-char he-search-loc)
                  (setq strip-prompt (and (get-buffer-process (current-buffer))
+                                         comint-use-prompt-regexp-instead-of-fields
                                          comint-prompt-regexp))
                  (setq expansion 
                        (let ((case-fold-search orig-case-fold-search))