Changeset 15197 for lang/elisp

Show
Ignore:
Timestamp:
07/05/08 16:56:12 (5 months ago)
Author:
imakado
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/anything-c-dabbrev/anything-c-dabbrev.el

    r15194 r15197  
    2020 
    2121;;; Commentary: 
    22 ;; 注意: このコードはコンセプトコードみたいなものです。 
     22;; 注意: このコードはコンセプトコードです。 
    2323 
    2424;; 設定サンプル 
     
    104104                                    (* (regexp ,dabbrev--abbrev-char-regexp)))))) 
    105105        (hash (make-hash-table :test 'equal)) 
    106         (ret nil)) 
     106        (ret nil) 
     107        (cur-point (point))) 
    107108     
    108109    (save-excursion 
    109       (goto-char (point-min)) 
    110       (loop always (re-search-forward re nil t) 
    111             do (puthash (match-string-no-properties 0) nil hash)) ;uniq 
    112  
     110      (let ((ret nil)) 
     111        (goto-char (point-min)) 
     112        (loop always (re-search-forward re cur-point t) 
     113              do (push (match-string-no-properties 0) ret)) 
     114 
     115        (mapc (lambda (s) 
     116                (unless (gethash s hash) 
     117                  (puthash s nil hash))) 
     118              ret)) 
     119       
     120      (let ((ret nil)) 
     121        (goto-char cur-point) 
     122        (loop always (re-search-forward re nil t) 
     123              do (push (match-string-no-properties 0) ret)) 
     124         
     125        (mapc (lambda (s) 
     126                (unless (gethash s hash) 
     127                  (puthash s nil hash))) 
     128              (nreverse ret))) 
     129 
     130 
     131       
    113132      (maphash (lambda (symbol-str ignore-value) 
    114133                 (push symbol-str ret)) 
     
    125144 
    126145      (insert 
    127        (mapconcat 'identity ret "\n"))))) 
     146       (mapconcat 'identity (nreverse ret) "\n"))))) 
    128147 
    129148(defun anything-c-dabbrev-buf-match (list-of-regexp &optional buffer)