aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-08-18 10:01:52 -0700
committerPaul Eggert2011-08-18 10:01:52 -0700
commit76667214e7bdc7f6196de2bb6d7e14ef879a2694 (patch)
tree58ca2d3448d502ff4ac2e46aefc8b90582c4d1ab
parent2fab8395070ff77b836cb8ca9b84c261c4387a9a (diff)
parent92b714445aac9be4227684f9c90cd61c3a0f02d5 (diff)
downloademacs-76667214e7bdc7f6196de2bb6d7e14ef879a2694.tar.gz
emacs-76667214e7bdc7f6196de2bb6d7e14ef879a2694.zip
Merge from trunk.
-rw-r--r--doc/lispref/ChangeLog13
-rw-r--r--doc/lispref/display.texi104
-rw-r--r--doc/lispref/nonascii.texi7
-rw-r--r--etc/NEWS17
-rw-r--r--lisp/ChangeLog24
-rw-r--r--lisp/buff-menu.el4
-rw-r--r--lisp/dired.el4
-rw-r--r--lisp/emacs-lisp/tabulated-list.el2
-rw-r--r--lisp/faces.el33
-rw-r--r--lisp/font-lock.el7
-rw-r--r--lisp/international/characters.el20
-rw-r--r--lisp/progmodes/compile.el6
-rw-r--r--lisp/subr.el31
-rw-r--r--src/ChangeLog12
-rw-r--r--src/dispextern.h6
-rw-r--r--src/process.c36
16 files changed, 248 insertions, 78 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 56175a34eee..4cb4d0a6f50 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,16 @@
12011-08-18 Eli Zaretskii <eliz@gnu.org>
2
3 * nonascii.texi (Character Properties): Document use of
4 `bidi-class' and `mirroring' properties as part of reordering.
5 Provide cross-references to "Bidirectional Display".
6
7 * display.texi (Bidirectional Display): Document the pitfalls of
8 concatenating strings with bidirectional content, with possible
9 solutions. Document bidi-string-mark-left-to-right. Mention
10 paragraph direction in modes that inherit from prog-mode.
11 Document use of `bidi-class' and `mirroring' properties as part of
12 reordering.
13
12011-08-16 Eli Zaretskii <eliz@gnu.org> 142011-08-16 Eli Zaretskii <eliz@gnu.org>
2 15
3 * modes.texi (Major Mode Conventions): Improve the documentation 16 * modes.texi (Major Mode Conventions): Improve the documentation
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 64a9054f596..8f7f4003411 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -5992,6 +5992,7 @@ left-to-right and right-to-left characters.
5992for editing and displaying bidirectional text. 5992for editing and displaying bidirectional text.
5993 5993
5994@cindex logical order 5994@cindex logical order
5995@cindex reading order
5995@cindex visual order 5996@cindex visual order
5996@cindex unicode bidirectional algorithm 5997@cindex unicode bidirectional algorithm
5997 Emacs stores right-to-left and bidirectional text in the so-called 5998 Emacs stores right-to-left and bidirectional text in the so-called
@@ -6006,17 +6007,16 @@ for display. Reordering of bidirectional text for display in Emacs is
6006a ``Full bidirectionality'' class implementation of the @acronym{UBA}. 6007a ``Full bidirectionality'' class implementation of the @acronym{UBA}.
6007 6008
6008@defvar bidi-display-reordering 6009@defvar bidi-display-reordering
6009 The buffer-local variable @code{bidi-display-reordering} controls 6010 This buffer-local variable controls whether text in the buffer is
6010whether text in the buffer is reordered for display. If its value is 6011reordered for display. If its value is non-@code{nil}, Emacs reorders
6011non-@code{nil}, Emacs reorders characters that have right-to-left 6012characters that have right-to-left directionality when they are
6012directionality when they are displayed. The default value is 6013displayed. The default value is @code{t}. Text in overlay strings
6013@code{t}. Text in overlay strings (@pxref{Overlay 6014(@pxref{Overlay Properties,,before-string}), display strings
6014Properties,,before-string}), display strings (@pxref{Overlay 6015(@pxref{Overlay Properties,,display}), and @code{display} text
6015Properties,,display}), and @code{display} text properties 6016properties (@pxref{Display Property}) is also reordered for display if
6016(@pxref{Display Property}) is also reordered if the buffer whose text 6017the buffer whose text includes these strings is reordered. Turning
6017includes these strings is reordered for display. Turning off 6018off @code{bidi-display-reordering} for a buffer turns off reordering
6018@code{bidi-display-reordering} for a buffer turns off reordering of 6019of all the overlay and display strings in that buffer.
6019all the overlay and display strings in that buffer.
6020 6020
6021 Reordering of strings that are unrelated to any buffer, such as text 6021 Reordering of strings that are unrelated to any buffer, such as text
6022displayed on the mode line (@pxref{Mode Line Format}) or header line 6022displayed on the mode line (@pxref{Mode Line Format}) or header line
@@ -6056,7 +6056,7 @@ it is reordered for display. That is, the entire chunk of text
6056covered by these properties is reordered together. Moreover, the 6056covered by these properties is reordered together. Moreover, the
6057bidirectional properties of the characters in this chunk of text are 6057bidirectional properties of the characters in this chunk of text are
6058ignored, and Emacs reorders them as if they were replaced with a 6058ignored, and Emacs reorders them as if they were replaced with a
6059single character @code{u+FFFC}, known as the @dfn{Object Replacement 6059single character @code{U+FFFC}, known as the @dfn{Object Replacement
6060Character}. This means that placing a display property over a portion 6060Character}. This means that placing a display property over a portion
6061of text may change the way that the surrounding text is reordered for 6061of text may change the way that the surrounding text is reordered for
6062display. To prevent this unexpected effect, always place such 6062display. To prevent this unexpected effect, always place such
@@ -6073,9 +6073,9 @@ begins at the right margin and is continued or truncated at the left
6073margin. 6073margin.
6074 6074
6075@defvar bidi-paragraph-direction 6075@defvar bidi-paragraph-direction
6076 Emacs determines the base direction of each paragraph dynamically, 6076 By default, Emacs determines the base direction of each paragraph
6077based on the text at the beginning of the paragraph. The precise 6077dynamically, based on the text at the beginning of the paragraph. The
6078method of determining the base direction is specified by the 6078precise method of determining the base direction is specified by the
6079@acronym{UBA}; in a nutshell, the first character in a paragraph that 6079@acronym{UBA}; in a nutshell, the first character in a paragraph that
6080has an explicit directionality determines the base direction of the 6080has an explicit directionality determines the base direction of the
6081paragraph. However, sometimes a buffer may need to force a certain 6081paragraph. However, sometimes a buffer may need to force a certain
@@ -6087,6 +6087,13 @@ dynamic determination of the base direction, and instead forces all
6087paragraphs in the buffer to have the direction specified by its 6087paragraphs in the buffer to have the direction specified by its
6088buffer-local value. The value can be either @code{right-to-left} or 6088buffer-local value. The value can be either @code{right-to-left} or
6089@code{left-to-right}. Any other value is interpreted as @code{nil}. 6089@code{left-to-right}. Any other value is interpreted as @code{nil}.
6090The default is @code{nil}.
6091
6092@cindex @code{prog-mode}, and @code{bidi-paragraph-direction}
6093Modes that are meant to display program source code should force a
6094@code{left-to-right} paragraph direction. The easiest way of doing so
6095is to derive the mode from Prog Mode, which already sets
6096@code{bidi-paragraph-direction} to that value.
6090@end defvar 6097@end defvar
6091 6098
6092@defun current-bidi-paragraph-direction &optional buffer 6099@defun current-bidi-paragraph-direction &optional buffer
@@ -6099,3 +6106,70 @@ non-@code{nil}, the returned value will be identical to that value;
6099otherwise, the returned value reflects the paragraph direction 6106otherwise, the returned value reflects the paragraph direction
6100determined dynamically by Emacs. 6107determined dynamically by Emacs.
6101@end defun 6108@end defun
6109
6110@cindex layout on display, and bidirectional text
6111@cindex jumbled display of bidirectional text
6112@cindex concatenating bidirectional strings
6113 Reordering of bidirectional text for display can have surprising and
6114unpleasant effects when two strings with bidirectional content are
6115juxtaposed in a buffer, or otherwise programmatically concatenated
6116into a string of text. A typical example is a buffer whose lines are
6117actually sequences of items, or fields, separated by whitespace or
6118punctuation characters. This is used in specialized modes such as
6119Buffer-menu Mode or various email summary modes, like Rmail Summary
6120Mode. Because these separator characters are @dfn{weak}, i.e.@: have
6121no strong directionality, they take on the directionality of
6122surrounding text. As result, a numeric field that follows a field
6123with bidirectional content can be displayed @emph{to the left} of the
6124preceding field, producing a jumbled display and messing up the
6125expected layout.
6126
6127 To countermand this, you can use one of the following techniques for
6128forcing correct order of fields on display:
6129
6130@itemize @minus
6131@item
6132Append the special character @code{U+200E}, LEFT-TO-RIGHT MARK, or
6133@acronym{LRM}, to the end of each field that may have bidirectional
6134content, or prepend it to the beginning of the following field. The
6135function @code{bidi-string-mark-left-to-right}, described below, comes
6136in handy for this purpose. (In a right-to-left paragraph, use
6137@code{U+200F}, RIGHT-TO-LEFT MARK, or @acronym{RLM}, instead.) This
6138is one of the solutions recommended by
6139@uref{http://www.unicode.org/reports/tr9/#Separators, the
6140@acronym{UBA}}.
6141
6142@item
6143Include the tab character in the field separator. The tab character
6144plays the role of @dfn{segment separator} in the @acronym{UBA}
6145reordering, whose effect is to make each field a separate segment, and
6146thus reorder them separately.
6147@end itemize
6148
6149@defun bidi-string-mark-left-to-right string
6150This subroutine returns its argument @var{string}, possibly modified,
6151such that the result can be safely concatenated with another string,
6152or juxtaposed with another string in a buffer, without disrupting the
6153relative layout of this string and the next one on display. If the
6154string returned by this function is displayed as part of a
6155left-to-right paragraph, it will always appear on display to the left
6156of the text that follows it. The function works by examining the
6157characters of its argument, and if any of those characters could cause
6158reordering on display, the function appends the @acronym{LRM}
6159character to the string. The appended @acronym{LRM} character is made
6160@emph{invisible} (@pxref{Invisible Text}), to hide it on display.
6161@end defun
6162
6163 The reordering algorithm uses the bidirectional properties of the
6164characters stored as their @code{bidi-class} property
6165(@pxref{Character Properties}). Lisp programs can change these
6166properties by calling the @code{put-char-code-property} function.
6167However, doing this requires a thorough understanding of the
6168@acronym{UBA}, and is therefore not recommended. Any changes to the
6169bidirectional properties of a character have global effect: they
6170affect all Emacs frames and windows.
6171
6172 Similarly, the @code{mirroring} property is used to display the
6173appropriate mirrored character in the reordered text. Lisp programs
6174can affect the mirrored display by changing this property. Again, any
6175such changes affect all of Emacs display.
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 83f9f424834..7b6d665b2ac 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -392,7 +392,8 @@ The value is an integer number.
392@item bidi-class 392@item bidi-class
393Corresponds to the Unicode @code{Bidi_Class} property. The value is a 393Corresponds to the Unicode @code{Bidi_Class} property. The value is a
394symbol whose name is the Unicode @dfn{directional type} of the 394symbol whose name is the Unicode @dfn{directional type} of the
395character. 395character. Emacs uses this property when it reorders bidirectional
396text for display (@pxref{Bidirectional Display}).
396 397
397@item decomposition 398@item decomposition
398Corresponds to the Unicode @code{Decomposition_Type} and 399Corresponds to the Unicode @code{Decomposition_Type} and
@@ -440,7 +441,9 @@ defined mirroring glyph. All the characters whose @code{mirrored}
440property is @code{N} have @code{nil} as their @code{mirroring} 441property is @code{N} have @code{nil} as their @code{mirroring}
441property; however, some characters whose @code{mirrored} property is 442property; however, some characters whose @code{mirrored} property is
442@code{Y} also have @code{nil} for @code{mirroring}, because no 443@code{Y} also have @code{nil} for @code{mirroring}, because no
443appropriate characters exist with mirrored glyphs. 444appropriate characters exist with mirrored glyphs. Emacs uses this
445property to display mirror images of characters when appropriate
446(@pxref{Bidirectional Display}).
444 447
445@item old-name 448@item old-name
446Corresponds to the Unicode @code{Unicode_1_Name} property. The value 449Corresponds to the Unicode @code{Unicode_1_Name} property. The value
diff --git a/etc/NEWS b/etc/NEWS
index 8707a8b0adc..ec863dacef8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -234,6 +234,9 @@ these image types, minus those listed in `imagemagick-types-inhibit'.
234 234
235See the Emacs Lisp Reference Manual for more information. 235See the Emacs Lisp Reference Manual for more information.
236 236
237** New basic faces `error', `warning', `success' are available to
238highlight strings that indicate failure, caution or successful operation.
239
237** The colors for selected text (the region face) are taken from the GTK 240** The colors for selected text (the region face) are taken from the GTK
238theme when Emacs is built with GTK. 241theme when Emacs is built with GTK.
239 242
@@ -1043,15 +1046,17 @@ of function value which looks like (closure ENV ARGS &rest BODY).
1043*** New function `special-variable-p' to check whether a variable is 1046*** New function `special-variable-p' to check whether a variable is
1044declared as dynamically bound. 1047declared as dynamically bound.
1045 1048
1046** New function `string-mark-left-to-right'. 1049+++
1050** New function `bidi-string-mark-left-to-right'.
1047Given a string containing right-to-left (RTL) script, this function 1051Given a string containing right-to-left (RTL) script, this function
1048returns another string with a terminating LRM (left-to-right mark) 1052returns another string which can be safely inserted into a buffer as a
1049character. If this string is inserted into a buffer, Emacs treats the 1053distinct RTL "segment", without causing any following text to be
1050LRM as the end of an RTL segment and displays following text as LTR. 1054displayed as RTL. (This is done by appending a Unicode "left-to-right
1055mark" character.)
1051 1056
1052This is useful when the buffer has overall left-to-right (LTR) 1057This is useful when the buffer has overall left-to-right (LTR)
1053paragraph direction and you need to insert a string whose contents 1058paragraph direction and you need to insert a string whose contents and
1054(and hence directionality) are not known in advance. 1059directionality are not known in advance.
1055 1060
1056** pre/post-command-hook are not reset to nil upon error. 1061** pre/post-command-hook are not reset to nil upon error.
1057Instead, the offending function is removed. 1062Instead, the offending function is removed.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f57bd437af6..38c536af62c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,27 @@
12011-08-18 Chong Yidong <cyd@stupidchicken.com>
2
3 * international/characters.el: Add L and R categories.
4
5 * subr.el (bidi-string-mark-left-to-right): Rename from
6 string-mark-left-to-right. Use category search.
7
8 * buff-menu.el (Buffer-menu-buffer+size): Callers changed.
9
102011-08-18 Juri Linkov <juri@jurta.org>
11
12 * faces.el (error, warning, success): New faces with definitions
13 copied from old default values of `font-lock-warning-face',
14 `compilation-warning', `compilation-info' (bug#6117).
15
16 * font-lock.el (font-lock-warning-face): Inherit from `error'.
17
18 * progmodes/compile.el (compilation-error): Inherit from `error'.
19 (compilation-warning): Inherit from `warning'.
20 (compilation-info): Inherit from `success'.
21
22 * dired.el (dired-marked): Inherit from `warning'.
23 (dired-flagged): Inherit from `error'.
24
12011-08-17 Lars Magne Ingebrigtsen <larsi@gnus.org> 252011-08-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 26
3 * mail/smtpmail.el (auth-source): Require to avoid problems with 27 * mail/smtpmail.el (auth-source): Require to avoid problems with
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index a5b45921d28..2eac33d8157 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -681,9 +681,9 @@ For more information, see the function `buffer-menu'."
681 (string-width tail) 681 (string-width tail)
682 2)) 682 2))
683 Buffer-menu-short-ellipsis 683 Buffer-menu-short-ellipsis
684 (string-mark-left-to-right tail)))) 684 (bidi-string-mark-left-to-right tail))))
685 ;; Don't put properties on (buffer-name). 685 ;; Don't put properties on (buffer-name).
686 (setq name (string-mark-left-to-right name))) 686 (setq name (bidi-string-mark-left-to-right name)))
687 (add-text-properties 0 (length name) name-props name) 687 (add-text-properties 0 (length name) name-props name)
688 (add-text-properties 0 (length size) size-props size) 688 (add-text-properties 0 (length size) size-props size)
689 (let ((name+space-width (- Buffer-menu-buffer+size-width 689 (let ((name+space-width (- Buffer-menu-buffer+size-width
diff --git a/lisp/dired.el b/lisp/dired.el
index 746c16ff148..ecb626a275e 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -342,7 +342,7 @@ Subexpression 2 must end right before the \\n or \\r.")
342 "Face name used for dired marks.") 342 "Face name used for dired marks.")
343 343
344(defface dired-marked 344(defface dired-marked
345 '((t (:inherit font-lock-warning-face))) 345 '((t (:inherit warning)))
346 "Face used for marked files." 346 "Face used for marked files."
347 :group 'dired-faces 347 :group 'dired-faces
348 :version "22.1") 348 :version "22.1")
@@ -350,7 +350,7 @@ Subexpression 2 must end right before the \\n or \\r.")
350 "Face name used for marked files.") 350 "Face name used for marked files.")
351 351
352(defface dired-flagged 352(defface dired-flagged
353 '((t (:inherit font-lock-variable-name-face))) 353 '((t (:inherit error)))
354 "Face used for files flagged for deletion." 354 "Face used for files flagged for deletion."
355 :group 'dired-faces 355 :group 'dired-faces
356 :version "22.1") 356 :version "22.1")
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 9b485b58608..75c9a01323d 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -283,7 +283,7 @@ of column descriptors."
283 (> (length label) width) 283 (> (length label) width)
284 (setq label (concat (substring label 0 (- width 3)) 284 (setq label (concat (substring label 0 (- width 3))
285 "..."))) 285 "...")))
286 (setq label (string-mark-left-to-right label)) 286 (setq label (bidi-string-mark-left-to-right label))
287 (if (stringp desc) 287 (if (stringp desc)
288 (insert (propertize label 'help-echo help-echo)) 288 (insert (propertize label 'help-echo help-echo))
289 (apply 'insert-text-button label (cdr desc))) 289 (apply 'insert-text-button label (cdr desc)))
diff --git a/lisp/faces.el b/lisp/faces.el
index 9a78ab69caa..404bd7b6609 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2413,6 +2413,39 @@ Note: Other faces cannot inherit from the cursor face."
2413It is used for characters of no fonts too." 2413It is used for characters of no fonts too."
2414 :version "24.1" 2414 :version "24.1"
2415 :group 'basic-faces) 2415 :group 'basic-faces)
2416
2417(defface error
2418 '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold))
2419 (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
2420 (((class color) (min-colors 16) (background light)) (:foreground "Red1" :weight bold))
2421 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
2422 (((class color) (min-colors 8)) (:foreground "red"))
2423 (t (:inverse-video t :weight bold)))
2424 "Basic face used to highlight errors and to denote failure."
2425 :version "24.1"
2426 :group 'basic-faces)
2427
2428(defface warning
2429 '((((class color) (min-colors 16)) (:foreground "DarkOrange" :weight bold))
2430 (((class color)) (:foreground "yellow" :weight bold))
2431 (t (:weight bold)))
2432 "Basic face used to highlight warnings."
2433 :version "24.1"
2434 :group 'basic-faces)
2435
2436(defface success
2437 '((((class color) (min-colors 16) (background light))
2438 (:foreground "Green3" :weight bold))
2439 (((class color) (min-colors 88) (background dark))
2440 (:foreground "Green1" :weight bold))
2441 (((class color) (min-colors 16) (background dark))
2442 (:foreground "Green" :weight bold))
2443 (((class color)) (:foreground "green" :weight bold))
2444 (t (:weight bold)))
2445 "Basic face used to indicate successful operation."
2446 :version "24.1"
2447 :group 'basic-faces)
2448
2416 2449
2417;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2450;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2418;;; Manipulating font names. 2451;;; Manipulating font names.
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 6902ce98ab1..9cf889e1aec 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1959,12 +1959,7 @@ Sets various variables using `font-lock-defaults' and
1959 :group 'font-lock-faces) 1959 :group 'font-lock-faces)
1960 1960
1961(defface font-lock-warning-face 1961(defface font-lock-warning-face
1962 '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold)) 1962 '((t :inherit error))
1963 (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
1964 (((class color) (min-colors 16) (background light)) (:foreground "Red1" :weight bold))
1965 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
1966 (((class color) (min-colors 8)) (:foreground "red"))
1967 (t (:inverse-video t :weight bold)))
1968 "Font Lock mode face used to highlight warnings." 1963 "Font Lock mode face used to highlight warnings."
1969 :group 'font-lock-faces) 1964 :group 'font-lock-faces)
1970 1965
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index a9657c17b9f..47426784e51 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -114,6 +114,16 @@ A character which can't be placed at end of line.")
114Base characters (Unicode General Category L,N,P,S,Zs)") 114Base characters (Unicode General Category L,N,P,S,Zs)")
115(define-category ?^ "Combining 115(define-category ?^ "Combining
116Combining diacritic or mark (Unicode General Category M)") 116Combining diacritic or mark (Unicode General Category M)")
117
118;; bidi types
119(define-category ?R "Right-to-left (strong)
120Characters with \"strong\" right-to-left directionality, i.e.
121with R, AL, RLE, or RLO Unicode bidi character type.")
122
123(define-category ?L "Left-to-right (strong)
124Characters with \"strong\" left-to-right directionality, i.e.
125with L, LRE, or LRO Unicode bidi character type.")
126
117 127
118;;; Setting syntax and category. 128;;; Setting syntax and category.
119 129
@@ -478,6 +488,16 @@ Combining diacritic or mark (Unicode General Category M)")
478 (modify-category-entry x category)) 488 (modify-category-entry x category))
479 chars))))) 489 chars)))))
480 490
491;; Bidi categories
492
493(map-char-table (lambda (key val)
494 (cond
495 ((memq val '(R AL RLO RLE))
496 (modify-category-entry key ?R))
497 ((memq val '(L LRE LRO))
498 (modify-category-entry key ?L))))
499 (unicode-property-table-internal 'bidi-class))
500
481;; Latin 501;; Latin
482 502
483(modify-category-entry '(#x80 . #x024F) ?l) 503(modify-category-entry '(#x80 . #x024F) ?l)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 503698f0f7b..f3b873c8b1e 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -647,19 +647,19 @@ starting the compilation process.")
647(defvar compile-history nil) 647(defvar compile-history nil)
648 648
649(defface compilation-error 649(defface compilation-error
650 '((t :inherit font-lock-warning-face)) 650 '((t :inherit error))
651 "Face used to highlight compiler errors." 651 "Face used to highlight compiler errors."
652 :group 'compilation 652 :group 'compilation
653 :version "22.1") 653 :version "22.1")
654 654
655(defface compilation-warning 655(defface compilation-warning
656 '((t :inherit font-lock-variable-name-face)) 656 '((t :inherit warning))
657 "Face used to highlight compiler warnings." 657 "Face used to highlight compiler warnings."
658 :group 'compilation 658 :group 'compilation
659 :version "22.1") 659 :version "22.1")
660 660
661(defface compilation-info 661(defface compilation-info
662 '((t :inherit font-lock-type-face)) 662 '((t :inherit success))
663 "Face used to highlight compiler information." 663 "Face used to highlight compiler information."
664 :group 'compilation 664 :group 'compilation
665 :version "22.1") 665 :version "22.1")
diff --git a/lisp/subr.el b/lisp/subr.el
index a4251b6fee6..9aa895b0e94 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3539,30 +3539,23 @@ to case differences."
3539 (eq t (compare-strings str1 nil nil 3539 (eq t (compare-strings str1 nil nil
3540 str2 0 (length str1) ignore-case))) 3540 str2 0 (length str1) ignore-case)))
3541 3541
3542(defun string-mark-left-to-right (str) 3542(defun bidi-string-mark-left-to-right (str)
3543 "Return a string that can be safely inserted in left-to-right text. 3543 "Return a string that can be safely inserted in left-to-right text.
3544If STR contains right-to-left (RTL) script, return a string
3545consisting of STR followed by a terminating invisible
3546left-to-right mark (LRM) character.
3547 3544
3548The LRM character marks the end of an RTL segment, and resets the 3545Normally, inserting a string with right-to-left (RTL) script into
3549display direction of any subsequent text to left-to-right. 3546a buffer may cause some subsequent text to be displayed as part
3550\(Otherwise, some of that text might be displayed as part of the 3547of the RTL segment (usually this affects punctuation characters).
3551RTL segment, based on the bidirectional display algorithm.) 3548This function returns a string which displays as STR but forces
3549subsequent text to be displayed as left-to-right.
3552 3550
3553If STR contains no RTL characters, return STR." 3551If STR contains any RTL character, this function returns a string
3552consisting of STR followed by an invisible left-to-right mark
3553\(LRM) character. Otherwise, it returns STR."
3554 (unless (stringp str) 3554 (unless (stringp str)
3555 (signal 'wrong-type-argument (list 'stringp str))) 3555 (signal 'wrong-type-argument (list 'stringp str)))
3556 (let ((len (length str)) 3556 (if (string-match "\\cR" str)
3557 (n 0) 3557 (concat str (propertize (string ?\x200e) 'invisible t))
3558 rtl-found) 3558 str))
3559 (while (and (not rtl-found) (< n len))
3560 (setq rtl-found (memq (get-char-code-property
3561 (aref str n) 'bidi-class) '(R AL RLO))
3562 n (1+ n)))
3563 (if rtl-found
3564 (concat str (propertize (string ?\x200e) 'invisible t))
3565 str)))
3566 3559
3567;;;; invisibility specs 3560;;;; invisibility specs
3568 3561
diff --git a/src/ChangeLog b/src/ChangeLog
index fe8df6ffe41..275856c44e0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -421,6 +421,18 @@
421 (gs_load): Use printmax_t to print the widest integers possible. 421 (gs_load): Use printmax_t to print the widest integers possible.
422 Check for integer overflow when computing image height and width. 422 Check for integer overflow when computing image height and width.
423 423
4242011-08-18 Eli Zaretskii <eliz@gnu.org>
425
426 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
427 members before the level stack, so they would be saved and
428 restored when copying iterator state. Fixes incorrect reordering
429 around TABs covered by display properties.
430
4312011-08-18 Andreas Schwab <schwab@linux-m68k.org>
432
433 * process.c (Fnetwork_interface_list): Correctly determine buffer
434 size.
435
4242011-08-17 Chong Yidong <cyd@stupidchicken.com> 4362011-08-17 Chong Yidong <cyd@stupidchicken.com>
425 437
426 * eval.c (internal_condition_case, internal_condition_case_1) 438 * eval.c (internal_condition_case, internal_condition_case_1)
diff --git a/src/dispextern.h b/src/dispextern.h
index 14f2b3ac631..9cefea27e1c 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1860,6 +1860,9 @@ struct bidi_it {
1860 EMACS_INT ignore_bn_limit; /* position until which to ignore BNs */ 1860 EMACS_INT ignore_bn_limit; /* position until which to ignore BNs */
1861 bidi_dir_t sor; /* direction of start-of-run in effect */ 1861 bidi_dir_t sor; /* direction of start-of-run in effect */
1862 int scan_dir; /* direction of text scan, 1: forw, -1: back */ 1862 int scan_dir; /* direction of text scan, 1: forw, -1: back */
1863 EMACS_INT disp_pos; /* position of display string after ch */
1864 int disp_prop_p; /* if non-zero, there really is a
1865 `display' property/string at disp_pos */
1863 int stack_idx; /* index of current data on the stack */ 1866 int stack_idx; /* index of current data on the stack */
1864 /* Note: Everything from here on is not copied/saved when the bidi 1867 /* Note: Everything from here on is not copied/saved when the bidi
1865 iterator state is saved, pushed, or popped. So only put here 1868 iterator state is saved, pushed, or popped. So only put here
@@ -1868,9 +1871,6 @@ struct bidi_it {
1868 struct bidi_string_data string; /* string to reorder */ 1871 struct bidi_string_data string; /* string to reorder */
1869 bidi_dir_t paragraph_dir; /* current paragraph direction */ 1872 bidi_dir_t paragraph_dir; /* current paragraph direction */
1870 EMACS_INT separator_limit; /* where paragraph separator should end */ 1873 EMACS_INT separator_limit; /* where paragraph separator should end */
1871 EMACS_INT disp_pos; /* position of display string after ch */
1872 int disp_prop_p; /* if non-zero, there really is a
1873 `display' property/string at disp_pos */
1874 unsigned first_elt : 1; /* if non-zero, examine current char first */ 1874 unsigned first_elt : 1; /* if non-zero, examine current char first */
1875 unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */ 1875 unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */
1876 unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */ 1876 unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */
diff --git a/src/process.c b/src/process.c
index 9f3bb0e5803..08da53b4a40 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3581,33 +3581,31 @@ format; see the description of ADDRESS in `make-network-process'. */)
3581 if (s < 0) 3581 if (s < 0)
3582 return Qnil; 3582 return Qnil;
3583 3583
3584 again: 3584 do
3585
3586 buf = xpalloc (buf, &buf_size, sizeof *ifreq, INT_MAX, 1);
3587 ifconf.ifc_buf = buf;
3588 ifconf.ifc_len = buf_size;
3589 if (ioctl (s, SIOCGIFCONF, &ifconf))
3590 { 3585 {
3591 close (s); 3586 buf = xpalloc (buf, &buf_size, 1, INT_MAX, 1);
3592 xfree (buf); 3587 ifconf.ifc_buf = buf;
3593 return Qnil; 3588 ifconf.ifc_len = buf_size;
3589 if (ioctl (s, SIOCGIFCONF, &ifconf))
3590 {
3591 close (s);
3592 xfree (buf);
3593 return Qnil;
3594 }
3594 } 3595 }
3595 3596 while (ifconf.ifc_len == buf_size);
3596 if (ifconf.ifc_len == buf_size)
3597 goto again;
3598 3597
3599 close (s); 3598 close (s);
3600 3599
3601 res = Qnil; 3600 res = Qnil;
3602 for (ifreq = ifconf.ifc_req; 3601 ifreq = ifconf.ifc_req;
3603 (char *) ifreq < (char *) (ifconf.ifc_req) + ifconf.ifc_len; 3602 while ((char *) ifreq < (char *) ifconf.ifc_req + ifconf.ifc_len)
3604 )
3605 { 3603 {
3606 struct ifreq *ifq = ifreq; 3604 struct ifreq *ifq = ifreq;
3607#ifdef HAVE_STRUCT_IFREQ_IFR_ADDR_SA_LEN 3605#ifdef HAVE_STRUCT_IFREQ_IFR_ADDR_SA_LEN
3608#define SIZEOF_IFREQ(sif) \ 3606#define SIZEOF_IFREQ(sif) \
3609 ((sif)->ifr_addr.sa_len < sizeof(struct sockaddr) ? \ 3607 ((sif)->ifr_addr.sa_len < sizeof (struct sockaddr) \
3610 sizeof((*sif)) : sizeof ((sif)->ifr_name) + sif->ifr_addr.sa_len) 3608 ? sizeof (*(sif)) : sizeof ((sif)->ifr_name) + (sif)->ifr_addr.sa_len)
3611 3609
3612 int len = SIZEOF_IFREQ (ifq); 3610 int len = SIZEOF_IFREQ (ifq);
3613#else 3611#else
@@ -3615,7 +3613,7 @@ format; see the description of ADDRESS in `make-network-process'. */)
3615#endif 3613#endif
3616 char namebuf[sizeof (ifq->ifr_name) + 1]; 3614 char namebuf[sizeof (ifq->ifr_name) + 1];
3617 i += len; 3615 i += len;
3618 ifreq = (struct ifreq*) ((char*) ifreq + len); 3616 ifreq = (struct ifreq *) ((char *) ifreq + len);
3619 3617
3620 if (ifq->ifr_addr.sa_family != AF_INET) 3618 if (ifq->ifr_addr.sa_family != AF_INET)
3621 continue; 3619 continue;