emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ca528f7c6ac: Suppress bogus messages in the echo area


From: Arash Esbati
Subject: master ca528f7c6ac: Suppress bogus messages in the echo area
Date: Wed, 10 Apr 2024 17:10:08 -0400 (EDT)

branch: master
commit ca528f7c6ac9b907564298bc96663579d09f9434
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Suppress bogus messages in the echo area
    
    * lisp/textmodes/reftex-dcr.el (reftex-view-crossref-when-idle):
    Check if point inside a mandatory argument where the cite/ref key
    usually resides.  For example, with \cite[45]{emacs:30} and point
    on 4, the following bogus message in the echo area is suppressed:
    "cite: no such database entry: \cite[45]".  (bug#38258)
    Fix docstring.
---
 lisp/textmodes/reftex-dcr.el | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index 2c5e5cb7ce6..c8ca054407c 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -241,9 +241,9 @@ With argument, actually select the window showing the cross 
reference."
   (reftex-view-crossref current-prefix-arg))
 
 (defun reftex-view-crossref-when-idle ()
-  ;; Display info about crossref at point in echo area or a window.
-  ;; This function was designed to work with an idle timer.
-  ;; We try to get out of here as quickly as possible if the call is useless.
+  "Display info about crossref at point in echo area or a window.
+This function is designed to work with an idle timer and returns quickly
+if the call is useless."
   (and reftex-mode
        ;; Make sure message area is free if we need it.
        (or (eq reftex-auto-view-crossref 'window) (not (current-message)))
@@ -255,7 +255,15 @@ With argument, actually select the window showing the 
cross reference."
        (save-excursion
          (search-backward "\\" nil t)
          (looking-at "\\\\[a-zA-Z]*\\(cite\\|ref\\|bibentry\\)"))
-
+       ;; Also check if point is inside a mandatory argument where the
+       ;; cite/ref key usually resides: (bug#38258)
+       (save-excursion
+         (condition-case nil
+             (let ((forward-sexp-function nil))
+               (up-list -1)
+               (= (following-char) ?\{))
+           (error nil)))
+       ;; Finally, call `reftex-view-crossref':
        (condition-case nil
            (let ((current-prefix-arg nil))
              (cond



reply via email to

[Prev in Thread] Current Thread [Next in Thread]