From: Nikolaj Schumacher <me@nschum.de>
To: Michal <rabbitko@tenbit.pl>
Cc: help-gnu-emacs@gnu.org
Subject: Re: elisp: howto save not-visible buffer
Date: Sat, 25 Apr 2009 08:49:32 +0200 [thread overview]
Message-ID: <m2zle5tegz.fsf@nschum.de> (raw)
In-Reply-To: <m2zle6w1pz.fsf@tenbit.pl> (Michal's message of "Fri, 24 Apr 2009 16:44:24 +0200")
Michal <rabbitko@tenbit.pl> wrote:
> can I save buffer that is not current one?
>
> something like that:
> (setq buf (find-file-noselect "/some/file"))
> (save-buffer buf)
(with-current-buffer (find-file-noselect "/some/file"))
(save-buffer))
But what you really want to do is probably:
(let ((buf (find-buffer-visiting "/some-file")))
(when buf
(with-current-buffer buf
(save-buffer))))
Because you probably don't want to find the file if it isn't already
open.
regards,
Nikolaj Schumacher
next prev parent reply other threads:[~2009-04-25 6:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-24 14:44 elisp: howto save not-visible buffer Michal
2009-04-24 20:14 ` Anselm Helbig
2009-04-25 6:49 ` Nikolaj Schumacher [this message]
2009-04-27 10:45 ` Michal
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=m2zle5tegz.fsf@nschum.de \
--to=me@nschum.de \
--cc=help-gnu-emacs@gnu.org \
--cc=rabbitko@tenbit.pl \
/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.