From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Lewan Newsgroups: gmane.emacs.help Subject: RE: I want an unsaveable buffer Date: Tue, 5 Aug 2014 13:22:14 +0000 Message-ID: <155DEC68569B714B86C2C7075F5EDA9892B101AA@DAKIYA1.pegasus.local> References: <155DEC68569B714B86C2C7075F5EDA9892B0FA07@DAKIYA1.pegasus.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407244977 6864 80.91.229.3 (5 Aug 2014 13:22:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2014 13:22:57 +0000 (UTC) To: Kevin Rodgers , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 05 15:22:40 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XEehK-0006FV-96 for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 15:22:38 +0200 Original-Received: from localhost ([::1]:59439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEehH-0000kp-Mp for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Aug 2014 09:22:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEeh2-0000jt-0K for help-gnu-emacs@gnu.org; Tue, 05 Aug 2014 09:22:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEegx-0006nL-0x for help-gnu-emacs@gnu.org; Tue, 05 Aug 2014 09:22:19 -0400 Original-Received: from webmail.shubertorg.com ([207.246.209.200]:29137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEegw-0006mX-T1 for help-gnu-emacs@gnu.org; Tue, 05 Aug 2014 09:22:14 -0400 Original-Received: from dakiya1.pegasus.local ([172.16.208.201]) by DAKIYA1.pegasus.local ([172.16.208.201]) with mapi id 14.02.0247.003; Tue, 5 Aug 2014 09:22:15 -0400 Thread-Topic: I want an unsaveable buffer Thread-Index: Ac+v+35LHSww/yjYQ0GmmhfGFA6CnwAlBxwAAAgfwbA= In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.21.202] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 207.246.209.200 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99093 Archived-At: Thanks for the suggestion. I'm not fluent in advice, but it has on occasion= been very useful. I'll study this. ,Doug Douglas Lewan Shubert Ticketing (201) 489-8600 ext 224 Hazmat condition: There's some emacs on the floor. > -----Original Message----- > From: help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org > [mailto:help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org] On > Behalf Of Kevin Rodgers > Sent: Tuesday, 2014 August 05 01:28 > To: help-gnu-emacs@gnu.org > Subject: Re: I want an unsaveable buffer >=20 > On 8/4/14 9:48 AM, Doug Lewan wrote: > > I work in *scratch* a lot, /and/ I save (C-xC-s) very frequently just > as a matter of habit. The consequence is that I find myself typing to > the "File to save in:" prompt when I just want to continue working. > > > > Turning off or remapping C-xC-s in *scratch* is easy enough, but the > obviously useful generalization is to turn saving off in any new buffer > not associated with a regular file. (Writing buffer contents would > remain, but you already have to think when you want that.) > > > > The natural route is to write a hook for buffer creation. The only > hook I can find for that is buffer-list-update-hook which is also run > on renaming, deletion, etc. I can imagine grabbing the output of > (backtrace) to look at how the hook was called, but that no longer > feels natural to me. > > > > Does anyone know of a natural approach to this? >=20 > (defadvice save-buffer (around interactive-no-visited-file-name > activate) > "When called interactively, disable for buffers not visiting a > file." > (when (or (not (called-interactively-p 'any)) > buffer-file-name) > ad-do-it)) >=20 > -- > Kevin Rodgers > Denver, Colorado, USA >=20