From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Function needed to save a certain buffer every x seconds automatically Date: Thu, 26 Sep 2013 20:39:09 +0200 Message-ID: <52447F4D.3000002@easy-emacs.de> References: <6906143.LRjCqdsP7e@linux-ik7b.site> <52446B5E.6010906@easy-emacs.de> <2264045.EjpuyHfElB@linux-ik7b.site> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1380220646 9520 80.91.229.3 (26 Sep 2013 18:37:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Sep 2013 18:37:26 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: AW Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 26 20:37:28 2013 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 1VPGRM-0005oh-Im for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Sep 2013 20:37:28 +0200 Original-Received: from localhost ([::1]:59390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPGRM-0000ia-45 for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Sep 2013 14:37:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPGR5-0000iG-Jb for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 14:37:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPGQy-0006Pu-99 for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 14:37:11 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:56070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPGQx-0006PZ-V2 for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 14:37:04 -0400 Original-Received: from purzel.sitgens (brln-4db9ef2e.pool.mediaWays.net [77.185.239.46]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MYtGN-1VLZGa1bn9-00V7Xq; Thu, 26 Sep 2013 20:36:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: <2264045.EjpuyHfElB@linux-ik7b.site> X-Provags-ID: V02:K0:AzS29Uw3sDQ6mGb2OspfIVdxPBG6Vik9OtkBHMlOTqV uFVkfb0KjaPeAw8JCRDZ0KwbnANGNp9S7b+8msfDHNrxu77CUI Wig32xXjXVWUmlUAA2qNJclgsOQltuwM/BFYoAcYFalrOZ3gPY kGj8eSwPrNPtadD5+MHvpfdk7grTo1gcYw+qbszIkE9x/4Bvir 2T/0eEKNCbj8WfPEYzCdiLbjAOvVlAcvseIrFf1yZ//5DE7qOQ 7rqu7JXFN6+pTcHehCaqmqK73duhp9MRkDaR0KjF2ogVB8ho1D +6kXzPMU38NACmWZEFozYvDLtTWsJe1/rLUKYYU/BrYIiE/+wb Xsd4HUFv03tRjjzCKkNhNJ8/Ynk4Inl05Uf2wihOU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.9 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:93632 Archived-At: Am 26.09.2013 20:14, schrieb AW: > Am Donnerstag, 26. September 2013, 19:14:06 schrieb Andreas Röhler: >> Am 26.09.2013 17:38, schrieb AW: >>> Hello! >>> >>> To get a fast refreshing PDF of my LaTeX file, I use latexmk, which >>> renders a PDF every time the LaTeX file changed on the hard disk. >>> >>> I'd like to have a mechanism to save the LaTeX file every x seconds. >> >> So you want to save a single buffer, not all, as auto-save-buffers does? >> >> In this case here a little step forward >> >> (run-with-idle-timer 1 nil (lambda () (set-buffer "MY-TEX")(write-file >> (expand-file-name "~/my.tex"))(message (format-time-string "%Y-%m-%d %a >> %H:%M" (current-time))))) >> >> It runs just once, as timers not to switch off might turn nasty. >> Gives some messages when saving. >> >> Edit the my-tex parts. >> >> Andreas > > Would it be possible to take the current buffer instead of manually inserting > the file name? > Yes. Didn't write it as the current-buffer changes quit often, than it writes whatever-what-buffer into the file-name specified, etc. Would expect trouble from that. BTW reflecting your task, what about an after-change, resp. after-save hook, producing the pdf after every save? It's up to you. Cheers, > And besides that: thank you for your help! > > Regards, > Alexander >