Newsgroups: fj.editor.emacs
Path: galaxy.trc.rwcp.or.jp!jaist-news!cs.titech!nirvana.cs.titech!wnoc-tyo-news!sh.wide!wnoc-kyo-news!choshi!tatuya
From: tatuya@kaba.or.jp (Jinmei Tatuya)
Subject: Re: J-Shell, version 2.0
In-Reply-To: isoyama@rd.nttdata.jp's message of 3 Mar 94 03:45:38 GMT
Message-ID: <TATUYA.94Mar4125920@chotto.kaba.or.jp>
Sender: news@kaba.or.jp
Nntp-Posting-Host: chotto.kaba.or.jp
Organization: Kyoto Artificial Brain Associates, Kyoto, Japan.
References: <ISOYAMA.94Mar3124538@erlic.rd.nttdata.jp>
Distribution: fj
Date: Fri, 4 Mar 1994 03:59:20 GMT
Lines: 132
Xref: galaxy.trc.rwcp.or.jp fj.editor.emacs:4503
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.editor.emacs&nb=4503&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

  $B5~ETBg3X$N?@L@$H?=$7$^$9!#(B

>>>>> On 3 Mar 94 03:45:38 GMT, isoyama@rd.nttdata.jp (Hideyuki "natural-weave" Isoyama) said:

