gnuclient_setup suggestion: gnuserv-start via after-init-hook (was: [Adding gnuclient_setup, removing Netinstall and InstallShield from website])

Adrian Aichner adrian at xemacs.org
Sun Dec 2 10:34:11 EST 2007


"Adrian Aichner" <adrian at xemacs.org> writes:

> "Vin Shelton" <acs at alumni.princeton.edu> writes:
>
>> Dear Adrian,
>>
>> On 10/13/07, Adrian Aichner <adrian at xemacs.org> wrote:
>>
>>> > Then my extensive customizations get loaded and the font-locking
>>> > changes.
>>> >
>>> > And the way the scratch buffer gets initialized seems to be different
>>> > in some respect.
>>>
>>> I guess initial-scratch-message must be initialized too late or not
>>> get inserted for some reason.
>>
>> Actually, there's a race condition that I have been unable to track
>> down.  When gnuclient starts a fresh XEmacs, it currently waits 3
>> seconds before sending XEmacs a message because XEmacs can get
>> confused if the gnuclient command arrives too early on stdin from
>> gnuserv.  I think your setup requires a longer wait.
>>
>> If I knew what the actual race condition is, I would track it down and
>> squish it.  Setting a wait timeout was the easier (if less robust)
>> path to take.  I could:
>> a) do nothing
>> b) increase the timeout
>> c) make the timeout configurable via a command line parameter
>> d) find the real bug.  I haven't had much luck with this approach.
>>
>> Let me know what you think.  In any case I'll release a new setup kit
>> replacing the reference to the testing directory - please let me know
>> your preference around the race condition mentioned above.
>
> Hi Vin, I'm happy to settle for (a) for now.
>
> I'll see if I can help shed some light on (d) as time goes by.

Hi Vin, I'd suggest new option
 e) Start gnuserv after newly XEmacs is fully initialized

Could you please try adding this code at the end of site-start.el
instead in the gnuclient_setup installation:

(add-hook 'after-init-hook
          (lambda ()
	    (load "gnuserv.el" t t)
;; Make sure we start the correct gnuserv executable
	    (setq gnuserv-program (concat exec-directory "gnuserv.exe"))
	    (if (file-executable-p gnuserv-program) (gnuserv-start)))
	  'append)

Please note I also added a file-executable-p test.

This seems to work fine for me.

Adrian

>
> But tomorrow I'll climb a mountain instead!
>
> Have a good weekend!
>
> Adrian
>
>>
>> Regards,
>>   Vin

-- 
Adrian Aichner
 mailto:adrian at xemacs.org
 http://www.xemacs.org/



More information about the XEmacs-Beta mailing list