[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
savehist and ido.
From: |
Michaël Cadilhac |
Subject: |
savehist and ido. |
Date: |
Sun, 27 Aug 2006 11:40:49 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) |
Hi the list.
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 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,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 | Le copillage-collage |
| Epita/LRDE Promo 2007 | tue le programmeur. |
| http://www.lrde.org/~cadilh_m | -- Dictons LRDE |
`-- - JID: address@hidden --' - --'
pgpD5qhdq8eg8.pgp
Description: PGP signature
- savehist and ido.,
Michaël Cadilhac <=