$B$$$=$d$^$5$s(B> $B$$$=$d$^!w#N#T#T%G!<%?$G$9!#(B

$B$$$=$d$^$5$s(B> $B@hF|(B gnu.emacs.sources $B$K(B J-Shell 2.0 $B$,N.$l$F$^$7$?$,!";H$o(B
$B$$$=$d$^$5$s(B> $B$l$F$$$kJ}$O$$$i$C$7$c$$$^$9$+!#:#2s$N$O(B"Command completion"
$B$$$=$d$^$5$s(B> $B$^$G$G$-$k$9$0$l$b$N$G$9$M!#(B

  $B:#$^$G$N(B j-shell $B$O(B command completion $B$,$G$-$J$$$N$,ITK~$G;H$C$F$J(B
$B$+$C$?$N$G$9$,!"$3$l$r5!$K>h$j49$($^$7$?!#2?$H$$$C$F$b(B directory
tracking $B$,Hs>o$KJXMx$G$9!#(B

$B$$$=$d$^$5$s(B> $B$?$@!"(BCommand completion $B$K<:GT$9$k$H!"(B
$B$$$=$d$^$5$s(B> $B!V(BSymbol's function definition is void: nil$B!W(B
$B$$$=$d$^$5$s(B> $B$H=P$k$N$,5$$K$J$j$^$9!#(Bemacs-19 $B$H$N0c$$$+$J$H;W$&$N$G$9$,!"(B
$B$$$=$d$^$5$s(B> $B2?$+$NBP=h$7$?J}$O$$$i$C$7$c$$$^$9$+!#(B

  $B$*$=$i$/!"(Btry-completion $B$H(B all-completions $B$N;EMM$N0c$$!J%P%0!)!K$N(B
$B$;$$$@$H;W$$$^$9!#(B

info $B$K$h$k$H!"(B
## Function: try-completion STRING ALIST &optional PREDICATE
     $B$3$N4X?t$O!"(B alist $BCf$N(B string $B$N2DG=$J(B($BA4$F$N(B) completion $B$N(B($B:GBg$N(B)$B6&DL(B
     $B%5%V%9%H%j%s%0$rJV$7$^$9!#(B

$B$H$J$C$F$$$k$N$G$9$,!"(BNemacs ($B$H$$$&$+!"B?J,(B Emacs18.55$B0JA0(B)$B$G$O!"(BALIST
$B$,(B nil $B$N;~$K%(%i!<$r5/$3$7$F$7$^$&$N$G$9!#(B

  Emacs-18.59 $B0J9_$G$O$3$N>l9g$b$A$c$s$H=hM}$7$F$/$l$k$N$G!"$*$=$i$/(B 
mule $B>e$G$J$iF0$$$F$/$l$k$H;W$$$^$9!#>/$J$/$H$b;d$N$H$3$m$G$O$=$&$G$9!#(B

  mule $B$r;H$C$F$J$$J}$b$$$i$C$7$c$k$H;W$$$^$9$N$G!"4JC1$J(B patch $B$b$D$1(B
$B$F$*$-$^$9!#(Bj-shell.el $B$N$"$k%G%#%l%/%H%j$G!"(B

% patch < (patch$BL>(B)

  $B$H$9$l$P(B Nemacs $B$G$bF0$/(B j-shell.el $B$,$G$-$k$O$:$G$9!#(B

----patch $B;O$^$j(B----

*** j-shell.elFri Mar  4 12:38:08 1994
--- j-shell18.elFri Mar  4 12:39:59 1994
***************
*** 1352,1358 ****
           (file (file-name-nondirectory (buffer-substring beg end)))
           (dir (or (file-name-directory (buffer-substring beg end)) ""))
           (akin (jsh-all-completions file dir))
!  (lpc (try-completion file (jsh-make-alist-from-list 
      (append akin nil)))))
      (cond ((eq lpc t)
             (message "[Sole completion]")
--- 1352,1358 ----
           (file (file-name-nondirectory (buffer-substring beg end)))
           (dir (or (file-name-directory (buffer-substring beg end)) ""))
           (akin (jsh-all-completions file dir))
!  (lpc (new-try-completion file (jsh-make-alist-from-list 
      (append akin nil)))))
      (cond ((eq lpc t)
             (message "[Sole completion]")
***************
*** 1543,1549 ****
      completions))
    (if (and (boundp 'jsh-builtin-commands)
     jsh-builtin-commands)
!       (setq completions (append (all-completions
   file jsh-builtin-commands)
  completions)))))
  
--- 1543,1549 ----
      completions))
    (if (and (boundp 'jsh-builtin-commands)
     jsh-builtin-commands)
!       (setq completions (append (new-all-completions
   file jsh-builtin-commands)
  completions)))))
  
***************
*** 1553,1559 ****
        jsh-complete-env-threshold
        (<= (length file) jsh-complete-env-threshold)))
      nil 
!   (setq completions (append (all-completions file jsh-environment)
      completions))))
  
      (setq completions (append (file-name-all-completions file dir) completions))
--- 1553,1559 ----
        jsh-complete-env-threshold
        (<= (length file) jsh-complete-env-threshold)))
      nil 
!   (setq completions (append (new-all-completions file jsh-environment)
      completions))))
  
      (setq completions (append (file-name-all-completions file dir) completions))
***************
*** 1562,1568 ****
  
  (defun jsh-try-completion (file dir)
  
!   (try-completion
     file (jsh-make-alist-from-list (jsh-all-completions file dir))))
  
  (defun jsh-submit-bug-report ()
--- 1562,1568 ----
  
  (defun jsh-try-completion (file dir)
  
!   (new-try-completion
     file (jsh-make-alist-from-list (jsh-all-completions file dir))))
  
  (defun jsh-submit-bug-report ()
***************
*** 1615,1617 ****
--- 1615,1626 ----
  (set-buffer (get 'jsh-dirhist 'dh-buffer)))))
  
  (provide 'j-shell)
+ 
+ (defun new-try-completion (string alist &optional pred)
+   (if (null alist) nil
+     (try-completion string alist pred)))
+ 
+ (defun new-all-completions (string alist &optional pred)
+   (if (null alist) nil
+     (all-completions string alist pred)))
+ 

--- patch $B=*$j(B ----
--
 $B?@L@(B $BC#:H(B (tatuya@kaba.or.jp)
 $B5~ETBg3XM}3XIt?tM}2r@O8&5f=j#M#1(B
