unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* reloading all open buffers
@ 2003-12-08 14:15 Javier Oviedo
  2003-12-08 14:41 ` Joakim Hove
  2003-12-08 20:49 ` kgold
  0 siblings, 2 replies; 6+ messages in thread
From: Javier Oviedo @ 2003-12-08 14:15 UTC (permalink / raw)


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.

-- 
Javier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: reloading all open buffers
  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
  2003-12-08 20:49 ` kgold
  1 sibling, 1 reply; 6+ messages in thread
From: Joakim Hove @ 2003-12-08 14:41 UTC (permalink / raw)



"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     /
  \--------------------------------------------------------------------/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: reloading all open buffers
  2003-12-08 14:41 ` Joakim Hove
@ 2003-12-08 16:08   ` Javier Oviedo
  0 siblings, 0 replies; 6+ messages in thread
From: Javier Oviedo @ 2003-12-08 16:08 UTC (permalink / raw)


[-- 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     /
>   \--------------------------------------------------------------------/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: reloading all open buffers
  2003-12-08 14:15 reloading all open buffers Javier Oviedo
  2003-12-08 14:41 ` Joakim Hove
@ 2003-12-08 20:49 ` kgold
  2003-12-09 12:42   ` Javier Oviedo
  1 sibling, 1 reply; 6+ messages in thread
From: kgold @ 2003-12-08 20:49 UTC (permalink / raw)


"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.

If you want it to happen automatically, try autorevert mode.

-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: reloading all open buffers
  2003-12-08 20:49 ` kgold
@ 2003-12-09 12:42   ` Javier Oviedo
  2003-12-09 16:04     ` Peter Lee
  0 siblings, 1 reply; 6+ messages in thread
From: Javier Oviedo @ 2003-12-09 12:42 UTC (permalink / raw)


I am familiar with auto-revert mode. It is nifty but I only want it to
happen at selected times. Thanks anyway.

-- 
Javier


"kgold" <kgold@watson.ibm.com> wrote in message
news:br2o4e$bci$1@news.btv.ibm.com...
> "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.
>
> If you want it to happen automatically, try autorevert mode.
>
> --

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: reloading all open buffers
  2003-12-09 12:42   ` Javier Oviedo
@ 2003-12-09 16:04     ` Peter Lee
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Lee @ 2003-12-09 16:04 UTC (permalink / raw)


>>>> Javier Oviedo writes:

    Javier> I am familiar with auto-revert mode. It is nifty but I
    Javier> only want it to happen at selected times. Thanks anyway.

If you use ibuffer (which comes with cvs), you can mark the buffers
you want reverted and press 'V'.

  'V' - Revert the marked buffers.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-09 16:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2003-12-08 20:49 ` kgold
2003-12-09 12:42   ` Javier Oviedo
2003-12-09 16:04     ` Peter Lee

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).