unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* savehist and ido.
@ 2006-08-27  9:40 Michaël Cadilhac
  2006-08-31 18:20 ` Michaël Cadilhac
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michaël Cadilhac @ 2006-08-27  9:40 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: savehist and ido.
  2006-08-27  9:40 savehist and ido Michaël Cadilhac
@ 2006-08-31 18:20 ` Michaël Cadilhac
  2006-09-04 14:09 ` Reiner Steib
  2006-09-05 10:51 ` Kim F. Storm
  2 siblings, 0 replies; 4+ messages in thread
From: Michaël Cadilhac @ 2006-08-31 18:20 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 2884 bytes --]


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 #<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  <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))))))
>
>
> 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 --'                                   -  --'

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: savehist and ido.
  2006-08-27  9:40 savehist and ido Michaël Cadilhac
  2006-08-31 18:20 ` Michaël Cadilhac
@ 2006-09-04 14:09 ` Reiner Steib
  2006-09-05 10:51 ` Kim F. Storm
  2 siblings, 0 replies; 4+ messages in thread
From: Reiner Steib @ 2006-09-04 14:09 UTC (permalink / raw)
  Cc: Hrvoje Niksic, emacs-devel

[ 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  <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,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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: savehist and ido.
  2006-08-27  9:40 savehist and ido Michaël Cadilhac
  2006-08-31 18:20 ` Michaël Cadilhac
  2006-09-04 14:09 ` Reiner Steib
@ 2006-09-05 10:51 ` Kim F. Storm
  2 siblings, 0 replies; 4+ messages in thread
From: Kim F. Storm @ 2006-09-05 10:51 UTC (permalink / raw)
  Cc: emacs-devel

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 #<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:

Thank you for the bug report (sorry for not taking action sooner).

I have installed a different change to ido.el that should fix this.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-05 10:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-27  9:40 savehist and ido Michaël Cadilhac
2006-08-31 18:20 ` Michaël Cadilhac
2006-09-04 14:09 ` Reiner Steib
2006-09-05 10:51 ` Kim F. Storm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).