- 666 名前:名無しさん@お腹いっぱい。 mailto:sage [2005/10/29(土) 18:56:32 ]
- next-single-property-change が nil を返した時の処理が抜けてるせいかな。
(defun remove-invisible (s) (interactive "r") (let ((r '()) (p 0) n) (while (and (setq n (next-single-property-change p 'invisible s)) (> n p)) (unless (get-text-property p 'invisible s) (push (substring s p n) r)) (setq p n)) (unless (get-text-property p 'invisible s) (push (substring s p) r)) (apply #'concat (nreverse r)))) (remove-invisible (concat "a" (propertize "b" 'invisible 'test1) (propertize "c" 'invisible 'test2) "d")) => "ad" になる? GNU Emacs 22.0.50.2 (i386-unknown-freebsd6.0, X toolkit, Xaw3d scroll bars) of 2005-10-29 だと期待どおりの動作をするが。
|

|