Source of Nothingness - memo :

* memo :

なんか最近Lisp書いてないので書き捨ててみた
C++用
(defun foo ()
  (interactive)
  (let ((l nil))
    (save-excursion
      (goto-char (point-min))
      (while (scan-buffer "\\bstd::\\(\\sw\\|\\s_\\)+" :regexp t :no-dup t)
        (pushnew (match-string 0) l :test #'string=)))
    (dolist (x l)
      (insert (format nil "using ~a;~%" x)))))

(defun bar ()
  (interactive)
  (perform-replace "\\bstd::\\(\\(\\sw\\|\\s_\\)+\\)" "\\1" nil t nil nil))

update : 2007-03-01 (Thu) 12:26:55