aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/display.texi54
2 files changed, 59 insertions, 0 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 31a9cbf04e4..f98e457566e 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12014-12-02 Eli Zaretskii <eliz@gnu.org>
2
3 * display.texi (Bidirectional Display): Document
4 'bidi-find-overridden-directionality'.
5
12014-11-29 Paul Eggert <eggert@cs.ucla.edu> 62014-11-29 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Lessen focus on ChangeLog files, as opposed to change log entries. 8 Lessen focus on ChangeLog files, as opposed to change log entries.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 4cb06dd188f..59f73223a1f 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6800,3 +6800,57 @@ affect all Emacs frames and windows.
6800appropriate mirrored character in the reordered text. Lisp programs 6800appropriate mirrored character in the reordered text. Lisp programs
6801can affect the mirrored display by changing this property. Again, any 6801can affect the mirrored display by changing this property. Again, any
6802such changes affect all of Emacs display. 6802such changes affect all of Emacs display.
6803
6804@cindex overriding bidirectional properties
6805@cindex directional overrides
6806@cindex LRO
6807@cindex RLO
6808 The bidirectional properties of characters can be overridden by
6809inserting into the text special directional control characters,
6810LEFT-TO-RIGHT OVERRIDE (@acronym{LRO}) and RIGHT-TO-LEFT OVERRIDE
6811(@acronym{RLO}). Any characters between a @acronym{RLO} and the
6812following newline or POP DIRECTIONAL FORMATTING (@acronym{PDF})
6813control character, whichever comes first, will be displayed as if they
6814were strong right-to-left characters, i.e.@: they will be reversed on
6815display. Similarly, any characters between @acronym{LRO} and
6816@acronym{PDF} or newline will display as if they were strong
6817left-to-right, and will @emph{not} be reversed even if they are strong
6818right-to-left characters.
6819
6820@cindex phishing using directional overrides
6821@cindex malicious use of directional overrides
6822 These overrides are useful when you want to make some text
6823unaffected by the reordering algorithm, and instead directly control
6824the display order. But they can also be used for malicious purposes,
6825known as @dfn{phishing}. Specifically, a URL on a Web page or a link
6826in an email message can be manipulated to make its visual appearance
6827unrecognizable, or similar to some popular benign location, while the
6828real location, interpreted by a browser in the logical order, is very
6829different.
6830
6831 Emacs provides a primitive that applications can use to detect
6832instances of text whose bidirectional properties were overridden so as
6833to make a left-to-right character display as if it were a
6834right-to-left character, or vise versa.
6835
6836@defun bidi-find-overridden-directionality from to &optional object
6837This function looks at the text of the specified @var{object} between
6838positions @var{from} (inclusive) and @var{to} (exclusive), and returns
6839the first position where it finds a strong left-to-right character
6840whose directional properties were forced to display the character as
6841right-to-left, or for a strong right-to-left character that was forced
6842to display as left-to-right. If it finds no such characters in the
6843specified region of text, it returns @code{nil}.
6844
6845The optional argument @var{object} specifies which text to search, and
6846defaults to the current buffer. If @var{object} is non-@code{nil}, it
6847can be some other buffer, or it can be a string or a window. If it is
6848a string, the function searches that string. If it is a window, the
6849function searches the buffer displayed in that window. If a buffer
6850whose text you want to examine is displayed in some window, we
6851recommend to specify it by that window, rather than pass the buffer to
6852the function. This is because telling the function about the window
6853allows it to correctly account for window-specific overlays, which
6854might change the result of the function if some text in the buffer is
6855covered by overlays.
6856@end defun