Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f5957179
Commit
f5957179
authored
Feb 24, 1994
by
Karl Heuer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Fget_char_property): New function.
parent
42db5687
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
src/textprop.c
src/textprop.c
+62
-0
No files found.
src/textprop.c
View file @
f5957179
...
...
@@ -21,6 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
#include "window.h"
/* NOTES: previous- and next- property change will have to skip
...
...
@@ -519,6 +520,67 @@ If POSITION is at the end of OBJECT, the value is nil.")
return
textget
(
i
->
plist
,
prop
);
}
DEFUN
(
"get-char-property"
,
Fget_char_property
,
Sget_char_property
,
2
,
3
,
0
,
"Return the value of position POS's property PROP, in OBJECT.
\n
\
OBJECT is optional and defaults to the current buffer.
\n
\
If POSITION is at the end of OBJECT, the value is nil.
\n
\
If OBJECT is a buffer, then overlay properties are considered as well as
\n
\
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."
)
(
pos
,
prop
,
object
)
Lisp_Object
pos
,
object
;
register
Lisp_Object
prop
;
{
struct
window
*
w
=
0
;
CHECK_NUMBER_COERCE_MARKER
(
pos
,
0
);
if
(
NILP
(
object
))
XSET
(
object
,
Lisp_Buffer
,
current_buffer
);
if
(
WINDOWP
(
object
))
{
w
=
XWINDOW
(
object
);
XSET
(
object
,
Lisp_Buffer
,
w
->
buffer
);
}
if
(
BUFFERP
(
object
))
{
int
posn
=
XINT
(
pos
);
int
noverlays
;
Lisp_Object
*
overlay_vec
,
tem
;
int
next_overlay
;
int
len
;
/* First try with room for 40 overlays. */
len
=
40
;
overlay_vec
=
(
Lisp_Object
*
)
alloca
(
len
*
sizeof
(
Lisp_Object
));
noverlays
=
overlays_at
(
posn
,
0
,
&
overlay_vec
,
&
len
,
&
next_overlay
);
/* If there are more than 40,
make enough space for all, and try again. */
if
(
noverlays
>
len
)
{
len
=
noverlays
;
overlay_vec
=
(
Lisp_Object
*
)
alloca
(
len
*
sizeof
(
Lisp_Object
));
noverlays
=
overlays_at
(
posn
,
0
,
&
overlay_vec
,
&
len
,
&
next_overlay
);
}
noverlays
=
sort_overlays
(
overlay_vec
,
noverlays
,
w
);
/* Now check the overlays in order of decreasing priority. */
while
(
--
noverlays
>=
0
)
{
tem
=
Foverlay_get
(
overlay_vec
[
noverlays
],
prop
);
if
(
!
NILP
(
tem
))
return
(
tem
);
}
}
/* Not a buffer, or no appropriate overlay, so fall through to the
simpler case. */
return
(
Fget_text_property
(
pos
,
prop
,
object
));
}
DEFUN
(
"next-property-change"
,
Fnext_property_change
,
Snext_property_change
,
1
,
3
,
0
,
"Return the position of next property change.
\n
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment