[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eldoc-eval 5ecafc2b3d 26/28: Better fix to prevent erro
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eldoc-eval 5ecafc2b3d 26/28: Better fix to prevent error with composition-function-table |
Date: |
Thu, 6 Jan 2022 08:34:57 -0500 (EST) |
branch: externals/eldoc-eval
commit 5ecafc2b3d3e712c96dcdbcff0cbe43f1b6fed3d
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Better fix to prevent error with composition-function-table
when ligature-mode is enabled.
This modify only mode-line string without modifying text in current-buffer
while in the minibuffer.
---
eldoc-eval.el | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/eldoc-eval.el b/eldoc-eval.el
index ef9a32e297..0528f6c256 100644
--- a/eldoc-eval.el
+++ b/eldoc-eval.el
@@ -183,6 +183,18 @@ See `with-eldoc-in-minibuffer'."
'above (minibuffer-window)))
(t (minibuffer-selected-window))))))
+(defun eldoc-eval--get-string (str)
+ ;; Avoid error when ligature-mode is enabled. The error comes from
+ ;; composite.c.
+ ;; (error "Attempt to shape unibyte text"). This happen when string
+ ;; comes with [...] at end.
+ (with-temp-buffer
+ (let ((composition-function-table
+ (default-value 'composition-function-table)))
+ (when (stringp str)
+ (insert str)
+ (buffer-string)))))
+
(defun eldoc-show-in-mode-line (input)
"Display string STR in the mode-line next to minibuffer."
(with-current-buffer (eldoc-current-buffer)
@@ -190,15 +202,17 @@ See `with-eldoc-in-minibuffer'."
(str (and (stringp input) (concat " " input)))
(len (length str))
(tmp-str str)
- (composition-function-table (default-value
'composition-function-table))
- (mode-line-format (or str mode-line-format))
+ (mode-line-format
+ (or (eldoc-eval--get-string str)
+ mode-line-format))
roll mode-line-in-non-selected-windows)
(catch 'break
(if (and (> len max) eldoc-mode-line-rolling-flag)
(progn
(while (setq roll (sit-for 0.3))
(setq tmp-str (substring tmp-str 2)
- mode-line-format (concat tmp-str " [<]" str))
+ mode-line-format (eldoc-eval--get-string
+ (concat tmp-str " [<]" str)))
(force-mode-line-update)
(when (< (length tmp-str) 2) (setq tmp-str str)))
(unless roll
- [elpa] externals/eldoc-eval 7903b1e863 01/28: * eldoc-eval.el: Merge Stefan changes on ELPA., (continued)
- [elpa] externals/eldoc-eval 7903b1e863 01/28: * eldoc-eval.el: Merge Stefan changes on ELPA., Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval e646f28a88 21/28: Move eldoc-in-minibuffer-mode-map definition, Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval 6514b3377f 20/28: Silence the warning, Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval 475d68155b 23/28: Remove :version no more needed, Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval 99a055e2de 19/28: Move the minor mode definition, Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval e2d9805592 05/28: * eldoc-eval.el (eldoc-mode-line-stop-rolling-on-input): New user var., Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval e87b89f89a 14/28: Update readme., Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval 9e7a1660f5 09/28: * eldoc-eval.el: Fix, eldoc-post-insert-mode doesn't exists anymore., Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval deca5e39f3 13/28: Fix eldoc compat with emacs-25., Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval de6f4523db 10/28: * eldoc-eval.el: Fix compatibility with emacs-25., Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval 5ecafc2b3d 26/28: Better fix to prevent error with composition-function-table,
Stefan Monnier <=
- [elpa] externals/eldoc-eval 92b7c0ca4a 25/28: Fix error and even emacs crash when composition-function-table is modified, Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval 7e6bc86562 04/28: * eldoc-eval.el (eldoc-in-minibuffer-mode-lighter): New user var., Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval f6e639047d 27/28: Update README.md, Stefan Monnier, 2022/01/06
- [elpa] externals/eldoc-eval cff4170b4a 28/28: Merge commit 'b4fb63726b', Stefan Monnier, 2022/01/06