branch: externals/greader
commit 8324f125dbd442774d84baa6c80a2937598951a5
Author: Michelangelo Rodriguez <[email protected]>
Commit: Michelangelo Rodriguez <[email protected]>

    greader-dict: ignore errors when adding a newline to temp buffer
    
    When processing a single word, greader-dict appends a newline to the
    temporary buffer. This commit wraps the "newline" call in
    "ignore-errors" to prevent potential failures from interrupting the
    execution, especially if the buffer state is restricted.
---
 greader-dict.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/greader-dict.el b/greader-dict.el
index b618b7c111..86e2805ce6 100644
--- a/greader-dict.el
+++ b/greader-dict.el
@@ -497,7 +497,7 @@ by adding every match found in the text as a word."
          ;; We check if text is actually just one word, and in that case
          ;; insert a new line at end of temp buffer.
          (when (= (count-words (point-min) (point-max)) 1)
-           (save-excursion (goto-char (point-max)) (newline)))
+           (save-excursion (goto-char (point-max)) (ignore-errors (newline))))
          (let ((inhibit-read-only t))
            (re-search-forward "\\w" nil t)
            (while (not (eobp))

Reply via email to