unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: User option dnd-open-file-other-window has no effect
       [not found] <433F93D7.2000809@web.de>
@ 2005-10-03  5:09 ` Richard M. Stallman
  2005-10-03 13:06   ` Sven Joachim
  0 siblings, 1 reply; 4+ messages in thread
From: Richard M. Stallman @ 2005-10-03  5:09 UTC (permalink / raw)
  Cc: emacs-devel

    There is a user option, dnd-open-file-other-window, which should
    control the behaviour of drag-n-dropping files onto an Emacs frame.
    I customized it to t...
    However, that had no effect. :-(

If the code in x-dnd-drop-data is going to always bind
this variable, then it is useless to make it customizable.

There are two cases: dropping in a specific window, and dropping
elsewhere on the frame.   Perhaps we should change one 
of those two cases NOT to bind dnd-open-file-other-window,
or change it somehow.

Which is the case that you want to customize?

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

* Re: User option dnd-open-file-other-window has no effect
  2005-10-03  5:09 ` User option dnd-open-file-other-window has no effect Richard M. Stallman
@ 2005-10-03 13:06   ` Sven Joachim
  2005-10-04  5:02     ` Richard M. Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Joachim @ 2005-10-03 13:06 UTC (permalink / raw)
  Cc: emacs-devel

Richard M. Stallman wrote:
>     There is a user option, dnd-open-file-other-window, which should
>     control the behaviour of drag-n-dropping files onto an Emacs frame.
>     I customized it to t...
>     However, that had no effect. :-(
> 
> If the code in x-dnd-drop-data is going to always bind
> this variable, then it is useless to make it customizable.

Yes, that was the main point of my bug report ;-)

> There are two cases: dropping in a specific window, and dropping
> elsewhere on the frame.   Perhaps we should change one 
> of those two cases NOT to bind dnd-open-file-other-window,
> or change it somehow.
> 
> Which is the case that you want to customize?

Hmm, initially I had only thought of dropping in a specific window and wanted
to customize that.  Only now I realize that dropping on, e.g., the titlebar makes
a difference.  I would suggest to change the first case (dropping in a window)
not to let x-dnd-drop-data bind dnd-open-file-other-window.

There is also a special case which I see now.  Dropping in the minibuffer gives
an error:

Error: (error Cannot switch buffers in minibuffer window)

In that case, x-dnd-drop-data should probably bind dnd-open-file-other-window
to t.

-- 
  Sven Joachim

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

* Re: User option dnd-open-file-other-window has no effect
  2005-10-03 13:06   ` Sven Joachim
@ 2005-10-04  5:02     ` Richard M. Stallman
  2005-10-05 13:00       ` Sven Joachim
  0 siblings, 1 reply; 4+ messages in thread
From: Richard M. Stallman @ 2005-10-04  5:02 UTC (permalink / raw)
  Cc: emacs-devel

Does this code look good to you?

*** x-dnd.el	07 Aug 2005 13:30:28 -0400	1.16
--- x-dnd.el	03 Oct 2005 18:55:33 -0400	
***************
*** 307,319 ****
  	 (action (aref state 5))
  	 (w (posn-window (event-start event))))
      (when handler
!       (if (and (windowp w) (window-live-p w))
! 	  ;; If dropping in a window, open files in that window rather
! 	  ;; than in a new widow.
! 	  (let ((dnd-open-file-other-window nil))
  	    (goto-char (posn-point (event-start event)))
  	    (funcall handler window action data))
! 	(let ((dnd-open-file-other-window t))  ;; Dropping on non-window.
  	  (select-frame frame)
  	  (funcall handler window action data))))))
  
--- 307,323 ----
  	 (action (aref state 5))
  	 (w (posn-window (event-start event))))
      (when handler
!       (if (and (windowp w) (window-live-p w)
! 	       (not (window-minibuffer-p w))
! 	       (not (window-dedicated-p w)))
! 	  ;; If dropping in an ordinary window which we could use,
! 	  ;; let dnd-open-file-other-window specify what to do.
! 	  (progn
  	    (goto-char (posn-point (event-start event)))
  	    (funcall handler window action data))
! 	;; If we can't display the file here,
! 	;; make a new window for it.
! 	(let ((dnd-open-file-other-window t))
  	  (select-frame frame)
  	  (funcall handler window action data))))))

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

* Re: User option dnd-open-file-other-window has no effect
  2005-10-04  5:02     ` Richard M. Stallman
@ 2005-10-05 13:00       ` Sven Joachim
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Joachim @ 2005-10-05 13:00 UTC (permalink / raw)
  Cc: emacs-devel

Richard M. Stallman wrote:
> Does this code look good to you?

Yes it does.  Jan has already checked in a new version with
a similar patch:

*** emacs/emacs/lisp/x-dnd.el	2005/08/06 22:13:43	1.16
--- emacs/emacs/lisp/x-dnd.el	2005/10/03 19:41:25	1.17
***************
*** 307,316 ****
   	 (action (aref state 5))
   	 (w (posn-window (event-start event))))
       (when handler
!       (if (and (windowp w) (window-live-p w))
   	  ;; If dropping in a window, open files in that window rather
   	  ;; than in a new widow.
! 	  (let ((dnd-open-file-other-window nil))
   	    (goto-char (posn-point (event-start event)))
   	    (funcall handler window action data))
   	(let ((dnd-open-file-other-window t))  ;; Dropping on non-window.
--- 307,317 ----
   	 (action (aref state 5))
   	 (w (posn-window (event-start event))))
       (when handler
!       (if (and (windowp w) (window-live-p w)
! 	       (not (minibufferp (window-buffer w))))
   	  ;; If dropping in a window, open files in that window rather
   	  ;; than in a new widow.
! 	  (progn
   	    (goto-char (posn-point (event-start event)))
   	    (funcall handler window action data))
   	(let ((dnd-open-file-other-window t))  ;; Dropping on non-window.

However, your version is better, obeying the window's "dedicated" property.
Thank you for your help.

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

end of thread, other threads:[~2005-10-05 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <433F93D7.2000809@web.de>
2005-10-03  5:09 ` User option dnd-open-file-other-window has no effect Richard M. Stallman
2005-10-03 13:06   ` Sven Joachim
2005-10-04  5:02     ` Richard M. Stallman
2005-10-05 13:00       ` Sven Joachim

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).