[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: savehist and ido.
From: |
Reiner Steib |
Subject: |
Re: savehist and ido. |
Date: |
Mon, 04 Sep 2006 16:09:19 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
[ 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ël Cadilhac wrote:
> 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 #<buffer plop>)
>
> 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
> ===================================================================
> 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 <address@hidden>
> +
> + * ido.el (ido-record-command): If the argument is a buffer, save its
> + name, not the buffer object.
> +
> 2006-08-27 YAMAMOTO Mitsuharu <address@hidden>
>
> * 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,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.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
- Re: savehist and ido.,
Reiner Steib <=