/[gcl]/gcl/elisp/smart-complete.el
ViewVC logotype

Diff of /gcl/elisp/smart-complete.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by wfs, Sun May 6 15:59:23 2001 UTC revision 1.3 by camm, Tue Dec 18 20:36:35 2001 UTC
# Line 119  Line 119 
119    
120  ;; return a regexp for this prompt but with numbers replaced.  ;; return a regexp for this prompt but with numbers replaced.
121    
122  (defun split-string (s bag)  (defun split-string-gcl (s bag)
123    (cond ((equal (length s) 0) '(""))    (cond ((equal (length s) 0) '(""))
124          ((string-match bag s)          ((string-match bag s)
125           (if (= (match-beginning  0) 0)           (if (= (match-beginning  0) 0)
126              (cons "" (split-string (substring s (match-end 0)) bag))              (cons "" (split-string-gcl (substring s (match-end 0)) bag))
127             (cons (substring s 0 (match-beginning 0))             (cons (substring s 0 (match-beginning 0))
128                   (split-string (substring s (match-end 0)) bag))))                   (split-string-gcl (substring s (match-end 0)) bag))))
129          (t (cons s nil))))          (t (cons s nil))))
130    
131  ;; Return a regexp which matches the current prompt, and which  ;; Return a regexp which matches the current prompt, and which
# Line 137  Line 137 
137  (defun regexp-for-this-prompt (prompt )  (defun regexp-for-this-prompt (prompt )
138    (let ((wild (cond ((string-match "/" prompt) "[^ >#%()]+")    (let ((wild (cond ((string-match "/" prompt) "[^ >#%()]+")
139                      (t "[0-9]+"))))                      (t "[0-9]+"))))
140    (let ((tem (split-string prompt wild)) (ans ""))    (let ((tem (split-string-gcl prompt wild)) (ans ""))
141      (while tem      (while tem
142        (setq ans (concat ans (regexp-quote (car tem))))        (setq ans (concat ans (regexp-quote (car tem))))
143        (cond ((cdr tem) (setq ans (concat ans wild))))        (cond ((cdr tem) (setq ans (concat ans wild))))

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26