From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Re: savehist and ido. Date: Mon, 04 Sep 2006 16:09:19 +0200 Message-ID: References: <87y7taqzxa.fsf@lrde.org> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1157379031 32274 80.91.229.2 (4 Sep 2006 14:10:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Sep 2006 14:10:31 +0000 (UTC) Cc: Hrvoje Niksic , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 04 16:10:24 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 1GKF9T-0002a2-5a for ged-emacs-devel@m.gmane.org; Mon, 04 Sep 2006 16:10:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKF9S-0003I6-Eq for ged-emacs-devel@m.gmane.org; Mon, 04 Sep 2006 10:10:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GKF8p-0002pV-Bk for emacs-devel@gnu.org; Mon, 04 Sep 2006 10:09:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GKF8o-0002oq-QV for emacs-devel@gnu.org; Mon, 04 Sep 2006 10:09:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKF8o-0002oj-Ba for emacs-devel@gnu.org; Mon, 04 Sep 2006 10:09:34 -0400 Original-Received: from [134.60.1.1] (helo=mail.uni-ulm.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GKFJL-0000na-4Q for emacs-devel@gnu.org; Mon, 04 Sep 2006 10:20:27 -0400 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.8/8.13.8) with ESMTP id k84E9KYY013416; Mon, 4 Sep 2006 16:09:20 +0200 (MEST) Original-Received: by bridgekeeper.physik.uni-ulm.de (Postfix, from userid 170) id ECE3C12037; Mon, 4 Sep 2006 16:09:19 +0200 (CEST) Mail-Followup-To: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac), , Hrvoje Niksic Original-To: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l; 3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2; n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 (=?iso-8859-1?Q?Micha=EBl?= Cadilhac's message of "Sun\, 27 Aug 2006 11\:40\:49 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DCC-sonic.net-Metrics: gemini 1156; Body=3 Fuz1=3 Fuz2=3 X-MIME-Autoconverted: from 8bit to quoted-printable by mail.uni-ulm.de id k84E9KYY013416 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:59315 Archived-At: [ I'm cc-ing Hrvoje Niksic, the author of `savehist.el'. I don't think that Hrvoje follows emacs-devel. ] On Sun, Aug 27 2006, Micha=EBl Cadilhac wrote: > When ido creates a new buffer, it records the command > =AB switch-to-buffer buffer =BB, which is fine. However, =AB buffer =BB= is not > a string, but a buffer-object. When savehist will save > command-history, a command will have the form > > (switch-to-buffer #) > > which can't be read back when Emacs is relaunched (with an error > message that is probably cryptic for standard users). I had similar problems (invalid-read-syntax "#") a while ago: http://thread.gmane.org/v9sls7ke9z.fsf%40marauder.physik.uni-ulm.de > I can came up with the following simple solution: > > Index: lisp/ChangeLog > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /sources/emacs/emacs/lisp/ChangeLog,v > retrieving revision 1.9966 > diff -c -r1.9966 ChangeLog > --- lisp/ChangeLog 27 Aug 2006 07:08:19 -0000 1.9966 > +++ lisp/ChangeLog 27 Aug 2006 09:34:13 -0000 > @@ -1,3 +1,8 @@ > +2006-08-27 Micha=EBl Cadilhac > + > + * ido.el (ido-record-command): If the argument is a buffer, save its > + name, not the buffer object. > + > 2006-08-27 YAMAMOTO Mitsuharu > =20 > * term/mac-win.el (mac-apple-event-map): Rename hicommand to hi-comma= nd. > Index: lisp/ido.el > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /sources/emacs/emacs/lisp/ido.el,v > retrieving revision 1.102 > diff -c -r1.102 ido.el > --- lisp/ido.el 22 Aug 2006 09:45:13 -0000 1.102 > +++ lisp/ido.el 27 Aug 2006 09:34:13 -0000 > @@ -1710,7 +1710,9 @@ > (defun ido-record-command (command arg) > ;; Add (command arg) to command-history if ido-record-commands is t > (if ido-record-commands > - (let ((cmd (list command arg))) > + ;; If arg is a buffer, get its name, to please savehist. > + (let* ((buffer-arg (if (bufferp arg) (buffer-name arg) arg)) > + (cmd (list command buffer-arg))) > (if (or (not command-history) > (not (equal cmd (car command-history)))) > (setq command-history (cons cmd command-history)))))) > But maybe this has to be done in `savehist-save', which will no longer > use prin1 but its own function. > > Bye! Bye, Reiner. --=20 ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/