unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: What is the purpose of this code in xterm.c ?
  2003-12-05 23:15 What is the purpose of this code in xterm.c ? Kim F. Storm
@ 2003-12-05 22:46 ` Jan D.
  0 siblings, 0 replies; 2+ messages in thread
From: Jan D. @ 2003-12-05 22:46 UTC (permalink / raw)
  Cc: emacs-devel

> The following lines (marked with ???) look superfluous.
>

I guess you mean xmenu.c.
Indeed they do.  My guess is that previously kbd_buffer_store_help_event
was used there also.

But I suspect that function is never called with f == NULL.

	Jan D.


> They obviously set `f' if it's not already set on entry.
> But `f' isn't used in the call to show_help_echo.
>
> Can anyone explain what they are supposed to do?
>
>
> /* Function that finds the frame for WIDGET and shows the HELP text
>    for that widget.
>    F is the frame if known, or NULL if not known.  */
> static void
> show_help_event (f, widget, help)
>      FRAME_PTR f;
>      xt_or_gtk_widget widget;
>      Lisp_Object help;
> {
>   Lisp_Object frame;
>
>   if (f)
>     {
>       XSETFRAME (frame, f);
>       kbd_buffer_store_help_event (frame, help);
>     }
>   else
>     {
> ???      /* WIDGET is the popup menu.  It's parent is the frame's
> ???	 widget.  See which frame that is.  */
> ???      xt_or_gtk_widget frame_widget = XtParent (widget);
> ???      Lisp_Object tail;
> ???
> ???      for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
> ???	{
> ???	  frame = XCAR (tail);
> ???	  if (GC_FRAMEP (frame)
> ???	      && (f = XFRAME (frame),
> ???		  FRAME_X_P (f) && f->output_data.x->widget == frame_widget))
> ???	    break;
> ???	}
>
>       show_help_echo (help, Qnil, Qnil, Qnil, 1);
>     }
> }
>
> -- 
> Kim F. Storm <storm@cua.dk> http://www.cua.dk
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/emacs-devel

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

* What is the purpose of this code in xterm.c ?
@ 2003-12-05 23:15 Kim F. Storm
  2003-12-05 22:46 ` Jan D.
  0 siblings, 1 reply; 2+ messages in thread
From: Kim F. Storm @ 2003-12-05 23:15 UTC (permalink / raw)



The following lines (marked with ???) look superfluous.

They obviously set `f' if it's not already set on entry.
But `f' isn't used in the call to show_help_echo.

Can anyone explain what they are supposed to do?


/* Function that finds the frame for WIDGET and shows the HELP text
   for that widget.
   F is the frame if known, or NULL if not known.  */
static void
show_help_event (f, widget, help)
     FRAME_PTR f;
     xt_or_gtk_widget widget;
     Lisp_Object help;
{
  Lisp_Object frame;

  if (f)
    {
      XSETFRAME (frame, f);
      kbd_buffer_store_help_event (frame, help);
    }
  else
    {
???      /* WIDGET is the popup menu.  It's parent is the frame's
???	 widget.  See which frame that is.  */
???      xt_or_gtk_widget frame_widget = XtParent (widget);
???      Lisp_Object tail;
???
???      for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
???	{
???	  frame = XCAR (tail);
???	  if (GC_FRAMEP (frame)
???	      && (f = XFRAME (frame),
???		  FRAME_X_P (f) && f->output_data.x->widget == frame_widget))
???	    break;
???	}

      show_help_echo (help, Qnil, Qnil, Qnil, 1);
    }
}

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

end of thread, other threads:[~2003-12-05 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-05 23:15 What is the purpose of this code in xterm.c ? Kim F. Storm
2003-12-05 22:46 ` Jan D.

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).