Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!usc!snorkelwacker!ai-lab!pogo.ai.mit.edu!roland From: roland@ai.mit.edu (Roland McGrath) Newsgroups: comp.emacs Subject: Re: has anyone got some lisp to apply a function over all/some buffers? Message-ID: Date: 16 Aug 90 06:29:27 GMT References: <1990Aug15.172610.17351@ingres.Ingres.COM> Sender: news@wheaties.ai.mit.edu Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 26 In-reply-to: daveb@ingres.com's message of 15 Aug 90 17:26:10 GMT In article <1990Aug15.172610.17351@ingres.Ingres.COM> daveb@ingres.com (When a problem comes along . . . you must whip it) writes: I'm looking for something sort of like: (defun apply-over (buffer-regexp func) "run func in all buffers matching regexp" ... ) Ya mean like this? (defun apply-over (regexp func) (interactive "sRegexp: \naFunction: ") (let ((list (buffer-list)) (cur (current-buffer))) (while list (if (and (buffer-name (car list)) (string-match regexp (buffer-name (car list)))) (progn (set-buffer (car list)) (funcall func))) (setq list (cdr list))) (set-buffer cur))) -- Roland McGrath Free Software Foundation, Inc. roland@ai.mit.edu, uunet!ai.mit.edu!roland