martin rudalics writes: >> In anything, i can browse image directory without quitting anything. >> This function `anything-find-files-persistent-action', use >> `display-buffer' and then display image with image-dired function in >> this buffer.This doesn't work anymore (display-buffer). >> The image is displayed ...in minibuffer!!! >> However it is working fine if i use `switch-to-buffer'. >> I have commited a fix at: >> http://repo.or.cz/w/anything-config.git >> where you can read the code. >> >> To reproduce with old code (the one that use display-buffer): >> M-x anything-find-files >> navigate to an image directory. >> hit C-u C-z on an image filename >> You will have the image displayed in minibuffer and it is impossible to >> quit. >> >> The last code is working fine. > > Sorry, I build without image support so I won't be able to test this. > Could you please try to edebug `display-buffer-reuse-window' and find > out whether the line > > (when (and (not (window-minibuffer-p window)) > > is processed in this particular case? If `window' is a minibuffer > window, it should not be added to the set of candidate windows denoted > by the variable `windows'. This line return t for both windows, but the whole when clause return nil for one of the 2 windows. I will try to debug more (hard because i have to quit emacs at each time) later. Here the relevant piece of code: --8<---------------cut here---------------start------------->8--- ;; An image file and it is the second hit on C-z, ;; show the file in `image-dired'. ((string-match (image-file-name-regexp) candidate) (when (buffer-live-p image-dired-display-image-buffer) (kill-buffer image-dired-display-image-buffer)) (image-dired-display-image candidate) (message nil) ;(switch-to-buffer image-dired-display-image-buffer) <<<< [1] (display-buffer image-dired-display-image-buffer) <<<< [2] (with-current-buffer image-dired-display-image-buffer (let ((exif-data (anything-ff-exif-data candidate))) (image-dired-update-property 'help-echo exif-data)))) --8<---------------cut here---------------end--------------->8--- See Capture-Emacs.png for [2] See Capture-Emacs-1.png for [1] Where [1] is what is expected. After [2] C-g do nothing and i must quit Emacs. > Thank you, martin > > > PS: Basically, there would be already a bug if `window' were a minibuffer > window in the test above because my first list is constructed by calling > > (window-list-1 nil 'nomini method-frame) > > where the 'nomini argument should filter out minibuffer windows. -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997