all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
Subject: Re: Search and replace in all buffers
Date: Mon, 23 Jan 2006 04:28:22 +0200	[thread overview]
Message-ID: <861wyzbruh.fsf@flame.pc> (raw)
In-Reply-To: mailman.2152.1137968793.26925.help-gnu-emacs@gnu.org

On Sun, 22 Jan 2006 14:23:43 -0800 (PST),
"AndyJB (sent by Nabble.com)" <lists@nabble.com> wrote:
>   Drew Adams wrote:
>   http://www.emacswiki.org/cgi-bin/wiki/CategorySearchAndReplace
>
> Thanks - there are a couple of things there that might be close to what
> I'm looking for - grep-buffers and moccur-edit look useful. I'll give them
> a try. It surprises me that something this obvious (to me) isn't part of
> standard Emacs - other editors I've used before moving to Emacs had it.

It's easy enough to implement with something like this, though:

| (dolist (elt (mapcar (function buffer-name) (buffer-list)) nil)
|   (save-current-buffer
|     (set-buffer elt)
|     (if (not buffer-read-only)
|       (progn ...))))

A friend of mine used the following to reindent many XML/HTML files and
was kind enough to share it:

| (defun indent-all-buffers ()
|   "Reindent all currently open buffers, as long as they are
| not read-only.  Read-only buffers are simply skipped."
|   (interactive)
|   (dolist (elt (mapcar (function buffer-name) (buffer-list)) nil)
|     (save-current-buffer
|       (set-buffer elt)
|       (if (not buffer-read-only)
|           (indent-region (point-min) (point-max) nil))))

  parent reply	other threads:[~2006-01-23  2:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-22 16:57 Serach and replace in all buffers AndyJB (sent by Nabble.com)
2006-01-22 19:40 ` Drew Adams
2006-01-22 22:23   ` Search " AndyJB (sent by Nabble.com)
2006-01-23  0:31     ` AndyJB (sent by Nabble.com)
     [not found]   ` <mailman.2152.1137968793.26925.help-gnu-emacs@gnu.org>
2006-01-23  2:28     ` Giorgos Keramidas [this message]
2006-01-22 19:57 ` Serach " Eli Zaretskii
2006-01-22 22:33   ` Search " AndyJB (sent by Nabble.com)
2006-01-24 17:07     ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861wyzbruh.fsf@flame.pc \
    --to=keramida@ceid.upatras.gr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.