Changeset 71 for lang/elisp/pdicv-mode/trunk/pdicv-core.el
- Timestamp:
- 01/30/09 23:52:02 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/pdicv-mode/trunk/pdicv-core.el
r67 r71 1 1 ;;; pdicv-core.el --- core functions for PDIC-formatted dictionaries 2 2 ;; 3 ;; Copyright (C) 2005 Naoya TOZUKA. All Rights Reserved.3 ;; Copyright (C) 2005-2009 naoya_t. All Rights Reserved. 4 4 ;; 5 ;; Author: Naoya TOZUKA <pdicviewer@gmail.com> 6 ;; Maintainer: Naoya TOZUKA <pdicviewer@gmail.com> 7 ;; Primary distribution site: http://pdicviewer.naochan.com/el/ 5 ;; Author: naoya_t <naoya.t@aqua.plala.or.jp> 6 ;; Maintainer: naoya_t <naoya.t@aqua.plala.or.jp> 7 ;; Primary distribution site: 8 ;; http://lambdarepos.svnrepository.com/svn/share/lang/elisp/pdicv-mode/trunk 8 9 ;; 9 10 ;; Created: 14 Feb 2005 10 ;; Last modified: 23 Dec 200511 ;; Version: 0.9. 112 ;; Keywords: PDIC dictionary search 11 ;; Last modified: 30 Jan 2009 12 ;; Version: 0.9.2 13 ;; Keywords: PDIC dictionary search eijiro 13 14 14 15 (provide 'pdicv-core) 15 ;(put 'pdicv-core 'version "0.9. 1")16 ;(put 'pdicv-core 'version "0.9.2") 16 17 17 18 ;;; Commentary: 18 19 19 20 ; (pdicv-get-header-info FILENAME) 20 ; - �إå���� 21 ; - ��ؒ�Ò���������ߒ�蒤� 22 ; (pdicv-get-index-list FILENAME [WORD-ENCODING]) 23 ; - PDIC��������������뒤���钡���������Ò�������꒥���Ȓ���� 21 24 ; 22 ; (pdicv-get-index-list FILENAME [WORD-ENCODING])23 ; - PDIC��������뤫�顢����å����ꥹ�Ȥ��;24 25 ; (pdicv-scan-datablock FILENAME PHYS CRITERIA-FUNC) 25 ; - �ǡ����֥������� 26 ; - ��ǒ�������֒�풥Ò���������㒥�; (pdicv-core-search DICINFO CRITERIA [SIMPLE-MODE-P DONT-CLEAR-P]) 27 ; - PDIC��������������뒡������ 26 28 ; 27 ; (pdicv-core-search DICINFO CRITERIA [SIMPLE-MODE-P DONT-CLEAR-P])28 ; - PDIC��������롼���;29 29 30 30 ;;; Code: … … 49 49 (defvar pdicv-result-height 8) 50 50 ; 51 ; �إå���� 52 ; 51 ; ��ؒ�Ò���������ߒ�蒤� 53 52 (defun pdicv-get-header-info (filename) 54 53 "[PDIC] Get Header Info" … … 56 55 (let* ((header-buf (nt:read-from-file filename 0 256)) 57 56 ; 58 (headername nil); (substring header-buf 1 100))59 (dictitle nil); (substring header-buf 101 140))57 (headername nil); (substring header-buf 1 100)) 58 (dictitle nil); (substring header-buf 101 140)) 60 59 (version (nt:read-short header-buf 140)) 61 60 (lword (nt:read-short header-buf 142)) … … 85 84 86 85 (setq version 87 (nth major-version '(not-supported not-supported newdic1 newdic2 newdic3 newdic4 )))86 (nth major-version '(not-supported not-supported newdic1 newdic2 newdic3 newdic4 unicode-bocu-6))) 88 87 89 88 (setq dicorder 90 89 (nth (nt:read-uchar header-buf 164) '(code-order ignore-case dictionary-order order-descendant))) 91 90 92 (if (> (logand dictype 128) 0) (setq dictype* (cons 'tree-view-mode dictype*))) 93 (if (> (logand dictype 64) 0) (setq dictype* (cons 'crypted dictype*))) 94 ; (if (> (logand dictype 32) 0) (setq dictype* (cons 'multilingual dictype*))) 95 (if (> (logand dictype 16) 0) (setq dictype* (cons 'unicode dictype*))) 96 (if (> (logand dictype 8) 0) (setq dictype* (cons 'bocu dictype*))) 97 (if (> (logand dictype 1) 0) (setq dictype* (cons 'ar-compressed dictype*))) 98 99 (if (= major-version 5) 100 (progn "HyperDIC, Ver 5.00" 101 (setq os (nt:read-char header-buf 167)) 102 (setq os (cond ((= os 0) 'sjis-crlf) 103 ((= os 1) 'sjis-cr) 104 ((= os 2) 'sjis-lf) 105 ((= os 3) 'euc-lf) 106 ((= os 4) 'jis-lf) 107 ((= os 32) 'bocu) 108 )) 109 (if (eq os 'bocu) (setq bocu t)) 110 (setq olenumber (nt:read-long header-buf 168)) 111 ;(setq lid-word (short header-buf 172)) 112 ;(setq lid-japa (short header-buf 174)) 113 ;(setq lid-exp (short header-buf 176)) 114 ;(setq lid-pron (short header-buf 178)) 115 ;(setq lid-other (short header-buf 180)) 116 (setq index-blkbit (if (= (nt:read-uchar header-buf 182) 1) 32 16)) 117 ; dummy0 @185 118 (setq extheader (nt:read-ulong header-buf 184)) 119 (setq empty-block (nt:read-long header-buf 188)) ;overwrite 120 (setq nindex (nt:read-long header-buf 192)) ;overwrite 121 (setq nblock (nt:read-long header-buf 196)) ;overwrite 122 (setq datablock-size (* nblock block-size)) 123 (setq cypt (substring header-buf 200 208)) ;- reserved[8] 124 (setq update-count (nt:read-ulong header-buf 208)) 91 (when (> (logand dictype 128) 0) (setq dictype* (cons 'tree-view-mode dictype*))) 92 (when (> (logand dictype 64) 0) (setq dictype* (cons 'crypted dictype*))) 93 ; (when (> (logand dictype 32) 0) (setq dictype* (cons 'multilingual dictype*))) 94 (when (> (logand dictype 16) 0) (setq dictype* (cons 'unicode dictype*))) 95 (when (> (logand dictype 8) 0) (setq dictype* (cons 'bocu dictype*))) 96 (when (> (logand dictype 1) 0) (setq dictype* (cons 'ar-compressed dictype*))) 97 98 (case major-version 99 (6 "Ver 6.xx" 100 (setq os (nt:read-char header-buf 167)) 101 (setq os (cond ((= os 0) 'sjis-crlf) 102 ((= os 1) 'sjis-cr) 103 ((= os 2) 'sjis-lf) 104 ((= os 3) 'euc-lf) 105 ((= os 4) 'jis-lf) 106 ((= os 32) 'bocu) 107 )) 108 (when (eq os 'bocu) (setq bocu t)) 109 (setq olenumber (nt:read-long header-buf 168)) 110 ;; dummy_lid, 10 bytes 111 (setq index-blkbit (if (= (nt:read-uchar header-buf 182) 1) 32 16)) 112 ;; dummy0 @185 113 (setq extheader (nt:read-ulong header-buf 184)) 114 (setq empty-block (nt:read-long header-buf 188)) ;overwrite 115 (setq nindex (nt:read-long header-buf 192)) ;overwrite 116 (setq nblock (nt:read-long header-buf 196)) ;overwrite 117 (setq datablock-size (* nblock block-size)) 118 (setq cypt (substring header-buf 200 208)) ;- reserved[8] 119 (setq update-count (nt:read-ulong header-buf 208)) 125 120 ; dummy00 @212[4] 126 121 (setq dicident (substring header-buf 216 224)) 127 122 ;(setq dummy (substring header-buf 224 256)) 128 (setq index-size (* index-block block-size)) ;overwrite 129 130 );progn 131 (progn "< 5.0" 132 (if (>= major-version 3) 133 (progn "NEWDIC2-" 134 (setq olenumber (nt:read-long header-buf 167)) 123 (setq index-size (* index-block block-size)) ;overwrite 124 );6 125 (5 "HyperDIC, Ver 5.00" 126 (setq os (nt:read-char header-buf 167)) 127 (setq os (cond ((= os 0) 'sjis-crlf) 128 ((= os 1) 'sjis-cr) 129 ((= os 2) 'sjis-lf) 130 ((= os 3) 'euc-lf) 131 ((= os 4) 'jis-lf) 132 ((= os 32) 'bocu) 133 )) 134 (when (eq os 'bocu) (setq bocu t)) 135 (setq olenumber (nt:read-long header-buf 168)) 136 (setq index-blkbit (if (= (nt:read-uchar header-buf 182) 1) 32 16)) 137 ;; dummy0 @185 138 (setq extheader (nt:read-ulong header-buf 184)) 139 (setq empty-block (nt:read-long header-buf 188)) ;overwrite 140 (setq nindex (nt:read-long header-buf 192)) ;overwrite 141 (setq nblock (nt:read-long header-buf 196)) ;overwrite 142 (setq datablock-size (* nblock block-size)) 143 (setq cypt (substring header-buf 200 208)) ;- reserved[8] 144 (setq update-count (nt:read-ulong header-buf 208)) 145 ; dummy00 @212[4] 146 (setq dicident (substring header-buf 216 224)) 147 ;(setq dummy (substring header-buf 224 256)) 148 (setq index-size (* index-block block-size)) ;overwrite 149 );5 150 (t "< 5.0" 151 (when (>= major-version 3) 152 "NEWDIC2-" 153 (setq olenumber (nt:read-long header-buf 167)) 135 154 ;(setq os (byte (substring header-buf 172 173))) 136 155 (setq os (nth (nt:read-char header-buf 171) '(sjis-crlf))) 137 156 ;(setq lid-word (short header-buf 172)) 138 157 ;(setq lid-japa (short header-buf 174)) … … 140 159 ;(setq lid-pron (short header-buf 178)) 141 160 ;(setq lid-other (short header-buf 180)) 142 ))143 (if(>= major-version 4)144 (progn"NEWDIC3-"145 146 147 148 149 150 151 152 161 ) 162 (when (>= major-version 4) 163 "NEWDIC3-" 164 (setq extheader (nt:read-ulong header-buf 182)) 165 (setq empty-block (nt:read-long header-buf 186)) ;overwrite 166 (setq nindex (nt:read-long header-buf 190)) ;overwrite 167 (setq nblock (nt:read-long header-buf 194)) ;overwrite 168 (setq datablock-size (* nblock block-size)) 169 (setq index-blkbit (if (= (nt:read-uchar header-buf 198) 1) 32 16)) 170 (setq cypt (substring header-buf 200 208)) 171 (setq update-count (nt:read-ulong header-buf 207)) 153 172 ;(setq dummy (substring header-buf 212 256)) 154 (setq index-size (* index-block block-size)) ;overwrite 155 )) 156 ); < 5.0 157 );fi 158 173 (setq index-size (* index-block block-size)) ;overwrite 174 ) 175 )); esac 159 176 (list 160 177 ; (cons 'headername headername) ; … … 189 206 (cons 'datablock-ends-at (+ header-size extheader index-size datablock-size)) 190 207 (cons 'datablock-size datablock-size) 191 (cons 'bocu bocu) 192 ); list 193 ); let* 194 ); caught 195 ) 208 (cons 'bocu bocu))))) 196 209 197 210 (defun pdicv-get-index-list (filename &optional word-encoding) 198 211 "[PDICV] Get the index list from PDIC file" 199 (let* ( 200 (header (pdicv-get-header-info filename)) 212 (let* ((header (pdicv-get-header-info filename)) 201 213 (index-buf (nt:read-from-file filename 202 214 (-> header 'index-begins-at) (-> header 'index-size))) 203 215 204 216 (32bit-address-mode (if (= (-> header 'index-blkbit) 32) t nil)) 217 (tab-sep-p (if (eq 'unicode-bocu-6 (-> header 'version)) t nil)) 205 218 206 219 (ix 0) (ix-max (-> header 'nindex)) 207 220 (ofs 0) 208 (index-list ()) 209 ) 210 221 (index-list ())) 211 222 (while (< ix ix-max) 212 223 (let ((phys -1) (word "") (word* nil)) 213 224 (if 32bit-address-mode 214 (progn (setq phys (nt:read-ulong index-buf ofs)) (setq ofs (+ ofs 4))) 215 (progn (setq phys (nt:read-ushort index-buf ofs)) (setq ofs (+ ofs 2))) 216 ) 225 (progn (setq phys (nt:read-ulong index-buf ofs)) 226 (setq ofs (+ ofs 4))) 227 (progn (setq phys (nt:read-ushort index-buf ofs)) 228 (setq ofs (+ ofs 2)))) 217 229 (setq word* (nt:read-cstring index-buf ofs)) (setq ofs (+ ofs (cdr word*) 1)) 218 230 (setq word (car word*)) 231 232 (when tab-sep-p 233 (let ((tsv (split-string word "\t"))) 234 (when (consp tsv) 235 (setq word (car tsv))))) 219 236 ; (cond 220 237 ; ((eq word-encoding 'bocu) … … 229 246 (push (cons phys word) index-list) 230 247 (setq ix (1+ ix)) 231 );let 232 ) 233 (nreverse index-list) 234 ) 235 ) 248 )) 249 (nreverse index-list) )) 236 250 237 251 (defface pdicv-face-dummy … … 255 269 256 270 (defvar pdicv-default-inserter 257 258 259 271 (lambda (eword pron jword example) 272 (progn 273 (set-text-properties 0 (length eword) '(face bold) eword) 260 274 ; (set-text-properties 0 (length eword) '(face pdicv-face-caption-green) eword) 261 275 ; (set-text-properties 0 (length jword) '(face pdicv-face-caption-gray) jword) 262 276 263 (setq jword (nt:replace-all jword "����/ "))264 265 266 267 268 (if(string< "" pron) (setq buf (concat buf " [" pron "]")))277 (setq jword (nt:replace-all jword "������/ ")) 278 (setq jword (nt:replace-all jword "\n" "\n ")) 279 280 (let ((buf "")) 281 (setq buf eword) 282 (when (string< "" pron) (setq buf (concat buf " [" pron "]"))) 269 283 ; (setq result (concat result " : " jword)) 270 271 (if (string< "" example) (setq buf (concat buf "\n - " example))284 (setq buf (concat buf "\n " jword)) 285 (when (string< "" example) (setq buf (concat buf "\n - " example))) 272 286 ; (setq buf (concat buf "\n")) 273 )274 287 ; (setq buf (concat buf "\n\n")) 275 (setq buf (concat buf "\n")) 276 277 (insert buf) 278 ); let 279 ); progn 280 );lambda 281 ) 288 (setq buf (concat buf "\n")) 289 290 (insert buf))))) 282 291 ;; 283 292 ;; … … 285 294 (defun pdicv-scan-datablock (filename phys criteria-func) 286 295 "[PDICV] scan a datablock" 287 ; (insert (format "pdicv-scan-datablock (%s %d ...)\n" filename phys))288 296 (catch 'pdicv-scan-datablock 289 297 (let* ((result ()) ;(match-count 0) 290 298 (header (pdicv-get-header-info filename)) 291 (offset (+ (-> header 'datablock-begins-at) (lsh phys 8))) 292 (aligned (if (eq (-> header 'version) 'newdic4) t nil)) 293 ; (bocu (-> header 'bocu)) 299 (block-size (-> header 'block-size)) 300 (offset (+ (-> header 'datablock-begins-at) (* phys block-size))) 301 (aligned (and (member (-> header 'version) '(newdic4 unicode-bocu-6)) t)) 302 ;; (bocu (-> header 'bocu)) 294 303 (head-word (nt:read-ushort (nt:read-from-file filename offset 2))) 295 304 (blocks (logand 32767 head-word)) 296 (block-length (- ( lsh blocks 8) 2))305 (block-length (- (* blocks block-size) 2)) 297 306 (field-size (if (zerop (logand 32768 head-word)) 2 4)) 298 307 (datablock (nt:read-from-file filename (+ offset 2) block-length)) 299 308 ; (list blocks field-size datablock) 300 309 (p 0) 301 310 (field-length 0) 302 311 (compress-length 0) 303 312 (rest nil) … … 308 317 (setq field-length 309 318 (if (= field-size 2) (nt:read-ushort datablock p) (nt:read-ulong datablock p)) ) 310 ( if(zerop field-length) (throw 'pdicv-scan-datablock (nreverse result))); sfield-list))311 (setq p (+ p field-size)) ;2� ʤ���4�Х��� (setq compress-length (nt:read-uchar datablock p)) ; �����319 (when (zerop field-length) (throw 'pdicv-scan-datablock (nreverse result))); sfield-list)) 320 (setq p (+ p field-size)) ;2��ʒ�����4��В����� (setq compress-length (nt:read-uchar datablock p)) ; �����̒Ĺ 312 321 (setq p (1+ p)) 313 322 314 (if aligned (progn 315 (setq eword-attrib (nt:read-uchar datablock p)) ; ���Ф���� 316 (setq p (1+ p)) 317 )) 318 ; ���Ф����ߤ�ꤢ���� rest ����� 319 (setq rest (substring datablock p (+ p field-length))) 323 (when aligned 324 (setq eword-attrib (nt:read-uchar datablock p)) ; �����В�������� 325 (setq p (1+ p))) 326 ; �����В����쒰ʒ�ߒ����꒤������� rest ��˒���쒤� (setq rest (substring datablock p (+ p field-length))) 320 327 (setq p (+ p field-length)) 321 ; ��� Ф���NULL��ü)328 ; �����В�����NULL����ü) 322 329 (let* ((eword-cstr (nt:read-cstring rest)) 323 330 (eword-compressed (car eword-cstr)) (eword-len (cdr eword-cstr)) … … 327 334 (jword-cstr nil) (jword "") (jword-len 0) 328 335 (ext-list nil) 329 (example "") (pron "") (link "") 330 ) 336 (example "") (pron "") (link "")) 331 337 332 338 (setq eword (if (zerop compress-length) 333 339 eword-compressed 334 (concat (substring eword 0 compress-length) eword-compressed) 335 )) 340 (concat (substring eword 0 compress-length) eword-compressed) )) 336 341 (setq q (1+ eword-len)) 337 ; ��� Ф����338 ( if (not aligned) (progn339 340 (setq q (1+ q))341 )) 342 ; �����В�������� 343 (when (not aligned) 344 (setq eword-attrib (nt:read-uchar rest q)) 345 (setq q (1+ q))) 346 342 347 (setq level (logand eword-attrib 15)) 343 348 ; (insert (format ": %s %d %d\n" eword eword-len eword-attrib)) … … 348 353 (setq extended (if (zerop (logand eword-attrib 16)) nil t)) 349 354 (if extended 350 (progn ;�� �355 (progn ;��Ȓĥ 351 356 (setq jword-cstr (nt:read-cstring rest q)) 352 357 (setq jword (car jword-cstr)) (setq jword-len (cdr jword-cstr)) … … 359 364 (exdata-cstr nil) 360 365 (exdata "") (exdata-len 0) ) 361 ( if(= (logand ex-attrib 128) 128) (throw 'while t))366 (when (= (logand ex-attrib 128) 128) (throw 'while t)) 362 367 (setq q (1+ q)) 363 368 (setq exdata-cstr (nt:read-cstring rest q)) … … 374 379 ) ; catch while2 375 380 ) ; progn 376 (progn ; ɸ�� (setq jword (substring rest q))381 (progn ;�ɸ��� (setq jword (substring rest q)) 377 382 (setq pron "") 378 (setq example "") 379 ) ; progn 383 (setq example "")) 380 384 ) ; if extended 381 385 382 386 ; (insert (format "- %s\n" eword)) 383 ( if(funcall criteria-func eword pron jword example)384 387 (when (funcall criteria-func eword pron jword example) 388 (push (list eword pron jword example) result)) 385 389 );let 386 390 ); wend 387 (nreverse result) 388 ); let* 389 ) ;catch(0) 390 ) 391 (nreverse result)))) 391 392 392 393 (defun pdicv-core-search (dicinfo criteria &optional simple-mode-p dont-clear-p) … … 396 397 (encoding-list (nth 2 dicinfo)) 397 398 (decoder-list ()) 398 (index-table (-> pdicv-index-table-list dicname)) 399 ) 399 (index-table (-> pdicv-index-table-list dicname))) 400 400 ; (if (null index-table) (setq index-table (pdicv-get-index-list dicfile))) 401 401 402 ( if(atom encoding-list) ;; expand encoding-list403 402 (when (atom encoding-list) ;; expand encoding-list 403 (setq encoding-list (list encoding-list encoding-list encoding-list encoding-list))) 404 404 405 405 (while encoding-list ;; build the decoder-list … … 410 410 ((eq encoding 'latin1) (push pdicv-latin1-decoder decoder-list)) 411 411 (encoding (push (pdicv-create-decoder encoding) decoder-list)) 412 (t (push pdicv-null-decoder decoder-list)) 413 );cond 414 );let 415 (setq encoding-list (cdr encoding-list)) 416 );wend 412 (t (push pdicv-null-decoder decoder-list)))) 413 (setq encoding-list (cdr encoding-list))) 417 414 (setq decoder-list (nreverse decoder-list)) 418 415 … … 434 431 (ix index-table) (index-size (length ix)) (curr-size index-size) 435 432 (ix+ (cadr ix)); next one 436 (match-count 0) 437 ) 433 (match-count 0)) 438 434 439 435 ; (switch-to-buffer pdicv-buffer-name) 440 436 (save-current-buffer 441 437 (set-buffer pdicv-buffer) 442 (if (null dont-clear-p) (erase-buffer)) 443 444 (if (not simple-mode-p) 445 (progn 438 (when (null dont-clear-p) (erase-buffer)) 439 440 (when (not simple-mode-p) 446 441 ;(pop-to-buffer pdicv-buffer-name) 447 442 ; (set-buffer pdicv-buffer-name) 448 (insert (format "�����%s\n" word-to-search))449 (insert (format "�����: ????\n"))450 443 (insert (format "��������� %s\n" word-to-search)) 444 (insert (format "��������???\n")) 445 (newline)) 451 446 ;(insert "\n")) 452 ) 453 (if index-needles 454 (setq ix 455 (let ((p ix) (last-p nil)) 456 (catch 'pdicv-search-in-index 457 (while p 458 (let* ((elem (car p)) 459 ;(phys (car elem)) 460 (word (cdr elem)) ) 461 462 (if (string< needle1 word) (throw 'pdicv-search-in-index last-p)) 463 ; (if (string< needle2 word) (throw 'pdicv-search-in-index last-p)) 464 447 (when index-needles 448 (setq ix 449 (let ((p ix) (last-p nil)) 450 (catch 'pdicv-search-in-index 451 (while p 452 (let* ((elem (car p)) ;(phys (car elem)) 453 (word (cdr elem))) 454 (if (string< needle1 word) (throw 'pdicv-search-in-index last-p)) 455 ;; (if (string< needle2 word) (throw 'pdicv-search-in-index last-p)) 465 456 (setq last-p p) 466 (setq p (cdr p)) 467 ); let 468 ); wend 469 last-p 470 ); caught 471 472 ); let 473 )) 474 457 (setq p (cdr p)) )) 458 last-p)))) 475 459 (catch 'while 476 460 (while ix 477 461 (let* ((curr (car ix)) 478 462 (phys (car curr)) (word (cdr curr)) 479 463 ;; (x (insert (format "* current ix: (%d %s)\n" phys word))) 480 464 (result (pdicv-scan-datablock dicfile phys datablock-criteria-func)); decoder-list nil)) 481 465 (result-count (length result)) 482 (inserter pdicv-default-inserter) 483 ) 484 485 (if index-needles 486 (if (string>= word needle2) (throw 'while t))) 487 ; (if (not (string< word (cdr index-needles))) (throw 'while t))) 466 (inserter pdicv-default-inserter)) 467 (when index-needles 468 (when (string>= word needle2) (throw 'while t))) 469 ;; (if (not (string< word (cdr index-needles))) (throw 'while t))) 488 470 489 471 ; (insert (format "(%s with index %s ... %s)\n" … … 501 483 ) 502 484 (setq match-count (1+ match-count)) 503 ) 504 );wend 485 )) 505 486 (message "%5d/%5d:%7d" curr-size index-size match-count) 506 (sit-for 0) 507 ) 508 (progn ;else 509 (if (zerop (% curr-size 128)) ;;128�����ʿ� (message "%5d/%5d:%7d" curr-size index-size match-count)) 510 ));fi 511 );let* 487 (sit-for 0)) 488 ;;else 489 (when (zerop (% curr-size 128)) ;;128��ϒŬ����ʒ�� (message "%5d/%5d:%7d" curr-size index-size match-count)))) 512 490 (setq ix (cdr ix)) 513 491 (setq curr-size (1- curr-size)) … … 515 493 );caught 516 494 517 495 ;;(insert (pdicv-scan-datablock dicfile (car (car ix)) decoder-list nil needle1 needle2)) 518 496 (goto-char 1) 519 497 520 (if (not simple-mode-p) 521 (if (re-search-forward ": [?][?][?][?]" nil t nil) 522 (replace-match (format ": %d" match-count) t t nil 0)) 523 );fi 524 498 (when (not simple-mode-p) 499 (when (re-search-forward ": [?][?][?][?]" nil t nil) 500 (replace-match (format ": %d" match-count) t t nil 0))) 525 501 ); save-current-buffer 526 502 527 503 ; (pop-to-buffer (current-buffer)) 528 504 ; (setq split-height-threshold 6) 529 (if (one-window-p) 530 (set-window-buffer (split-window-vertically (- pdicv-result-height)) pdicv-buffer) 531 ) 532 ); let* 533 ); caught 534 );let* 535 ) 505 (when (one-window-p) 506 (set-window-buffer (split-window-vertically (- pdicv-result-height)) pdicv-buffer)) 507 )))) 536 508 537 509 ;;; pdicv-core.el ends here