]> git.eshelyaron.com Git - emacs.git/commitdiff
Shoosh warnings about obsolete eldoc-documentation-function
authorJoão Távora <joaotavora@gmail.com>
Wed, 8 Jul 2020 19:20:14 +0000 (20:20 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 8 Jul 2020 19:20:19 +0000 (20:20 +0100)
* lisp/progmodes/cfengine.el (cfengine3-mode): Remove mention to
obsolete eldoc-documentation-function.

* lisp/progmodes/python.el (python-mode): Use with-no-warnings.

lisp/progmodes/cfengine.el
lisp/progmodes/python.el

index acf70a5ad90052fcc2d9e6dc034cbf2f4aae19aa..a8fe485b7026506e742069ccb34540b4719f8ff4 100644 (file)
@@ -1390,15 +1390,8 @@ 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))
+  (add-hook 'eldoc-documentation-functions
+            #'cfengine3-documentation-function nil t)
 
   (add-hook 'completion-at-point-functions
             #'cfengine3-completion-function nil t)
index 36b62bfe96ef6b2a79c39c07fdd33874f164175c..165463aef59b34cd9cbf9d2a771f54b3cbe9a6f9 100644 (file)
@@ -5553,14 +5553,16 @@ REPORT-FN is Flymake's callback function."
                                                  (current-column))))
          (^ '(- (1+ (current-indentation))))))
 
-  (if (null eldoc-documentation-function)
-      ;; Emacs<25
-      (set (make-local-variable 'eldoc-documentation-function)
-           #'python-eldoc-function)
-    (if (boundp 'eldoc-documentation-functions)
-        (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t)
-      (add-function :before-until (local 'eldoc-documentation-function)
-                    #'python-eldoc-function)))
+  (with-no-warnings
+    ;; supress warnings about eldoc-documentation-function being obsolete
+   (if (null eldoc-documentation-function)
+       ;; Emacs<25
+       (set (make-local-variable 'eldoc-documentation-function)
+            #'python-eldoc-function)
+     (if (boundp 'eldoc-documentation-functions)
+         (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t)
+       (add-function :before-until (local 'eldoc-documentation-function)
+                     #'python-eldoc-function))))
 
   (add-to-list
    'hs-special-modes-alist