From: michael.cadilhac@lrde.org (Michaël Cadilhac)
Subject: savehist and ido.
Date: Sun, 27 Aug 2006 11:40:49 +0200 [thread overview]
Message-ID: <87y7taqzxa.fsf@lrde.org> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 463 bytes --]
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:
[-- Attachment #1.1.2: ido.patch --]
[-- Type: text/x-patch, Size: 1796 bytes --]
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 <michael.cadilhac@lrde.org>
+
+ * ido.el (ido-record-command): If the argument is a buffer, save its
+ name, not the buffer object.
+
2006-08-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* 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))))))
[-- Attachment #1.1.3: Type: text/plain, Size: 438 bytes --]
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: micha@amessage.be --' - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next reply other threads:[~2006-08-27 9:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-27 9:40 Michaël Cadilhac [this message]
2006-08-31 18:20 ` savehist and ido Michaël Cadilhac
2006-09-04 14:09 ` Reiner Steib
2006-09-05 10:51 ` Kim F. Storm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y7taqzxa.fsf@lrde.org \
--to=michael.cadilhac@lrde.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.