Changeset 74 for lang/elisp/pdicv-mode/trunk/pdicv-search.el
- Timestamp:
- 01/31/09 00:20:29 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/pdicv-mode/trunk/pdicv-search.el
r71 r74 60 60 (message "Loading index-table for %s (\"%s\")..." dicname path) 61 61 (setq index-table (pdicv-get-index-list path word-encoding)) 62 (push (cons dicname index-table) pdicv-index-table-list)) 63 );fi 64 );let* 65 (setq diclist (cdr diclist)) 66 );wend 62 (push (cons dicname index-table) pdicv-index-table-list)) )) 63 (setq diclist (cdr diclist))) 67 64 (setq pdicv-inited-p t) 68 (message "Done.") 69 ); let 70 );caught 71 ) 65 (message "Done.") ))) 72 66 73 67 (defun pdicv-search-regexp (dicname regexp-to-search &optional field-to-search) … … 137 131 ; (string-match needle1 word))) 138 132 ; ) 139 `(lambda (e p j x) (string-match ,needle1 ,field-to-search))133 `(lambda (e_ e p j x) (string-match ,needle1 ,field-to-search)) 140 134 );list 141 135 (list … … 144 138 ; (string< word needle2)))) 145 139 (if just-p 146 `(lambda (e p j x) (zerop (nt:strcmp ,field-to-search ,needle1))) 147 `(lambda (e p j x) (and (not (string< ,field-to-search ,needle1)) 148 (string< ,field-to-search ,needle2))) ; �ǡ����֥�������� 149 );just-p 150 );list 151 ));fi,criteria 152 153 );let* 140 `(lambda (e_ e p j x) (zerop (nt:strcmp ,field-to-search ,needle1))) 141 `(lambda (e_ e p j x) (and (not (string< ,field-to-search ,needle1)) 142 (string< ,field-to-search ,needle2))) ; �ǡ����֥�������� 143 ))))) 154 144 ; (insert (format "%s" criteria)) 155 145 (pdicv-core-search dicinfo criteria simple-mode-p (not first-round-p)) ; clear only at the first time 156 );let* 157 );fi 158 (setq first-round-p nil) 159 );wend 160 );let 161 );caught 162 ) 163 ;;debug 146 )) 147 (setq first-round-p nil))))) 164 148 165 149 (defun pdicv-search-interactive () … … 174 158 (read-from-minibuffer "Word to search: ")) 175 159 (if (> (length word-to-search) 0) 176 (pdicv-search (intern dicname) word-to-search)) 177 );let 178 );caught 179 ) 180 160 (pdicv-search (intern dicname) word-to-search)) ))) 181 161 182 162 (defun pdicv-search-region (from to) … … 184 164 (interactive "r") 185 165 (let ((dicname (completing-read "Target dictionary: " pdicv-dictionary-list nil t ""))) 186 (if dicname (pdicv-search (intern dicname) (buffer-substring from to))) 187 );let 188 ) 166 (if dicname (pdicv-search (intern dicname) (buffer-substring from to))) )) 189 167 190 168 (defun pdicv-set-target-dictionary () … … 192 170 (interactive) 193 171 (let ((dicname (completing-read "Target dictionary: " pdicv-dictionary-list nil t ""))) 194 (if dicname (setq pdicv-target-dictionary (intern dicname))) 195 );let 196 ) 172 (if dicname (setq pdicv-target-dictionary (intern dicname))) )) 197 173 198 174 (defun pdicv-search-current-word () … … 204 180 (if word;(and word (not (nt:skipit-p word-to-search))) 205 181 (pdicv-search-just pdicv-target-dictionary word) 206 (message "no word at cursor")) 207 );let 208 ) 182 (message "no word at cursor")) )) 209 183 210 184 (defun pdicv-search-next-word () … … 224 198 (if (and word (not (nt:skipit-p word))) 225 199 (pdicv-search-just pdicv-target-dictionary word) 226 (message "no word at cursor"));fi 227 );progn 228 );fi 229 );let 230 ) 200 (message "no word at cursor")) )))) 231 201 232 202 (defun pdicv-search-previous-word () … … 234 204 (interactive) 235 205 (forward-word -1) ; (backward-word 1) 236 (pdicv-search-current-word) 237 ) 206 (pdicv-search-current-word)) 238 207 239 208 ;;; pdicv-search.el ends here