help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] gnuclient - Forget the drop target. Was: gnuserv maintenance


From: David Vanderschel
Subject: Re: [h-e-w] gnuclient - Forget the drop target. Was: gnuserv maintenance
Date: 31 Oct 2004 23:54:10 -0600

On Friday, October 29, "David Vanderschel" <address@hidden> wrote:
>... For those who still want a drop target shortcut,
>there is still the PIF approach where one has better
>control over the passing of the arguments.  Four
>years ago I might have complained that the overhead
>for the PIF solution was too great.  (It took 3
>seconds on my 350MHz AMD K-6.)  Nowadays, I think the
>extra overhead is a non-issue.  (I could be on shaky
>ground here if the PIF concept itself does not carry
>over cleanly from, say, 98 to XP.)

Let me offer the simple batch file I concocted some
time back:

______________________________________________________________________
if "%1"=="" goto nofile
d:\emacs\emacs-20.7\bin\gnuclientw.exe -F "%1"
goto done
:nofile
d:\emacs\emacs-20.7\bin\gnudoit.exe -q (dv-focus-initial-frame)
:done
exit
______________________________________________________________________

If you put in a reference to a .bat file like the
above (modified as appropriate for your installation)
as the "Cmd. line" for a shortcut, you get a PIF-type
shortcut which behaves in the manner Edi sought
without advising find-file.  Though I rarely use the
drop-target feature, I would more often use this icon
on my Quick Launch bar to pop up emacs' initial frame
(even though I also have a hot key to do this as
well).

The code in my initialization for dv-focus-initial-frame:

______________________________________________________________________
(defvar dv-initial-frame (car (frame-list))     "Holds initial frame.")

(defun dv-focus-frame (frame)           "pop to top and give focus"
;;                                      Code 'borrowed' from frame.el.
;;      (Meaning I don't understand it. But it beats all I tried.  :)
  (make-frame-visible frame)
  (raise-frame frame)
  (select-frame frame)
  (w32-focus-frame frame))

(defun dv-focus-initial-frame ()        "Make the initial frame visible."
  (dv-focus-frame dv-initial-frame))
______________________________________________________________________


Like Edi, I had had trouble with frames getting focus;
so I tried solving this problem from elisp.  My
dv-focus-frame is code I found elsewhere, and it looks
like overkill; but I wanted to do everything I could
to make sure that the frame gets focus.  It usually
works.  I think it always works in this case.  There
is a problem (not serious) with this code if you
delete your initial frame.  (I never do that and even
have code to prevent it.)

Would someone running XP or 2000 please try the PIF
shortcut to verify that it works on those systems?
(both as a drop-target and as a means to give emacs
focus)

If it does work on XP, then, as far as I am concerned,
the difference in the way parameters are passed or not
for drop-target shortcuts becomes a non-issue as it
relates to requirements for gnuclient-type function.

Regards,
  David V.





reply via email to

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