unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Javier Oviedo" <email_joviedo@yahoo.com>
Subject: Re: reloading all open buffers
Date: Mon, 8 Dec 2003 11:08:31 -0500	[thread overview]
Message-ID: <br27ls$59m$1@home.itg.ti.com> (raw)
In-Reply-To: 4yr7zfqsm1.fsf@skjellgran.ii.uib.no

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

I will give this a try. Thanks!!

-- 
Javier


"Joakim Hove" <hove@bccs.no> wrote in message
news:4yr7zfqsm1.fsf@skjellgran.ii.uib.no...
>
> "Javier Oviedo" <email_joviedo@yahoo.com> writes:
>
> > Hello all. I like to call a function that would "reload" all buffers
that I
> > have open...with the exception of buffers that have been modified but
not
> > yet saved. Can someone help me out with this? Thanks in advance.
>
> This is at least a start:
>
> (defun reload-all-buffers ()
>   (interactive)
>   (dolist (buffer (buffer-list))
>     (if (and (buffer-file-name buffer)          ;; Ignoring buffers like
*scratch* and *Messages*
>      (not (buffer-modified-p buffer)))  ;; Ignoring buffers which have
been modified
> (let ((file (buffer-file-name buffer)))
>   (if (file-exists-p file)              ;; Checking that the file still
exists
>       (save-excursion
> (set-buffer buffer)
>                 (revert-buffer t t)))))))
>
>
> HTH - Joakim
>
> -- 
>   /--------------------------------------------------------------------\
>  / Joakim Hove  / hove@bccs.no  /  (55 5) 84076       |                 \
>  | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
>  | CMU                                                | 5231 Paradis    |
>  \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
>   \--------------------------------------------------------------------/

  reply	other threads:[~2003-12-08 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-08 14:15 reloading all open buffers Javier Oviedo
2003-12-08 14:41 ` Joakim Hove
2003-12-08 16:08   ` Javier Oviedo [this message]
2003-12-08 20:49 ` kgold
2003-12-09 12:42   ` Javier Oviedo
2003-12-09 16:04     ` Peter Lee

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='br27ls$59m$1@home.itg.ti.com' \
    --to=email_joviedo@yahoo.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).