Hi! ... Just pinging :-) michael.cadilhac@lrde.org (Michaėl Cadilhac) writes: > When ido creates a new buffer, it records the command > « switch-to-buffer buffer », which is fine. However, « buffer » 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 can came up with the following simple solution: > > Index: lisp/ChangeLog > =================================================================== > 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ėl Cadilhac > + > + * ido.el (ido-record-command): If the argument is a buffer, save its > + name, not the buffer object. > + > 2006-08-27 YAMAMOTO Mitsuharu > > * term/mac-win.el (mac-apple-event-map): Rename hicommand to hi-command. > Index: lisp/ido.el > =================================================================== > 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,1716 **** > (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 (or (not command-history) > (not (equal cmd (car command-history)))) > (setq command-history (cons cmd command-history)))))) > --- 1710,1718 ---- > (defun ido-record-command (command arg) > ;; Add (command arg) to command-history if ido-record-commands is t > (if ido-record-commands > ! ;; 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! -- | Michaėl `Micha' Cadilhac | Mieux vaut se taire | | Epita/LRDE Promo 2007 | Que de parler trop fort. | | http://www.lrde.org/~cadilh_m | -- As de trčfle | `-- - JID: micha@amessage.be --' - --'