emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reducing mouse-dependency In Emacs.


From: Miles Bader
Subject: Re: Reducing mouse-dependency In Emacs.
Date: 13 Aug 2003 16:47:54 +0900

Luc Teirlinck <address@hidden> writes:
> To take care of functional values, I need not only the value of the
> property but also need to know whether it was found in an overlay (and
> if so which overlay) or as a text property.

How come?

> DEFUN ("find-char-property", Ffind_char_property, Sfind_char_property, 2, 3, 
> 0,

I think (as you said) the name is wrong -- `find' implies that it does
some sort of searching, when really it's just the same as
get-char-property with an additional return value -- why not just use
the same name as the C code:  get-char-property-and-overlay?

Also, you don't need to use alloca, you can just use a stack variable:


DEFUN ("get-char-property-and-overlay", Fget_char_property_and_overlay,
       Sget_char_property_and_overlay, 2, 3, 0,
       doc: /* Return a cons whose car is the value of POSITION's
property PROP, in OBJECT and whose cdr is the overlay in which the
property was found, or nil if it was found as a text property.  OBJECT
is optional and defaults to the current buffer.  If POSITION is at the
end of OBJECT, the value is nil.  If OBJECT is a buffer, then overlay
properties are considered as well as text properties.  If OBJECT is a
window, then that window's buffer is used, but window-specific
overlays are considered only if they are associated with OBJECT.  */)
     (position, prop, object)
     Lisp_Object position, object;
     register Lisp_Object prop;
{
  Lisp_Object overlay;
  Lisp_Object val
    = get_char_property_and_overlay (position, prop, object, &overlay);
  return Fcons (val, overlay);
}
 

-Miles
-- 
We have met the enemy, and he is us.  -- Pogo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]