From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Torsten Bronger Newsgroups: gmane.emacs.help Subject: save-history.el: visiting file literally Date: Mon, 02 Oct 2006 20:48:21 +0200 Organization: Phoenix Foundation Message-ID: <87irj21rm2.fsf@wilson.homeunix.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1159818075 6353 80.91.229.2 (2 Oct 2006 19:41:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Oct 2006 19:41:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 02 21:41:08 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GUTes-0004F9-50 for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Oct 2006 21:40:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GUTer-0003Q3-N1 for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Oct 2006 15:40:57 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 53 Original-X-Trace: news.dfncis.de bm64HR8sVl4XQ+2p1zi8/gF2jUBFpdyvcCp4wVgLKK9WzMTGSqdsk8ZOWe X-Orig-Path: wilson.homeunix.com!news X-PGP-Fingerprint: C5C8 D6E2 79D2 EFE9 8C0F 6D77 D5E3 CEFC 9F51 6B77 X-PGP-Affinity: will accept encrypted message for GPG X-Home-Page: http://www.wikipedia.org/wiki/User:Bronger X-Face: +wpw"|jN2Fde|7_lKBa0\7!_6suIE_m! x)'S9ytBu8tkt'k779jbzQ4o|p+@H_DCrIdnKG]E*w X-Binford: 6100 (more power) X-Accept-Language: de, en Jabber-ID: bronger@jabber.org User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:Js2zGoTbVJhIRDFxOa715lYein4= Original-Xref: shelby.stanford.edu gnu.emacs.help:142144 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37762 Archived-At: Hallöchen! I've recently installed save-history.el by Lars R. Clausen. Now, every time I close Emacs, it asks to re-visit the file .save-history "literally", because currently, it is opened in some non-literally mode. The code is rather short, so I dare to cite it here: --8<---------------cut here---------------start------------->8--- (defun save-history-save () "Save all histories in `save-history-varlist' to `save-history-file'" (let ((old-buffer (current-buffer)) (histbuffer (find-file-noselect save-history-file t t))) (switch-to-buffer histbuffer) (if (> (buffer-size) 0) (delete-region 1 (buffer-size))) (insert "(setq\n") (mapcar (lambda (x) (if (and x (eval x)) (progn (insert " ") (prin1 x histbuffer) (insert "\n '") (if save-history-max-length (let ((truncated (save-history-truncate-list (eval x) save-history-max-length))) (prin1 truncated histbuffer)) (prin1 (eval x) histbuffer)) (insert "\n")))) save-history-varlist) (insert ")\n") (basic-save-buffer) (switch-to-buffer old-buffer))) (defun save-history-load () "Load histories from `save-history-file'" (if (file-exists-p save-history-file) (load-file save-history-file))) (add-hook 'after-init-hook 'save-history-load) (add-hook 'kill-emacs-hook 'save-history-save) --8<---------------cut here---------------end--------------->8--- How can I achieve that the save-history-file is read in the proper way so that re-visiting is not necessary anymore? Many thanks! Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus ICQ 264-296-646 (See http://ime.webhop.org for Jabber, MSN, etc.)