emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ido-mode and customized read-buffer-function


From: Roland Winkler
Subject: Re: ido-mode and customized read-buffer-function
Date: Sat, 23 Apr 2005 19:33:38 +0200

On Sat Apr 23 2005 Kim F. Storm wrote:
> Roland Winkler <address@hidden> writes:
> 
> > Symptoms:
> >
> > I have customized the variable read-buffer-function and I would like
> > to combine this with ido-mode. 
> >
> > When I do not want ido everywhere but only ido-mode, the latter still
> > calls ido-everywhere. But then ido-everywhere doesn't check whether
> > I have already customized read-buffer-function. It overwrites the
> > value of read-buffer-function with nil. Isn't that too aggressive?
> 
> Does this patch give good results ?

Thanks a lot for the quick reply. I think there is a minor bug
(see below).

> 
> *** ido.el    22 Apr 2005 17:08:30 +0200      1.51
> --- ido.el    23 Apr 2005 16:42:27 +0200      
> ***************
> *** 1346,1357 ****
>     (setq ido-everywhere (if arg
>                          (> (prefix-numeric-value arg) 0)
>                        (not ido-everywhere)))
> !   (setq read-file-name-function
> !     (and ido-everywhere (memq ido-mode '(both file))
> !          'ido-read-file-name))
> !   (setq read-buffer-function
> !     (and ido-everywhere (memq ido-mode '(both buffer))
> !          'ido-read-buffer)))
>   
>   
>   ;;; IDO KEYMAP
> --- 1346,1366 ----
>     (setq ido-everywhere (if arg
>                          (> (prefix-numeric-value arg) 0)
>                        (not ido-everywhere)))
> !   (when (get 'ido-everywhere 'file)
> !     (setq read-file-name-function (get 'ido-everywhere 'file))
> !     (put 'ido-everywhere 'file nil))
> !   (when (get 'ido-everywhere 'buffer)
> !     (setq read-buffer-function (get 'ido-everywhere 'buffer))
> !     (put 'ido-everywhere 'buffer nil))
> !   (when ido-everywhere
> !     (when (memq ido-mode '(both file))
> !       (unless (get 'ido-everywhere 'file)
> !     (put 'ido-everywhere 'buffer read-file-name-function))
> !       (setq read-buffer-function 'ido-read-file-name))

I believe the two preceding lines should read

!     (put 'ido-everywhere 'file read-file-name-function))
!       (setq read-file-name-function 'ido-read-file-name))


> !     (when (memq ido-mode '(both buffer))
> !       (unless (get 'ido-everywhere 'buffer)
> !     (put 'ido-everywhere 'buffer read-buffer-function))
> !       (setq read-buffer-function 'ido-read-buffer))))
>   
>   
>   ;;; IDO KEYMAP
> 
> -- 
> Kim F. Storm <address@hidden> http://www.cua.dk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]