diff options
| author | Paul Eggert | 2011-08-18 10:01:52 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-08-18 10:01:52 -0700 |
| commit | 76667214e7bdc7f6196de2bb6d7e14ef879a2694 (patch) | |
| tree | 58ca2d3448d502ff4ac2e46aefc8b90582c4d1ab /lisp | |
| parent | 2fab8395070ff77b836cb8ca9b84c261c4387a9a (diff) | |
| parent | 92b714445aac9be4227684f9c90cd61c3a0f02d5 (diff) | |
| download | emacs-76667214e7bdc7f6196de2bb6d7e14ef879a2694.tar.gz emacs-76667214e7bdc7f6196de2bb6d7e14ef879a2694.zip | |
Merge from trunk.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 24 | ||||
| -rw-r--r-- | lisp/buff-menu.el | 4 | ||||
| -rw-r--r-- | lisp/dired.el | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 2 | ||||
| -rw-r--r-- | lisp/faces.el | 33 | ||||
| -rw-r--r-- | lisp/font-lock.el | 7 | ||||
| -rw-r--r-- | lisp/international/characters.el | 20 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 6 | ||||
| -rw-r--r-- | lisp/subr.el | 31 |
9 files changed, 98 insertions, 33 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f57bd437af6..38c536af62c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2011-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 | |||
| 10 | 2011-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 | |||
| 1 | 2011-08-17 Lars Magne Ingebrigtsen <larsi@gnus.org> | 25 | 2011-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." | |||
| 2413 | It is used for characters of no fonts too." | 2413 | It 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.") | |||
| 114 | Base characters (Unicode General Category L,N,P,S,Zs)") | 114 | Base characters (Unicode General Category L,N,P,S,Zs)") |
| 115 | (define-category ?^ "Combining | 115 | (define-category ?^ "Combining |
| 116 | Combining diacritic or mark (Unicode General Category M)") | 116 | Combining diacritic or mark (Unicode General Category M)") |
| 117 | |||
| 118 | ;; bidi types | ||
| 119 | (define-category ?R "Right-to-left (strong) | ||
| 120 | Characters with \"strong\" right-to-left directionality, i.e. | ||
| 121 | with R, AL, RLE, or RLO Unicode bidi character type.") | ||
| 122 | |||
| 123 | (define-category ?L "Left-to-right (strong) | ||
| 124 | Characters with \"strong\" left-to-right directionality, i.e. | ||
| 125 | with 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. |
| 3544 | If STR contains right-to-left (RTL) script, return a string | ||
| 3545 | consisting of STR followed by a terminating invisible | ||
| 3546 | left-to-right mark (LRM) character. | ||
| 3547 | 3544 | ||
| 3548 | The LRM character marks the end of an RTL segment, and resets the | 3545 | Normally, inserting a string with right-to-left (RTL) script into |
| 3549 | display direction of any subsequent text to left-to-right. | 3546 | a buffer may cause some subsequent text to be displayed as part |
| 3550 | \(Otherwise, some of that text might be displayed as part of the | 3547 | of the RTL segment (usually this affects punctuation characters). |
| 3551 | RTL segment, based on the bidirectional display algorithm.) | 3548 | This function returns a string which displays as STR but forces |
| 3549 | subsequent text to be displayed as left-to-right. | ||
| 3552 | 3550 | ||
| 3553 | If STR contains no RTL characters, return STR." | 3551 | If STR contains any RTL character, this function returns a string |
| 3552 | consisting 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 | ||