[Date Prev] [Date Index] [Date Next]
[Thread Prev] [Thread Index] [Thread Next]

[xyzzy:04202] Re: PDIC



Seiya さん先日はありがとうございました。
先日のpdic用の以下のプログラムですが、
edic.lのように別のウィンドウのbufferに書き込むにはどうしたらよいでしょうか?
できれば、辞書を引くごとに別ウィンドウのbufferに追加して行き、単語帖が作れたらよい
のですが..
lispがわかってないので、どこを直していいか分かりません。
よろしくお願いします。

;; pdic

(defvar *pdic-path* "d:/applications/pdicwin/pdicw.exe")

(defun get-current-word-or-selection ()
  (interactive)
  (let (word)
	(if (pre-selection-p)
		(let ((start (selection-point))
			  (end (selection-mark)))
		  (setq word (buffer-substring start end)))
	  (setq word
			(buffer-substring
			 (progn
			   (backward-word)
			   (point))
			 (progn
			   (forward-word)
			   (point)))))))

(defun consult-pdic-and-insert-results ()
  (interactive)
  (let ((word (get-current-word-or-selection))
		(chan (dde-initiate "PDICW" "Dictionary"))
		(answer))
	(if chan
		(progn
		  (dde-poke chan "Open" "")
		  (dde-poke chan "Find" word)
		  (setq answer (dde-request chan "Find"))
		  (dde-poke chan "Close" "")
		  (dde-terminate chan)
		  ;	  (backward-kill-word)
		  (setq answer (concat " " (subseq answer (+ 2 (length word)) (- 
(length answer) 2))))
		  (stop-selection)
		  (forward-word 1)
		  (insert answer))
	  (message "失敗です"))))

************************************
三浦 力松
埼玉県志木市幸町1-5-28-701
mila@xxxxxxxxxxxxx
************************************

Index Home