[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 f95cd5c: Improve customization of arabic-shaper-Z
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] emacs-26 f95cd5c: Improve customization of arabic-shaper-ZWNJ-handling. |
Date: |
Sun, 15 Oct 2017 10:41:47 -0400 (EDT) |
branch: emacs-26
commit f95cd5cd7006d2801948b75f7a270ea66d5579bf
Author: K. Handa <address@hidden>
Commit: K. Handa <address@hidden>
Improve customization of arabic-shaper-ZWNJ-handling.
Make the effect of customizing arabic-shaper-ZWNJ-handling appear
immediately.
* lisp/language/misc-lang.el (arabic-shaper-ZWNJ-handling): Add :set
value.
* src/composite.c (Fclear_composition_cache): New function.
(syms_of_composite): Defsubr it.
---
lisp/language/misc-lang.el | 5 ++++-
src/composite.c | 15 +++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el
index a63c3a2..cbb581f 100644
--- a/lisp/language/misc-lang.el
+++ b/lisp/language/misc-lang.el
@@ -95,7 +95,10 @@ Customizing the value takes effect when you start Emacs next
time."
:type '(choice
(const :tag "default" nil)
(const :tag "as space" as-space)
- (const :tag "absorb" absorb)))
+ (const :tag "absorb" absorb))
+ :set (lambda (sym val)
+ (set-default sym val)
+ (clear-composition-cache)))
;; Record error in arabic-change-gstring.
(defvar arabic-shape-log nil)
diff --git a/src/composite.c b/src/composite.c
index c01e2e3..1a348dd 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -686,6 +686,20 @@ composition_gstring_from_id (ptrdiff_t id)
return HASH_VALUE (h, id);
}
+DEFUN ("clear-composition-cache", Fclear_composition_cache,
+ Sclear_composition_cache, 0, 0, 0,
+ doc: /* Internal use only.
+Clear composition cache. */)
+ (void)
+{
+ Lisp_Object args[] = {QCtest, Qequal, QCsize, make_number (311)};
+ gstring_hash_table = CALLMANY (Fmake_hash_table, args);
+ /* Fixme: We call Fclear_face_cache to force complete re-building of
+ display glyphs. But, it may be better to call this function from
+ Fclear_face_cache instead. */
+ Fclear_face_cache (Qt);
+}
+
bool
composition_gstring_p (Lisp_Object gstring)
{
@@ -1982,4 +1996,5 @@ See also the documentation of `auto-composition-mode'.
*/);
defsubr (&Scompose_string_internal);
defsubr (&Sfind_composition_internal);
defsubr (&Scomposition_get_gstring);
+ defsubr (&Sclear_composition_cache);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 f95cd5c: Improve customization of arabic-shaper-ZWNJ-handling.,
Kenichi Handa <=