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

[xyzzy:03324] replace-buffer のエラー?



サイトウです。

(find-errors)の挙動を改造しています。
現在使っているコンパイラのエラー出力が、
-------------------------------------------------------------------------
        ccpsx -Xo$80010000 -g -Wall -c -O3 -D_SDEBUG -Islib -Ips main.cpp
In file included from slib\\sTask.hpp:12,
                 from main.cpp:5:
ps\\target.hpp:23: parse error before `{'
ps\\target.hpp:26: destructors must be member functions
ps\\target.hpp:28: parse error before `}'
main.cpp: In function `int main()':
main.cpp:25: `Target' undeclared (first use this function)
-------------------------------------------------------------------------
こんなんで、
"ps\\target.cpp"とかを "ps/target.cpp"とファイルを開く前に
変換したいと思って以下のようなコードを追加しました。
けれども、どうやら
 (replace-buffer "ps" "psx")
で
「不正なデータ型です: nil :string」
というエラーメッセージが出てきます。
どっか間違ってますか?

--------- errors.l 抜粋 ----------------
(defun find-errors (later)
  (let (buffer line file)
    (goto-bol)
    (while (scan-buffer *error-regexp*)
      (cond ((match-beginning 1)
             (setq file (match-string 1))
+             (save-excursion
+               (create-new-buffer "temp")
+               (switch-to-buffer "temp" t)
+               (insert (format nil "~A" file))
+               (goto-char (point-min))
+;               (replace-regexp "\\\\" "/" t)
+               (replace-buffer "ps" "psx")
+;               (message (format "~A" file))
+;               (setq file (buffer-substring (point-min) (point-max)))
+;               (delete-buffer buff)
+;               (user::debug-print "file= " file)  ; DEBUG
+             )
             (setq line (parse-integer (match-string 3))))
            (t
             (setq file (match-string 4))
             (setq line (parse-integer (match-string 6)))))
      (cond ((equal (car *last-error*) file)
             (setq buffer (cdr *last-error*))
             (return))
            ((and later (null *parse-errors-at-once*))
             (return))
            ((file-exist-p file)
             (setq buffer (get-file-buffer file))
             (unless buffer
               (save-excursion
                 (find-file file t)
                 (setq buffer (selected-buffer))))
             (setq *last-error* (cons file buffer))
             (return))
            ((setq buffer (find-buffer file))
             (setq *last-error* (cons file buffer))
             (return)))
      (unless (forward-line 1)
        (return)))
    (when buffer
      (save-excursion
        (set-buffer buffer)
        (goto-line line)
        (let ((marker (make-marker)))
          (set-marker marker)
          marker)))))

-----------------------------------
サイトウ ヒロシ
HiroshiSaito@xxxxxxx

Index Home