emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 6dc0baf 1/2: ; Revert "Use eldoc-documentation-func


From: Dmitry Gutov
Subject: [Emacs-diffs] master 6dc0baf 1/2: ; Revert "Use eldoc-documentation-functions"
Date: Sun, 17 Jul 2016 23:46:49 +0000 (UTC)

branch: master
commit 6dc0bafd5915b01a341cc0efbc744abd73163872
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    ; Revert "Use eldoc-documentation-functions"
    
    This reverts commit 001d88b62ecb8163a148656acb103b354ce7613a.
    
    It doesn't have the consensus, as evidenced by
    http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00138.html
---
 lisp/hexl.el                 |    4 ++--
 lisp/ielm.el                 |    4 ++--
 lisp/progmodes/cfengine.el   |   15 ++++++---------
 lisp/progmodes/elisp-mode.el |    4 ++--
 lisp/progmodes/octave.el     |    5 +++--
 lisp/progmodes/python.el     |   14 ++++++--------
 lisp/simple.el               |    4 ++--
 7 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/lisp/hexl.el b/lisp/hexl.el
index 61d7dd0..5f099a5 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -395,8 +395,8 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
     (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t)
 
     ;; Set a callback function for eldoc.
-    (add-hook 'eldoc-documentation-functions
-              #'hexl-print-current-point-info nil t)
+    (add-function :before-until (local 'eldoc-documentation-function)
+                  #'hexl-print-current-point-info)
     (eldoc-add-command-completions "hexl-")
     (eldoc-remove-command "hexl-save-buffer"
                          "hexl-current-address")
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 278a637..dd02778 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -541,8 +541,8 @@ Customized bindings may be defined in `ielm-map', which 
currently contains:
   (set (make-local-variable 'completion-at-point-functions)
        '(comint-replace-by-expanded-history
          ielm-complete-filename elisp-completion-at-point))
-  (add-hook 'eldoc-documentation-functions
-            #'elisp-eldoc-documentation-function nil t)
+  (add-function :before-until (local 'eldoc-documentation-function)
+                #'elisp-eldoc-documentation-function)
   (set (make-local-variable 'ielm-prompt-internal) ielm-prompt)
   (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only)
   (setq comint-get-old-input 'ielm-get-old-input)
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index ace012f..0830214 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -1390,15 +1390,12 @@ to the action header."
                  (when buffer-file-name
                    (shell-quote-argument buffer-file-name)))))
 
-  (if (boundp 'eldoc-documentation-functions)
-      (add-hook 'eldoc-documentation-functions
-                #'cfengine3-documentation-function nil t)
-    ;; For emacs < 25.1 where `eldoc-documentation-function' defaults to
-    ;; nil.
-    (or eldoc-documentation-function
-        (setq-local eldoc-documentation-function #'ignore))
-    (add-function :before-until (local 'eldoc-documentation-function)
-                  #'cfengine3-documentation-function))
+  ;; For emacs < 25.1 where `eldoc-documentation-function' defaults to
+  ;; nil.
+  (or eldoc-documentation-function
+      (setq-local eldoc-documentation-function #'ignore))
+  (add-function :before-until (local 'eldoc-documentation-function)
+                #'cfengine3-documentation-function)
 
   (add-hook 'completion-at-point-functions
             #'cfengine3-completion-function nil t)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 5f9bdac..f360791 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -235,8 +235,8 @@ Blank lines separate paragraphs.  Semicolons start comments.
               (append '((?\` . ?\') (?‘ . ?’)) electric-pair-text-pairs))
   (setq-local electric-quote-string t)
   (setq imenu-case-fold-search nil)
-  (add-hook 'eldoc-documentation-functions
-            #'elisp-eldoc-documentation-function nil t)
+  (add-function :before-until (local 'eldoc-documentation-function)
+                #'elisp-eldoc-documentation-function)
   (add-hook 'xref-backend-functions #'elisp--xref-backend nil t)
   (setq-local project-vc-external-roots-function #'elisp-load-path-roots)
   (add-hook 'completion-at-point-functions
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index b9a86e7..4f223f2 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -596,7 +596,8 @@ Key bindings:
   (add-hook 'before-save-hook 'octave-sync-function-file-names nil t)
   (setq-local beginning-of-defun-function 'octave-beginning-of-defun)
   (and octave-font-lock-texinfo-comment (octave-font-lock-texinfo-comment))
-  (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t)
+  (add-function :before-until (local 'eldoc-documentation-function)
+                'octave-eldoc-function)
 
   (easy-menu-add octave-mode-menu))
 
@@ -732,7 +733,7 @@ Key bindings:
   (setq font-lock-defaults '(inferior-octave-font-lock-keywords nil nil))
 
   (setq-local info-lookup-mode 'octave-mode)
-  (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t)
+  (setq-local eldoc-documentation-function 'octave-eldoc-function)
 
   (setq-local comint-input-ring-file-name
               (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist"))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index ba3cdfe..ad69f87 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5153,14 +5153,12 @@ returned as is."
                                                  (current-column))))
          (^ '(- (1+ (current-indentation))))))
 
-  (if (boundp 'eldoc-documentation-functions)
-      (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t)
-    (if (null eldoc-documentation-function)
-        ;; Emacs<25
-        (set (make-local-variable 'eldoc-documentation-function)
-             #'python-eldoc-function)
-      (add-function :before-until (local 'eldoc-documentation-function)
-                    #'python-eldoc-function)))
+  (if (null eldoc-documentation-function)
+      ;; Emacs<25
+      (set (make-local-variable 'eldoc-documentation-function)
+           #'python-eldoc-function)
+    (add-function :before-until (local 'eldoc-documentation-function)
+                  #'python-eldoc-function))
 
   (add-to-list
    'hs-special-modes-alist
diff --git a/lisp/simple.el b/lisp/simple.el
index 06d1b92..a757876 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1443,8 +1443,8 @@ result of expression evaluation."
     (minibuffer-with-setup-hook
         (lambda ()
           ;; FIXME: call emacs-lisp-mode?
-          (add-hook 'eldoc-documentation-functions
-                    #'elisp-eldoc-documentation-function nil t)
+          (add-function :before-until (local 'eldoc-documentation-function)
+                        #'elisp-eldoc-documentation-function)
           (add-hook 'completion-at-point-functions
                     #'elisp-completion-at-point nil t)
           (run-hooks 'eval-expression-minibuffer-setup-hook))



reply via email to

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