emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112076: Make sure eldoc can be turne


From: Leo Liu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112076: Make sure eldoc can be turned off properly.
Date: Mon, 18 Mar 2013 17:16:15 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112076
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Mon 2013-03-18 17:16:15 +0800
message:
  Make sure eldoc can be turned off properly.
  
  * emacs-lisp/eldoc.el (eldoc-schedule-timer): Conditionalize on
  eldoc-mode.
  (eldoc-display-message-p): Revert last change.
  (eldoc-display-message-no-interference-p)
  (eldoc-print-current-symbol-info): Tweak.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/eldoc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-18 07:41:38 +0000
+++ b/lisp/ChangeLog    2013-03-18 09:16:15 +0000
@@ -1,3 +1,12 @@
+2013-03-18  Leo Liu  <address@hidden>
+
+       Make sure eldoc can be turned off properly.
+       * emacs-lisp/eldoc.el (eldoc-schedule-timer): Conditionalize on
+       eldoc-mode.
+       (eldoc-display-message-p): Revert last change.
+       (eldoc-display-message-no-interference-p)
+       (eldoc-print-current-symbol-info): Tweak.
+
 2013-03-18  Tassilo Horn  <address@hidden>
 
        * doc-view.el (doc-view-new-window-function): Check the new window

=== modified file 'lisp/emacs-lisp/eldoc.el'
--- a/lisp/emacs-lisp/eldoc.el  2013-03-17 15:00:37 +0000
+++ b/lisp/emacs-lisp/eldoc.el  2013-03-18 09:16:15 +0000
@@ -198,8 +198,9 @@
   (or (and eldoc-timer
            (memq eldoc-timer timer-idle-list))
       (setq eldoc-timer
-            (run-with-idle-timer eldoc-idle-delay t
-                                 'eldoc-print-current-symbol-info)))
+            (run-with-idle-timer
+            eldoc-idle-delay t
+            (lambda () (and eldoc-mode (eldoc-print-current-symbol-info))))))
 
   ;; If user has changed the idle delay, update the timer.
   (cond ((not (= eldoc-idle-delay eldoc-current-idle-delay))
@@ -272,21 +273,19 @@
 ;; Decide whether now is a good time to display a message.
 (defun eldoc-display-message-p ()
   (and (eldoc-display-message-no-interference-p)
-       ;; `eldoc-post-insert-mode' uses no timers.
-       (or (not eldoc-mode)
-          ;; If this-command is non-nil while running via an idle
-          ;; timer, we're still in the middle of executing a command,
-          ;; e.g. a query-replace where it would be annoying to
-          ;; overwrite the echo area.
-          (and (not this-command)
-               (symbolp last-command)
-               (intern-soft (symbol-name last-command)
-                            eldoc-message-commands)))))
+       ;; If this-command is non-nil while running via an idle
+       ;; timer, we're still in the middle of executing a command,
+       ;; e.g. a query-replace where it would be annoying to
+       ;; overwrite the echo area.
+       (and (not this-command)
+           (symbolp last-command)
+           (intern-soft (symbol-name last-command)
+                        eldoc-message-commands))))
 
 ;; Check various conditions about the current environment that might make
 ;; it undesirable to print eldoc messages right this instant.
 (defun eldoc-display-message-no-interference-p ()
-  (and (or eldoc-mode eldoc-post-insert-mode)
+  (and eldoc-mode
        (not executing-kbd-macro)
        (not (and (boundp 'edebug-active) edebug-active))))
 
@@ -310,7 +309,7 @@
 
 (defun eldoc-print-current-symbol-info ()
   (condition-case err
-      (and (eldoc-display-message-p)
+      (and (or (eldoc-display-message-p) eldoc-post-insert-mode)
           (if eldoc-documentation-function
               (eldoc-message (funcall eldoc-documentation-function))
             (let* ((current-symbol (eldoc-current-symbol))


reply via email to

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