emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/drupal-mode 319acd5761 240/308: Moved eldoc stuff to separ


From: ELPA Syncer
Subject: [nongnu] elpa/drupal-mode 319acd5761 240/308: Moved eldoc stuff to separate file.
Date: Tue, 25 Jan 2022 10:59:51 -0500 (EST)

branch: elpa/drupal-mode
commit 319acd576147144985dbb38d5a5747703c60d2eb
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>

    Moved eldoc stuff to separate file.
---
 drupal-mode.el  |  9 +--------
 drupal/eldoc.el | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/drupal-mode.el b/drupal-mode.el
index ca94c1d8c4..3efde98b9b 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -302,14 +302,6 @@ function arguments.")
 
   ;; Stuff special for php-mode buffers.
   (when (apply 'derived-mode-p drupal-php-modes)
-    ;; Show function arguments from GNU GLOBAL for function at point
-    ;; after a short delay of idle time.
-    (when (and drupal-get-function-args
-               (fboundp 'eldoc-mode))
-      (set (make-local-variable 'eldoc-documentation-function)
-           #'drupal-eldoc-documentation-function)
-      (eldoc-mode 1))
-
     ;; Set correct comment style for inline comments.
     (setq comment-start "//")
     (setq comment-padding " ")
@@ -877,6 +869,7 @@ mode-hook."
 
 ;; Load support for various Emacs features if necessary.
 (eval-after-load 'autoinsert '(require 'drupal/autoinsert))
+(eval-after-load 'eldoc '(require 'drupal/eldoc))
 (eval-after-load 'etags '(require 'drupal/etags))
 (eval-after-load 'gtags '(require 'drupal/gtags))
 (eval-after-load 'ggtags '(require 'drupal/ggtags))
diff --git a/drupal/eldoc.el b/drupal/eldoc.el
new file mode 100644
index 0000000000..ed0f4e7b5a
--- /dev/null
+++ b/drupal/eldoc.el
@@ -0,0 +1,47 @@
+;;; drupal/eldoc.el --- Drupal-mode support for eldoc.el
+
+;; Copyright (C) 2015 Arne Jørgensen
+
+;; Author: Arne Jørgensen <arne@arnested.dk>
+
+;; This file is part of Drupal mode.
+
+;; Drupal mode is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published
+;; by the Free Software Foundation, either version 3 of the License,
+;; or (at your option) any later version.
+
+;; Drupal mode is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with Drupal mode.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Enable drupal-mode support for eldoc.
+
+;;; Code:
+
+(defun drupal/eldoc-enable ()
+  "Enable eldoc in PHP files."
+  (when (apply 'derived-mode-p drupal-php-modes)
+    ;; Show function arguments from GNU GLOBAL for function at point
+    ;; after a short delay of idle time.
+    (when (fboundp 'eldoc-mode)
+      (set (make-local-variable 'eldoc-documentation-function)
+           #'drupal-eldoc-documentation-function)
+      (eldoc-mode 1))))
+
+(add-hook 'drupal-mode-hook #'drupal/eldoc-enable)
+
+(when drupal-mode
+  (drupal/eldoc-enable))
+
+
+
+(provide 'drupal/eldoc)
+
+;;; drupal/eldoc.el ends here



reply via email to

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