diff options
| author | Eli Zaretskii | 2014-08-18 18:38:56 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-08-18 18:38:56 +0300 |
| commit | 73b7592be7270ed49724b33716c109aa95cbc2d0 (patch) | |
| tree | 9fbf68062878d78101d62790a25b609df179b95b /src | |
| parent | 82193f227e98ab312c1cf7405691811eb357d6c1 (diff) | |
| download | emacs-73b7592be7270ed49724b33716c109aa95cbc2d0.tar.gz emacs-73b7592be7270ed49724b33716c109aa95cbc2d0.zip | |
src/xdisp.c (handle_stop): Improve commentary.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 42 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3a2e03aa99c..4c774468e5e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2014-08-18 Eli Zaretskii <eliz@gnu.org> | 1 | 2014-08-18 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * xdisp.c (handle_stop): Improve commentary. | ||
| 4 | |||
| 3 | * indent.c (Fvertical_motion): Fix vertical motion up through a | 5 | * indent.c (Fvertical_motion): Fix vertical motion up through a |
| 4 | display property after a newline. (Bug#18276) | 6 | display property after a newline. (Bug#18276) |
| 5 | 7 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index e60a9d341c6..6ce8e3fff18 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3414,6 +3414,48 @@ handle_stop (struct it *it) | |||
| 3414 | if (it->selective_display_ellipsis_p) | 3414 | if (it->selective_display_ellipsis_p) |
| 3415 | it->saved_face_id = it->face_id; | 3415 | it->saved_face_id = it->face_id; |
| 3416 | 3416 | ||
| 3417 | /* Here's the description of the semantics of, and the logic behind, | ||
| 3418 | the various HANDLED_* statuses: | ||
| 3419 | |||
| 3420 | HANDLED_NORMALLY means the handler did its job, and the loop | ||
| 3421 | should proceed to calling the next handler in order. | ||
| 3422 | |||
| 3423 | HANDLED_RECOMPUTE_PROPS means the handler caused a significant | ||
| 3424 | change in the properties and overlays at current position, so the | ||
| 3425 | loop should be restarted, to re-invoke the handlers that were | ||
| 3426 | already called. This happens when fontification-functions were | ||
| 3427 | called by handle_fontified_prop, and actually fontified | ||
| 3428 | something. Another case where HANDLED_RECOMPUTE_PROPS is | ||
| 3429 | returned is when we discover overlay strings that need to be | ||
| 3430 | displayed right away. The loop below will continue for as long | ||
| 3431 | as the status is HANDLED_RECOMPUTE_PROPS. | ||
| 3432 | |||
| 3433 | HANDLED_RETURN means return immediately to the caller, to | ||
| 3434 | continue iteration without calling any further handlers. This is | ||
| 3435 | used when we need to act on some property right away, for example | ||
| 3436 | when we need to display the ellipsis or a replacing display | ||
| 3437 | property, such as display string or image. | ||
| 3438 | |||
| 3439 | HANDLED_OVERLAY_STRING_CONSUMED means an overlay string was just | ||
| 3440 | consumed, and the handler switched to the next overlay string. | ||
| 3441 | This signals the loop below to refrain from looking for more | ||
| 3442 | overlays before all the overlay strings of the current overlay | ||
| 3443 | are processed. | ||
| 3444 | |||
| 3445 | Some of the handlers called by the loop push the iterator state | ||
| 3446 | onto the stack (see 'push_it'), and arrange for the iteration to | ||
| 3447 | continue with another object, such as an image, a display string, | ||
| 3448 | or an overlay string. In most such cases, it->stop_charpos is | ||
| 3449 | set to the first character of the string, so that when the | ||
| 3450 | iteration resumes, this function will immediately be called | ||
| 3451 | again, to examine the properties at the beginning of the string. | ||
| 3452 | |||
| 3453 | When a display or overlay string is exhausted, the iterator state | ||
| 3454 | is popped (see 'pop_it'), and iteration continues with the | ||
| 3455 | previous object. Again, in many such cases this function is | ||
| 3456 | called again to find the next position where properties might | ||
| 3457 | change. */ | ||
| 3458 | |||
| 3417 | do | 3459 | do |
| 3418 | { | 3460 | { |
| 3419 | handled = HANDLED_NORMALLY; | 3461 | handled = HANDLED_NORMALLY; |