Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
03e1d617
Commit
03e1d617
authored
Nov 03, 2007
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(face_at_buffer_position_no_overlays): New function.
parent
e2f95383
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
src/xfaces.c
src/xfaces.c
+76
-0
No files found.
src/xfaces.c
View file @
03e1d617
...
...
@@ -7706,6 +7706,82 @@ face_at_buffer_position (w, pos, region_beg, region_end,
return lookup_face (f, attrs, 0, NULL);
}
/* Return the face ID associated with buffer position POS for
displaying ASCII characters, but without overlays.
Like face_at_buffer_position except it ignores overlays. */
int
face_at_buffer_position_no_overlays (w, pos, region_beg, region_end,
endptr, limit, mouse)
struct window *w;
int pos;
int region_beg, region_end;
int *endptr;
int limit;
int mouse;
{
struct frame *f = XFRAME (w->frame);
Lisp_Object attrs[LFACE_VECTOR_SIZE];
Lisp_Object prop, position;
int i, noverlays;
Lisp_Object *overlay_vec;
Lisp_Object frame;
int endpos;
Lisp_Object propname = mouse ? Qmouse_face : Qface;
Lisp_Object limit1, end;
struct face *default_face;
/* W must display the current buffer. We could write this function
to use the frame and buffer of W, but right now it doesn't. */
/* xassert (XBUFFER (w->buffer) == current_buffer); */
XSETFRAME (frame, f);
XSETFASTINT (position, pos);
endpos = ZV;
if (pos < region_beg && region_beg < endpos)
endpos = region_beg;
/* Get the `face' or `mouse_face' text property at POS, and
determine the next position at which the property changes. */
prop = Fget_text_property (position, propname, w->buffer);
XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
end = Fnext_single_property_change (position, propname, w->buffer, limit1);
if (INTEGERP (end))
endpos = XINT (end);
*endptr = endpos;
default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
/* Optimize common cases where we can use the default face. */
if (NILP (prop)
&& !(pos >= region_beg && pos < region_end))
return DEFAULT_FACE_ID;
/* Begin with attributes from the default face. */
bcopy (default_face->lface, attrs, sizeof attrs);
/* Merge in attributes specified via text properties. */
if (!NILP (prop))
merge_face_ref (f, prop, attrs, 1, 0);
/* If in the region, merge in the region face. */
if (pos >= region_beg && pos < region_end)
{
merge_named_face (f, Qregion, attrs, 0);
if (region_end < endpos)
endpos = region_end;
}
*endptr = endpos;
/* Look up a realized face with the given face attributes,
or realize a new one for ASCII characters. */
return lookup_face (f, attrs, 0, NULL);
}
/* Compute the face at character position POS in Lisp string STRING on
window W, for ASCII characters.
...
...
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