all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* x-popup-menu - window object
@ 2006-09-27  1:53 Tim Johnson
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Johnson @ 2006-09-27  1:53 UTC (permalink / raw)


Hi:
This works:
(x-popup-menu t '("Title" ("--" ("Line One" . 1))))

This:
(x-popup-menu 
  '((50 50) (selected-window)) '("Title" ("--" ("Line One" .  1))))

Throws the following:  
Lisp error: (wrong-type-argument windowp (selected-window))

Documentation for x-popup-menu says
""" POSITION is a position specification.  This is either a mouse button event
or a list ((XOFFSET YOFFSET) WINDOW) """

evaluating (windowp (selected-window)) returns t

So what is wrong the with the 'call' to selected-window?
Thanks
Tim

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* x-popup-menu - window object
@ 2006-09-27 12:34 martin rudalics
  2006-09-28  7:00 ` martin rudalics
       [not found] ` <mailman.7528.1159426927.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: martin rudalics @ 2006-09-27 12:34 UTC (permalink / raw)
  Cc: help-gnu-emacs

Try

(x-popup-menu
   (list '(50 50) (selected-window)) '("Title" ("--" ("Line One" .  1))))

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x-popup-menu - window object
       [not found] <mailman.7492.1159360442.9609.help-gnu-emacs@gnu.org>
@ 2006-09-27 15:53 ` Tim Johnson
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Johnson @ 2006-09-27 15:53 UTC (permalink / raw)


On 2006-09-27, martin rudalics <rudalics@gmx.at> wrote:
  Hello Martin:
> Try
>
> (x-popup-menu
>    (list '(50 50) (selected-window)) '("Title" ("--" ("Line One" .  1))))

  Yes. That works. In fact, some time after posting this thread, I 
  found this same solution after googling an example. 

  I guess I have a larger question:
  When should one use 'list?

  thank you
  tim

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x-popup-menu - window object
  2006-09-27 12:34 x-popup-menu - window object martin rudalics
@ 2006-09-28  7:00 ` martin rudalics
       [not found] ` <mailman.7528.1159426927.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: martin rudalics @ 2006-09-28  7:00 UTC (permalink / raw)
  Cc: help-gnu-emacs

 >  I guess I have a larger question:
 >  When should one use 'list?

At the very moment, evaluating

'((50 50) (selected-window))

in buffer *scratch* gets me

((50 50) (selected-window))

while evaluating

(list '(50 50) (selected-window))

gets me

((50 50) #<window 42 on *scratch*>)

because in Elisp "cons evaluates its arguments" and `list' is based on
`cons'.

`x-popup-menu' expects, according to its doc-string, as first argument
something like "list ((XOFFSET YOFFSET) WINDOW)" where WINDOW denotes an
object of type window.  In practice, this means that you have to find a
function (like `selected-window') that returns a window object and feed
`x-popup-menu' with the _return value_ of that function.  It's not
sufficient to feed `x-popup-menu' just with the reference to a function
that would tell it how to find such a window.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x-popup-menu - window object
       [not found] ` <mailman.7528.1159426927.9609.help-gnu-emacs@gnu.org>
@ 2006-09-28 15:52   ` Tim Johnson
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Johnson @ 2006-09-28 15:52 UTC (permalink / raw)


On 2006-09-28, martin rudalics <rudalics@gmx.at> wrote:
> >  I guess I have a larger question:
> >  When should one use 'list?
>
> At the very moment, evaluating
>
> '((50 50) (selected-window))
>
> in buffer *scratch* gets me
>
> ((50 50) (selected-window))
>
> while evaluating
>
> (list '(50 50) (selected-window))
>
> gets me
>
> ((50 50) #<window 42 on *scratch*>)
>
> because in Elisp "cons evaluates its arguments" and `list' is based on
> `cons'.
>
> `x-popup-menu' expects, according to its doc-string, as first argument
> something like "list ((XOFFSET YOFFSET) WINDOW)" where WINDOW denotes an
> object of type window.  In practice, this means that you have to find a
> function (like `selected-window') that returns a window object and feed
> `x-popup-menu' with the _return value_ of that function.  It's not
> sufficient to feed `x-popup-menu' just with the reference to a function
> that would tell it how to find such a window.
  Hello martin:
  Understood.
  One should then consider using list when a function is passed.
  thanks very much
  tim

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-28 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-27 12:34 x-popup-menu - window object martin rudalics
2006-09-28  7:00 ` martin rudalics
     [not found] ` <mailman.7528.1159426927.9609.help-gnu-emacs@gnu.org>
2006-09-28 15:52   ` Tim Johnson
     [not found] <mailman.7492.1159360442.9609.help-gnu-emacs@gnu.org>
2006-09-27 15:53 ` Tim Johnson
  -- strict thread matches above, loose matches on Subject: below --
2006-09-27  1:53 Tim Johnson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.