Lisp HUG Maillist Archive

WinXP default font in capi:editor-pane


LispWorks 4.4.6 WinXP

Newbie question.

I set the font that I want for LispWorks Tools->Configuration and that is
the font that I want for my default font... It works in all the LispWorks
windows and buffers but this does not work and worse I can't find it
anywhere. Somehow I think I have to get to the registry setting because it
appears LispWorks abandons anything set in the init file for what is set in
Tools->Configuration which goes into the registry.

This isn't complicated I already set it... All I need to get it to do what
it should do anyway. The following does NOT WORK. It goes back to some other
setting that I can't find. I don't understand why I have to do anything
anyway shouldn't the default be the default?

(capi:define-interface my-lisp-editor-interface2 ()
  ()
  (:panes
   (my-lisp-editor
    capi:editor-pane
    :buffer-modes '("Lisp")
    :buffer-name "xxx"
    :font :EDITOR-PANE-DEFAULT-FONT
    :echo-area t))
  (:layouts
   (root-layout
    capi:column-layout
    '(my-lisp-editor)))
  (:default-initargs
   :best-height 300
   :best-width 300
   :layout 'root-layout
   :display-state :maximized
   :title "My Lisp Editor Interface2"))

David L. Greene


Re: WinXP default font in capi:editor-pane

Just because you set a font for the LispWorks development environment  
does not make it the default font for every interface you create.  
Doing that is simple enough -- but you have to know some information  
about the font. So something like:

(setf *my-favorite-font* (gp:find-best-font (capi:convert-to-screen)  
(gp:make-font-description :family "Courier")))

Then pass *my-favorite-font* as the :font initarg for the editor pane.

If you are not sure about what font you need, try this in the listener:

(capi:prompt-for-font "" :fixed-pitch-only-p t)


On Jul 3, 2006, at 1:28 PM, David L. Greene wrote:

> I set the font that I want for LispWorks Tools->Configuration and  
> that is
> the font that I want for my default font... It works in all the  
> LispWorks
> windows and buffers but this does not work and worse I can't find it
> anywhere. Somehow I think I have to get to the registry setting  
> because it
> appears LispWorks abandons anything set in the init file for what  
> is set in
> Tools->Configuration which goes into the registry.
>
> This isn't complicated I already set it... All I need to get it to  
> do what
> it should do anyway. The following does NOT WORK. It goes back to  
> some other
> setting that I can't find. I don't understand why I have to do  
> anything
> anyway shouldn't the default be the default?



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


RE: WinXP default font in capi:editor-pane

Thanks... I did understand how to create a font and save it to a global
variable it's just that the "global variable" for this must already exist
because LispWorks knows what it is. What I was asking is... In what variable
or structure does LispWorks keep this information? If I were a programmer
that was offering an "applet" that worked in LispWorks I might want to use
the font that the user already decided that they wanted and liked and my
"applet" should NOT make such a decision! If I were an "applet" programmer
within the LispWorks environment that particular decision is none of my
business.


David L. Greene
111 Park Street, Apt 6D
New Haven, CT 06840-5429
Tel 203.624.6860
Fax 203.624.9795
Dave@DLGreene.org
http://www.DLGreene.org
 
-----Original Message-----
From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On
Behalf Of John DeSoi
Sent: Monday, July 03, 2006 8:19 PM
To: David L. Greene
Cc: lisp-hug@lispworks.com
Subject: Re: WinXP default font in capi:editor-pane


Just because you set a font for the LispWorks development environment does
not make it the default font for every interface you create.  
Doing that is simple enough -- but you have to know some information about
the font. So something like:

(setf *my-favorite-font* (gp:find-best-font (capi:convert-to-screen)
(gp:make-font-description :family "Courier")))

Then pass *my-favorite-font* as the :font initarg for the editor pane.

If you are not sure about what font you need, try this in the listener:

(capi:prompt-for-font "" :fixed-pitch-only-p t)


On Jul 3, 2006, at 1:28 PM, David L. Greene wrote:

> I set the font that I want for LispWorks Tools->Configuration and that 
> is the font that I want for my default font... It works in all the 
> LispWorks windows and buffers but this does not work and worse I can't 
> find it anywhere. Somehow I think I have to get to the registry 
> setting because it appears LispWorks abandons anything set in the init 
> file for what is set in
> Tools->Configuration which goes into the registry.
>
> This isn't complicated I already set it... All I need to get it to do 
> what it should do anyway. The following does NOT WORK. It goes back to 
> some other setting that I can't find. I don't understand why I have to 
> do anything anyway shouldn't the default be the default?



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: WinXP default font in capi:editor-pane

OK, then I think the answer to your question is that LispWorks uses  
the user-preference system to store values (search the documentation  
for "preference"). On Windows this does translate to storing the  
values in the registry, but if you can determine the value used for  
system:product-registry-path I think you could easily read the values  
without writing any registry access code.


On Jul 4, 2006, at 12:28 AM, David L. Greene wrote:

> Thanks... I did understand how to create a font and save it to a  
> global
> variable it's just that the "global variable" for this must already  
> exist
> because LispWorks knows what it is. What I was asking is... In what  
> variable
> or structure does LispWorks keep this information? If I were a  
> programmer
> that was offering an "applet" that worked in LispWorks I might want  
> to use
> the font that the user already decided that they wanted and liked  
> and my
> "applet" should NOT make such a decision! If I were an "applet"  
> programmer
> within the LispWorks environment that particular decision is none  
> of my
> business.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


RE: WinXP default font in capi:editor-pane

Thanks... That is a way to "solve" the problem but I would assume that "If I
were developing an "applet" for LispWorks..." that would work ONLY if the
"applet" were being run on a MSWindows machine. Is there really NO "global
variable or structure" that is within the LispWorks environment that keeps
this information for cross operating system development?

I must be really dense or stupid but it seems like the "value" of using
LispWorks specifically for cross development is promptly trashed at
initialization prior to doing anything! I find that hard to believe. I must
have something wrong.


David L. Greene
111 Park Street, Apt 6D
New Haven, CT 06840-5429
Tel 203.624.6860
Fax 203.624.9795
Dave@DLGreene.org
http://www.DLGreene.org
 
-----Original Message-----
From: John DeSoi [mailto:desoi@pgedit.com] 
Sent: Tuesday, July 04, 2006 7:36 AM
To: David L. Greene
Cc: lisp-hug@lispworks.com
Subject: Re: WinXP default font in capi:editor-pane

OK, then I think the answer to your question is that LispWorks uses the
user-preference system to store values (search the documentation for
"preference"). On Windows this does translate to storing the values in the
registry, but if you can determine the value used for
system:product-registry-path I think you could easily read the values
without writing any registry access code.


On Jul 4, 2006, at 12:28 AM, David L. Greene wrote:

> Thanks... I did understand how to create a font and save it to a 
> global variable it's just that the "global variable" for this must 
> already exist because LispWorks knows what it is. What I was asking 
> is... In what variable or structure does LispWorks keep this 
> information? If I were a programmer that was offering an "applet" that 
> worked in LispWorks I might want to use the font that the user already 
> decided that they wanted and liked and my "applet" should NOT make 
> such a decision! If I were an "applet"
> programmer
> within the LispWorks environment that particular decision is none of 
> my business.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: WinXP default font in capi:editor-pane

On Tue, 4 Jul 2006 08:24:30 -0400, "David L. Greene" <Dave@DLGreene.org> wrote:

> Thanks... That is a way to "solve" the problem but I would assume
> that "If I were developing an "applet" for LispWorks..." that would
> work ONLY if the "applet" were being run on a MSWindows machine. Is
> there really NO "global variable or structure" that is within the
> LispWorks environment that keeps this information for cross
> operating system development?

Have you actually read the documentation John referred to?  (See for
example 22.7 in the LWUG.)  The user-preference system is precisely a
system to store settings between invocations of a program which is
cross-platform.  It happens to use the system registry on Windows but
that's an implementation detail that doesn't matter.

> I must be really dense or stupid but it seems like the "value" of
> using LispWorks specifically for cross development is promptly
> trashed at initialization prior to doing anything!

I don't know if you're dense or stupid but it seems you're drawing
your conclusions pretty fast...


RE: WinXP default font in capi:editor-pane

I want to make it clear I set the init file in LispWorks config dialog, see
at the end of this message. Also I just want the variable the the font is
in.

So is it fair to say that those variables that are in the registry will be
used by LispWorks and only those registry variables will be used during
initialization and LispWorks will ignore (overwrite?) ALL other references
in any config or ini lisp file. Further more is it fair to say that any
global variables that are in LispWorks like:
(editor:variable-value "Output Format Default")
Are depreciated and have no meaning. Any reliance on this variable is
"undetermined" because Lispworks now uses lw:user-preference and (setf
lw:user-preference) for some undocumented preferences. While it still may
use said variables for other purposes at certain other undocumented times.

I am aware of regedt32 "Xanalys/Editor/Input Format Default" and
"Xanalys/Editor/LISPWORKS-INTERFACE/EDITOR-FONT" etc. I assume then that
these application names and paths are "set in stone" and that LispWorks
won't change them? Nor will it provide any "generic" global variable that
can be set from within LispWorks with this information that can be relied
on.

I realize that I am a one of the stupid Windows users but it would appear
that the lw:user-preference is indeed a handy tool for a developer but the
questions that I continue to pose are related to LISPWORKS PREFERENCES.
These are preferences that a developer needs to depend on before any
developing gets done in the first place.

Is there a document documenting the depreciation of certain editor
variables?

The value at regedt32 "Xanalys/Editor/Input Format Default" should equal the
value in the variable (editor:variable-value "Input Format Default") which
should equal the value in the appropiate place in LispWorks configure
dialog.

And if I set it in regedt32 it does "hold the value", albeit if I now use
the configure dialog it is "confused".(AI in action)

regedt32 "Xanalys/Editor/Input Format Default" => (:UTF-8 :EOL-STYLE :CRLF)

And now after initialization in a listener

(editor:variable-value "Input Format Default") => (:UTF-8 :EOL-STYLE :CRLF)

Actually I set Input and Output and both seem to have "held". What is in my
ini.lisp has no meaning and is ignored or overwritten for "Input/Output
Format Default" and ONLY that variable is ignored so far as I, a newbie, can
figure out.

Now if I could just figure out what the font variable is and how to use it?
I thought it would be a simple question.

Again it's only certain variables that are effected... For instance I still
have the dummies
(setf dummie-a-dot-lispworks "Hello this is a test!")
(setf dummie-configure "Hello this is a test!")

In the obvious lisp files.
And sure enough... After restarting LW

dummie-a-dot-lispworks => "Hello this is a test!"
dummie-configure => "Hello this is a test!"

So setting the initilization file item in the LispWorks configure dialog
does actually work... Sort of.

David L. Greene
111 Park Street, Apt 6D
New Haven, CT 06840-5429
Tel 203.624.6860
Fax 203.624.9795
http://www.DLGreene.org
 
-----Original Message-----
From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On
Behalf Of Edi Weitz
Sent: Tuesday, July 04, 2006 8:52 AM
To: David L. Greene
Cc: lisp-hug@lispworks.com
Subject: Re: WinXP default font in capi:editor-pane


On Tue, 4 Jul 2006 08:24:30 -0400, "David L. Greene" <Dave@DLGreene.org>
wrote:

> Thanks... That is a way to "solve" the problem but I would assume that 
> "If I were developing an "applet" for LispWorks..." that would work 
> ONLY if the "applet" were being run on a MSWindows machine. Is there 
> really NO "global variable or structure" that is within the LispWorks 
> environment that keeps this information for cross operating system 
> development?

Have you actually read the documentation John referred to?  (See for example
22.7 in the LWUG.)  The user-preference system is precisely a system to
store settings between invocations of a program which is cross-platform.  It
happens to use the system registry on Windows but that's an implementation
detail that doesn't matter.

> I must be really dense or stupid but it seems like the "value" of 
> using LispWorks specifically for cross development is promptly trashed 
> at initialization prior to doing anything!

I don't know if you're dense or stupid but it seems you're drawing your
conclusions pretty fast...


Re: WinXP default font in capi:editor-pane


On Jul 4, 2006, at 8:24 AM, David L. Greene wrote:

> Thanks... That is a way to "solve" the problem but I would assume  
> that "If I
> were developing an "applet" for LispWorks..." that would work ONLY  
> if the
> "applet" were being run on a MSWindows machine. Is there really NO  
> "global
> variable or structure" that is within the LispWorks environment  
> that keeps
> this information for cross operating system development?

You need to read the documentation on the preference system a little  
more closely. It provides an API to manage preferences independent of  
the operating system. Values are stored in the registry on Windows  
versus files in the user directory on other operating systems. But  
you don't have to deal with those details. But you need to know the  
right "key" value to read and write them.

There still may be some variable somewhere that has the font  
information, but I don't know what is is. Maybe you could find a hint  
in the editor source.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


RE: WinXP default font in capi:editor-pane

Thanks-

You are right I didn't pick up on the OS independence of lw:user-preference.
I'm a bit frazzled... It (lw:user-preference) is a great tool if I were the
one setting the preferences for MY theoretical "applet". Unfortunately, it's
the LispWorks preferences that I'm trying to grasp.

I've read other threads you've been a part of and you have helped.

Thanks again-

David L. Greene
111 Park Street, Apt 6D
New Haven, CT 06840-5429
Tel 203.624.6860
Fax 203.624.9795

 
-----Original Message-----
From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On
Behalf Of John DeSoi
Sent: Tuesday, July 04, 2006 9:53 AM
To: David L. Greene
Cc: Lisp HUG
Subject: Re: WinXP default font in capi:editor-pane



On Jul 4, 2006, at 8:24 AM, David L. Greene wrote:

> Thanks... That is a way to "solve" the problem but I would assume that 
> "If I were developing an "applet" for LispWorks..." that would work 
> ONLY if the "applet" were being run on a MSWindows machine. Is there 
> really NO "global variable or structure" that is within the LispWorks 
> environment that keeps this information for cross operating system 
> development?

You need to read the documentation on the preference system a little more
closely. It provides an API to manage preferences independent of the
operating system. Values are stored in the registry on Windows versus files
in the user directory on other operating systems. But you don't have to deal
with those details. But you need to know the right "key" value to read and
write them.

There still may be some variable somewhere that has the font information,
but I don't know what is is. Maybe you could find a hint in the editor
source.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Updated at: 2020-12-10 08:48 UTC