From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: how to get around deprecated function Date: Wed, 29 Apr 2015 01:29:45 +0200 Organization: Aioe.org NNTP Server Message-ID: <87twvzx252.fsf@debian.uxu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430263521 5108 80.91.229.3 (28 Apr 2015 23:25:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2015 23:25:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 29 01:25:20 2015 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 1YnEsR-0000Td-Uf for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 01:25:20 +0200 Original-Received: from localhost ([::1]:36152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnEsR-0005ZG-4r for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Apr 2015 19:25:19 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:cvWnYBB6rL7bZwnkb8CsSF9TIYI= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:211772 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:104053 Archived-At: B. T. Raven writes: > I am constantly losing short pieces of text left in > *scratch* and I wrote this interactive function > [...] > > It "works" but according to the docs > mark-whole-buffer shouldn't be used this way. > Is there an understandable (to me) right way of > doing this or doing something else that can be > invoked as easily? In the help for `append-to-file', it says (append-to-file START END FILENAME) ... If START is nil, that means to use the entire buffer contents. Also, instead of using `switch-to-buffer', use `with-current-buffer'. And, instead of using `setq', use `let'. Or - as the data doesn't reappear - you might as well put the function invocations in the append-to-file invocation itself. Use the Emacs byte-compiler to get suggestions such as these. You already found out they are in the help, but the byte-compiler can be a way of not having to check the help for every function used... Meta hint: Don't quote things that haven't appeared in the thread with the angle brackets. Either just yank it or make it look like this if it appeals to you: Meta hint: don't quote things that haven't appeared in the thread with the angle brackets. Either just yank it or make it look like this if it appeals to you. Dig deep! -- underground experts united http://user.it.uu.se/~embe8573