Lisp HUG Maillist Archive

Function Arglist Displayer

Hi all,

I'm trying to configure some colors in LW7.0 IDE. Right now I'm 
struggling with the Function Arglist Displayer: can't find any ideas how 
to configure its background/foreground colors. Any insights about it?

I'm also interested in modifying properties of non-client area, i.e. 
around actual editor pane. I would like
to change its color and/or size. Any clues where to start looking?

Br,
/Alexey

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Function Arglist Displayer

Courtesy of Ray Lanning…

(defun set-pane-background-colors (x)
  (typecase x
    (capi:echo-area-pane
     (setf (capi:simple-pane-background x) (color:make-rgb 1.0 .67 0.67)))
    (capi:collector-pane
     (setf (capi:simple-pane-background x) (color:make-rgb .85 1.0 .85)))
    (capi:listener-pane
     (setf (capi:simple-pane-background x) (color:make-rgb .85 .85 1.0)))
    (capi:editor-pane
     (setf (capi::simple-pane-background x) (color:make-rgb .9 .9 .85)
;        (capi::simple-pane-foreground x) :black
         ))
    (capi:tab-layout
     (mapcar 'set-pane-background-colors (capi:tab-layout-panes x)))
;    (capi:output-pane
;     (setf (capi:simple-pane-background x) :black
;        (capi::simple-pane-foreground x) :white))
    ))

(let ((*HANDLE-WARN-ON-REDEFINITION* :warn)
      (*redefinition-action* :warn))
  (defmethod capi:interface-display :before ((self lw-tools:listener))
    (capi:map-pane-descendant-children
     self 'set-pane-background-colors))
  (defmethod capi:interface-display :before ((self lw-tools:editor))
    (capi:map-pane-descendant-children
     self 'set-pane-background-colors))
  )

> On May 18, 2015, at 13:04 PM, Alexey Veretennikov <txm.fourier@gmail.com> wrote:
> 
> 
> Hi all,
> 
> I'm trying to configure some colors in LW7.0 IDE. Right now I'm struggling with the Function Arglist Displayer: can't find any ideas how to configure its background/foreground colors. Any insights about it?
> 
> I'm also interested in modifying properties of non-client area, i.e. around actual editor pane. I would like
> to change its color and/or size. Any clues where to start looking?
> 
> Br,
> /Alexey
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 
> 

73 de Dave, N7AIG

David McClain
N7AIG@arrl.net




_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Function Arglist Displayer

Alexey Veretennikov <txm.fourier@gmail.com> writes:

> I'm trying to configure some colors in LW7.0 IDE. Right now I'm
> struggling with the Function Arglist Displayer: can't find any ideas
> how to configure its background/foreground colors. Any insights about
> it?

This is what I have in my .lispworks file:

;; Change the background colors of LispWorks' In-place completion and
;; 'Function Arglist Displayer' windows:
(setf capi::*editor-pane-in-place-background* :black)
(setf capi-toolkit::*arglist-displayer-background* :black)

Here is Martin Simmon's answer to a simmilar question for more details:
http://thread.gmane.org/gmane.lisp.lispworks.general/9812

Regards.
Nico

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Function Arglist Displayer

David McClain <dbm@refined-audiometrics.com> writes:

> Courtesy of Ray Lanning…
>
> (defun set-pane-background-colors (x)
>   (typecase x
>     (capi:echo-area-pane
>      (setf (capi:simple-pane-background x) (color:make-rgb 1.0 .67 0.67)))
>     (capi:collector-pane
>      (setf (capi:simple-pane-background x) (color:make-rgb .85 1.0 .85)))
>     (capi:listener-pane
>      (setf (capi:simple-pane-background x) (color:make-rgb .85 .85 1.0)))
>     (capi:editor-pane
>      (setf (capi::simple-pane-background x) (color:make-rgb .9 .9 .85)
> ;        (capi::simple-pane-foreground x) :black
>          ))
>     (capi:tab-layout
>      (mapcar 'set-pane-background-colors (capi:tab-layout-panes x)))
> ;    (capi:output-pane
> ;     (setf (capi:simple-pane-background x) :black
> ;        (capi::simple-pane-foreground x) :white))
>     ))
>
> (let ((*HANDLE-WARN-ON-REDEFINITION* :warn)
>       (*redefinition-action* :warn))
>   (defmethod capi:interface-display :before ((self lw-tools:listener))
>     (capi:map-pane-descendant-children
>      self 'set-pane-background-colors))
>   (defmethod capi:interface-display :before ((self lw-tools:editor))
>     (capi:map-pane-descendant-children
>      self 'set-pane-background-colors))
>   )

Hi David

I have been using this after seeing it in one of your previous posts;
thanks! Just two observations:

> (capi:echo-area-pane (setf (capi:simple-pane-background x)
>                            (color:make-rgb 1.0 .67 0.67)))

Altering the background color of the echo area appears to be semi broken
since LW 7.0. If, after setting it, you try to e.g. open a file with
Ctrl-f Ctrl-x or invoke an editor command with Meta-x, the background of
the echo area is reset to its vanilla value (default Emacs key bindings
assumed). In contrast, argument completion, e.g., works fine and does
not reset the background color.

I'll report this as a bug if LispWorks don't respond here on the mailing
list.


> (defmethod capi:interface-display :before ((self lw-tools:editor))
>     (capi:map-pane-descendant-children
>      self 'set-pane-background-colors))

If you split the editor window (Ctrl-x 5 or Ctrl-x 6) after changing the
editor's background color, then the new editor pane don't have the new
color, which is a bit annoying. I added the following to my init file to
resolve this, but perhaps there is a better way:

(defmethod editor::split-editor-window :after ((x t) horizontal top)
  (capi:map-pane-descendant-children
   (capi:locate-interface 'lw-tools:editor)
   'set-pane-background-colors))

Regards.
Nico

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Function Arglist Displayer

Nico de Jager <nico@dejager.cc> writes:

> David McClain <dbm@refined-audiometrics.com> writes:
>
>> Courtesy of Ray Lanning…
>>
>> (defun set-pane-background-colors (x)
>>   (typecase x
>>     (capi:echo-area-pane
>>      (setf (capi:simple-pane-background x) (color:make-rgb 1.0 .67 0.67)))
>>     (capi:collector-pane
>>      (setf (capi:simple-pane-background x) (color:make-rgb .85 1.0 .85)))
>>     (capi:listener-pane
>>      (setf (capi:simple-pane-background x) (color:make-rgb .85 .85 1.0)))
>>     (capi:editor-pane
>>      (setf (capi::simple-pane-background x) (color:make-rgb .9 .9 .85)
>> ;        (capi::simple-pane-foreground x) :black
>>          ))
>>     (capi:tab-layout
>>      (mapcar 'set-pane-background-colors (capi:tab-layout-panes x)))
>> ;    (capi:output-pane
>> ;     (setf (capi:simple-pane-background x) :black
>> ;        (capi::simple-pane-foreground x) :white))
>>     ))
>>
>> (let ((*HANDLE-WARN-ON-REDEFINITION* :warn)
>>       (*redefinition-action* :warn))
>>   (defmethod capi:interface-display :before ((self lw-tools:listener))
>>     (capi:map-pane-descendant-children
>>      self 'set-pane-background-colors))
>>   (defmethod capi:interface-display :before ((self lw-tools:editor))
>>     (capi:map-pane-descendant-children
>>      self 'set-pane-background-colors))
>>   )
>
> Hi David
>
> I have been using this after seeing it in one of your previous posts;
> thanks! Just two observations:
>
>> (capi:echo-area-pane (setf (capi:simple-pane-background x)
>>                            (color:make-rgb 1.0 .67 0.67)))
>
> Altering the background color of the echo area appears to be semi broken
> since LW 7.0. If, after setting it, you try to e.g. open a file with
> Ctrl-f Ctrl-x or invoke an editor command with Meta-x, the background of
> the echo area is reset to its vanilla value (default Emacs key bindings
> assumed). In contrast, argument completion, e.g., works fine and does
> not reset the background color.
>
> I'll report this as a bug if LispWorks don't respond here on the mailing
> list.
>
>
>> (defmethod capi:interface-display :before ((self lw-tools:editor))
>>     (capi:map-pane-descendant-children
>>      self 'set-pane-background-colors))
>
> If you split the editor window (Ctrl-x 5 or Ctrl-x 6) after changing the
> editor's background color, then the new editor pane don't have the new
> color, which is a bit annoying. I added the following to my init file to
> resolve this, but perhaps there is a better way:
>
> (defmethod editor::split-editor-window :after ((x t) horizontal top)
>   (capi:map-pane-descendant-children
>    (capi:locate-interface 'lw-tools:editor)
>    'set-pane-background-colors))

Another thing: there is already a CAPI:INTERFACE-DISPLAY :BEFORE method
defined for LW-TOOLS:EDITOR, so it is probably better to add
functionality with LispWorks' advice facility (or use an around method)
rather than to redefine the existing method (for which we don't have the
source code):

(defadvice ((method capi:interface-display :before (lw-tools:editor))
            change-editor-colors
            :before
            :documentation "Change editor colors.")
    (interface)
  (capi:map-pane-descendant-children interface 'set-pane-background-colors))


Nico

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Function Arglist Displayer

>>>>> On Tue, 19 May 2015 10:44:30 +0200, Nico de Jager said:
> 
> David McClain <dbm@refined-audiometrics.com> writes:
> 
> > Courtesy of Ray Lanning…
> >
> > (defun set-pane-background-colors (x)
> >   (typecase x
> >     (capi:echo-area-pane
> >      (setf (capi:simple-pane-background x) (color:make-rgb 1.0 .67 0.67)))
> >     (capi:collector-pane
> >      (setf (capi:simple-pane-background x) (color:make-rgb .85 1.0 .85)))
> >     (capi:listener-pane
> >      (setf (capi:simple-pane-background x) (color:make-rgb .85 .85 1.0)))
> >     (capi:editor-pane
> >      (setf (capi::simple-pane-background x) (color:make-rgb .9 .9 .85)
> > ;        (capi::simple-pane-foreground x) :black
> >          ))
> >     (capi:tab-layout
> >      (mapcar 'set-pane-background-colors (capi:tab-layout-panes x)))
> > ;    (capi:output-pane
> > ;     (setf (capi:simple-pane-background x) :black
> > ;        (capi::simple-pane-foreground x) :white))
> >     ))
> >
> > (let ((*HANDLE-WARN-ON-REDEFINITION* :warn)
> >       (*redefinition-action* :warn))
> >   (defmethod capi:interface-display :before ((self lw-tools:listener))
> >     (capi:map-pane-descendant-children
> >      self 'set-pane-background-colors))
> >   (defmethod capi:interface-display :before ((self lw-tools:editor))
> >     (capi:map-pane-descendant-children
> >      self 'set-pane-background-colors))
> >   )
> 
> Hi David
> 
> I have been using this after seeing it in one of your previous posts;
> thanks! Just two observations:
> 
> > (capi:echo-area-pane (setf (capi:simple-pane-background x)
> >                            (color:make-rgb 1.0 .67 0.67)))
> 
> Altering the background color of the echo area appears to be semi broken
> since LW 7.0. If, after setting it, you try to e.g. open a file with
> Ctrl-f Ctrl-x or invoke an editor command with Meta-x, the background of
> the echo area is reset to its vanilla value (default Emacs key bindings
> assumed). In contrast, argument completion, e.g., works fine and does
> not reset the background color.
> 
> I'll report this as a bug if LispWorks don't respond here on the mailing
> list.

The echo area changes color in LispWorks 7.0 depending on the focus, but it
captures the "normal" color before capi:interface-display is called so doesn't
see your modified color.

You can turn off the color change by setting the internal variable
capi::*echo-area-show-focus-by-background* to nil or you can use the internal
accessor capi::echo-area-pane-normal-background in set-pane-background-colors
to set the "normal" color instead of the background.  None of this is
supported of course.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Function Arglist Displayer

Alexey Veretennikov <txm.fourier@gmail.com> writes:

> Thank you! works for the editor. However I cannot define the advice
> for a listener by some reason:
> (lispworks:defadvice ((method capi:interface-display (lw-tools:listener))
>                       change-listener-colors
>                       :before
>                       :documentation "Change listener colors.")
>     (interface)
>   (capi:map-pane-descendant-children interface 'set-listener-pane-colors))
>
> complains
> **++++ Error in (COMPILER::ADVICE-DEFINITION CAPI:INTERFACE-DISPLAY
> (METHOD CAPI:INTERFACE-DISPLAY (LISPWORKS-TOOLS:LISTENER))
> EDITOR-COLOR-THEME::CHANGE-LISTENER-COLORS :ADVICE-BEFORE):
>   Undefined function #1=(METHOD CAPI:INTERFACE-DISPLAY
> (LISPWORKS-TOOLS:LISTENER)) in form (LISPWORKS:DEFADVICE #1#).
>
> In the class browser I can see this method however.

Looking at the timestamp of your message, my guess is that you had a
late night ;-) and saw the :before method of interface-display for
lw-tools:listener in the class browser when you still had the definition
in your init file or defined it yourself some other way. If I start
LispWorks (7.0 both Linux and Windows) without loading the init file
(http://www.lispworks.com/documentation/lw70/LW/html/lw-6.htm#pgfId-888833), 
then I see no interface-display :before method for lw-tools:listener,
thus you cannot define an advice for it.

Also, when starting LispWorks from the command line on Linux with
David's interface-display :before methods, I see "Warning: Defining..."
for the listener, output-browser, shell and inspector, but "Warning:
**Re**defining..." for the editor (see below). Only the editor has 'n
predefined interface-display :before method, thus I only defined an
advice for the editor and defined :before methods for the other tools.

Warning: Defining (METHOD INTERFACE-DISPLAY :BEFORE (LISPWORKS-TOOLS:LISTENER)) visible from packages LISPWORKS-TOOLS, CAPI.
Warning: Redefining (METHOD INTERFACE-DISPLAY :BEFORE (LISPWORKS-TOOLS:EDITOR)) visible from packages LISPWORKS-TOOLS, CAPI.
Warning: Defining (METHOD INTERFACE-DISPLAY :BEFORE (LISPWORKS-TOOLS:OUTPUT-BROWSER)) visible from packages LISPWORKS-TOOLS, CAPI.
Warning: Defining (METHOD INTERFACE-DISPLAY :BEFORE (LISPWORKS-TOOLS:SHELL)) visible from packages LISPWORKS-TOOLS, CAPI.
Warning: Defining (METHOD INTERFACE-DISPLAY :BEFORE (LISPWORKS-TOOLS:INSPECTOR)) visible from packages LISPWORKS-TOOLS, CAPI.

Hth.
Nico

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


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