aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-08-20 17:31:38 +0300
committerEli Zaretskii2010-08-20 17:31:38 +0300
commitc30b8a12a4a57bfe070dd68b014d7d425bab8ed9 (patch)
treeceff864e40211a0ecd29698fab0c0b45a6750750 /src
parent2396cbba625bc61b38be5b0be9d4c69e93de50f4 (diff)
downloademacs-c30b8a12a4a57bfe070dd68b014d7d425bab8ed9.tar.gz
emacs-c30b8a12a4a57bfe070dd68b014d7d425bab8ed9.zip
xdisp.c: Add commentary about iterator geometry in R2L paragraphs.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index d730387a51b..c80e1f35df3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -217,7 +217,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
217 glyph with suitably computed width. Both the blanks and the 217 glyph with suitably computed width. Both the blanks and the
218 stretch glyph are given the face of the background of the line. 218 stretch glyph are given the face of the background of the line.
219 This way, the terminal-specific back-end can still draw the glyphs 219 This way, the terminal-specific back-end can still draw the glyphs
220 left to right, even for R2L lines. */ 220 left to right, even for R2L lines.
221
222 Note one important detail mentioned above: that the bidi reordering
223 engine, driven by the iterator, produces characters in R2L rows
224 starting at the character that will be the rightmost on display.
225 As far as the iterator is concerned, the geometry of such rows is
226 still left to right, i.e. the iterator "thinks" the first character
227 is at the leftmost pixel position. The iterator does not know that
228 PRODUCE_GLYPHS reverses the order of the glyphs that the iterator
229 delivers. This is important when functions from the the move_it_*
230 family are used to get to certain screen position or to match
231 screen coordinates with buffer coordinates: these functions use the
232 iterator geometry, which is left to right even in R2L paragraphs.
233 This works well with most callers of move_it_*, because they need
234 to get to a specific column, and columns are still numbered in the
235 reading order, i.e. the rightmost character in a R2L paragraph is
236 still column zero. But some callers do not get well with this; a
237 notable example is mouse clicks that need to find the character
238 that corresponds to certain pixel coordinates. See
239 buffer_posn_from_coords in dispnew.c for how this is handled. */
221 240
222#include <config.h> 241#include <config.h>
223#include <stdio.h> 242#include <stdio.h>