]> code.delx.au - gnu-emacs/blobdiff - lisp/hippie-exp.el
(compilation-mode): Add a mode-class property.
[gnu-emacs] / lisp / hippie-exp.el
index 4b16c719371ea155d29da1e89b1cdaff11928cdc..aeaa747659c0838fc4c1dea8719e9e1a7ccfd74a 100644 (file)
 
 ;;; Code:
 
+(defgroup hippie-expand nil
+  "Expand text trying various ways to find its expansion."
+  :group 'abbrev)
+
 (defvar he-num -1)
 
 (defvar he-string-beg (make-marker))
@@ -197,19 +201,26 @@ To change the behavior of `hippie-expand', remove, change the order of,
 or insert functions in this list.")
 
 ;;;###autoload
-(defvar hippie-expand-verbose t
-  "*Non-nil makes `hippie-expand' output which function it is trying.")
+(defcustom hippie-expand-verbose t
+  "*Non-nil makes `hippie-expand' output which function it is trying."
+  :type 'boolean
+  :group 'hippie-expand)
 
 ;;;###autoload
-(defvar hippie-expand-max-buffers ()
+(defcustom hippie-expand-max-buffers ()
   "*The maximum number of buffers (apart from the current) searched.
-If nil, all buffers are searched.")
+If nil, all buffers are searched."
+  :type '(choice (const :tag "All" nil)
+                integer)
+  :group 'hippie-expand)
 
 ;;;###autoload
-(defvar hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode)
+(defcustom hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode)
   "*A list specifying which buffers not to search (if not current).
 Can contain both regexps matching buffer names (as strings) and major modes
-\(as atoms)")
+\(as atoms)"
+  :type '(repeat (choice regexp (symbol :tag "Major Mode")))
+  :group 'hippie-expand)
 
 ;;;###autoload
 (defun hippie-expand (arg)
@@ -445,7 +456,7 @@ otherwise."
 (defvar he-file-name-chars
   (cond ((memq system-type '(vax-vms axp-vms))
         "-a-zA-Z0-9_/.,~^#$+=:\\[\\]")
-       ((memq system-type '(ms-dos ms-windows))
+       ((memq system-type '(ms-dos windows-nt))
         "-a-zA-Z0-9_/.,~^#$+=:\\\\")
        (t                          ;; More strange file formats ?
         "-a-zA-Z0-9_/.,~^#$+="))
@@ -483,16 +494,17 @@ otherwise."
   (if (memq system-type '(vax-vms axp-vms))
       (or (file-directory-p file)
          (file-directory-p (concat file "[000000]")))
-    (file-directory-p dir-part)))
+    (file-directory-p file)))
   
 (defun he-concat-directory-file-name (dir-part name-part)
   "Try to slam together two parts of a file specification, system dependently."
-  (cond ((memq system-type '(axp-vms vax-vms))
+  (cond ((null dir-part) name-part)
+       ((memq system-type '(axp-vms vax-vms))
         (if (and (string= (substring dir-part -1) "]")
                  (string= (substring name-part 0 2) "[."))
             (concat (substring dir-part 0 -1) (substring name-part 1))
           (concat dir-part name-part)))
-       ((memq system-type '(ms-dos ms-windows))
+       ((memq system-type '(ms-dos w32))
         (if (and (string-match "\\\\" dir-part)
                  (not (string-match "/" dir-part))
                  (= (aref name-part (1- (length name-part))) ?/))