jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: XJed do not set XWINDOWS with -batch


On  2.06.05, Joerg Sommer wrote:
 
> one example:

> message("You run "+
> #ifdef XWINDOWS
>         "XJed"
> #else
>         "Jed"
> #endif
>         );

> $ xjed -batch -n -l /tmp/test.sl
> You run Jed
 
> Why this?

Try `xjed` on a console, and you'll find that it runs jed (instead of
complaining about missing DISPLAY).

I suppose a similar scheme works with -batch: the X layer is (seemingly)
not needed and hence not activated.

While this might save ressources in some cases, it can lead to problems in
other ones. E.g a script to get the X selection and do something with it
will fail in batch mode :-(
 
> A second problem, that arises with this issue: You can't use precompiled
> slang files with different jed types. 

IMHO, precompiled files are a different issue. 

You can use precompiled files with proper care. However, as the
preprocessor options are evaluated during the byte-compile,
distinguishing between jed and xjed with XWINDOWS doesnot work in
commonly used byte-compiled files.

> Currently I use the .slc files build with jed with xjed. This fails, if
> they include XJed specific code.

This is why I use "#ifdef XWINDOWS" only in  .jedrc.

An option in "precompilable" files is to distinguish by checking for xjed
specific functions, e.g.

if (is_defined("x_set_keysym"))  % xjed running
   require("x-keydefs");   % symbolic keynames
else
   require("terminal-keydefs");

or

% Return
!if (is_defined("x_server_vendor"))
  setkey("newline_indent", "^M"); % correct mouse-insertion problem

(with
    public define newline_indent ()
    {
      if (input_pending(0))
         newline();
      else
         call ("newline_and_indent");
    }  
)


Günter

-- 
G.Milde web.de

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]