From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Missing `with' macro? Date: Mon, 24 Jul 2006 09:46:42 -0400 Message-ID: References: <7dbe73ed0607240317g1bcdd564g66d075f809bcb7b2@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1153748848 19234 80.91.229.2 (24 Jul 2006 13:47:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Jul 2006 13:47:28 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 24 15:47:25 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G50m0-0005Nv-2K for ged-emacs-devel@m.gmane.org; Mon, 24 Jul 2006 15:47:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G50lz-0006ZF-Id for ged-emacs-devel@m.gmane.org; Mon, 24 Jul 2006 09:47:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G50lm-0006X8-Rc for emacs-devel@gnu.org; Mon, 24 Jul 2006 09:46:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G50ll-0006Us-BN for emacs-devel@gnu.org; Mon, 24 Jul 2006 09:46:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G50ll-0006Uf-8j for emacs-devel@gnu.org; Mon, 24 Jul 2006 09:46:49 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G50mr-0002MB-7d for emacs-devel@gnu.org; Mon, 24 Jul 2006 09:47:57 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id B864B2CEB7A; Mon, 24 Jul 2006 09:46:48 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 9B2CA445C; Mon, 24 Jul 2006 09:46:42 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 879104C6DEA; Mon, 24 Jul 2006 09:46:42 -0400 (EDT) Original-To: "Mathias Dahl" In-Reply-To: <7dbe73ed0607240317g1bcdd564g66d075f809bcb7b2@mail.gmail.com> (Mathias Dahl's message of "Mon, 24 Jul 2006 12:17:29 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57533 Archived-At: > (setq buf (find-file tumme-db-file)) > ;; do a lot of stuff in it > (save-buffer) ;; optionally > (kill-buffer buf) Just for the record, the above code will bomb out if the current window is a minibuffer or is dedicated: Always prefer find-file-noselect to find-file. Stefan "whose windows are all dedicated or minibuffers" PS: Regarding with-file, it would be nice, but please make sure it can be used also when you just want to read the file, and also when you specifically don't want the major mode to be set, and also when you do want the major mode to be set, and also be careful not to kill a pre-existing buffer inadvertently, ...