[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 2f8ce00821 074/308: A functions args is shown
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 2f8ce00821 074/308: A functions args is shown in tooltip after 5 sec of idle time. |
Date: |
Tue, 25 Jan 2022 10:59:30 -0500 (EST) |
branch: elpa/drupal-mode
commit 2f8ce00821af9691487320ce1946db2cff3a2a89
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
A functions args is shown in tooltip after 5 sec of idle time.
If a `drupal-get-function-args' is defined (drupal/gtags.el does this)
is defined a functions arguments is shown in a tooltip after 5 seconds
of idle time.
---
drupal-mode.el | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index e59ba38fe8..7228f5fdfd 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/arnested/drupal-mode
;; Created: January 17, 2012
;; Version: 0.2.0
-;; Package-Requires: ((php-mode "1.5.0"))
+;; Package-Requires: ((php-mode "1.5.0") (pos-tip "0.4.5"))
;; Keywords: programming, php, drupal
;; This file is part of Drupal mode.
@@ -35,6 +35,7 @@
(require 'php-mode)
(require 'format-spec)
+(autoload 'pos-tip-show "pos-tip")
@@ -130,6 +131,11 @@ Include path to the executable if it is not in your $PATH."
:link '(variable-link drupal-drush-program)
:group 'drupal-drush)
+(defcustom drupal-show-function-arguments-tooltip-delay 5
+ "Show function arguments tooltip after a delay (seconds)."
+ :type '(integer)
+ :group 'drupal)
+
;;;###autoload
(defcustom drupal-php-modes (list 'php-mode 'web-mode)
"Major modes to consider PHP in Drupal mode."
@@ -218,6 +224,12 @@ Include path to the executable if it is not in your $PATH."
;; 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 drupal-get-function-args
+ (run-with-idle-timer drupal-show-function-arguments-tooltip-delay t
'drupal-get-function-args-at-point))
+
+ ;; Setup cc-mode style stuff.
(when (derived-mode-p 'c-mode)
(c-add-language 'drupal-mode 'c-mode)
(c-set-style "drupal"))))
@@ -441,6 +453,15 @@ instead."
(search-forward-regexp (concat symbol "(\\(.*\\))") nil t)
(match-string-no-properties 1))))
+(defun drupal-get-function-args-at-point ()
+ "Show function arguments for function at point."
+ (interactive)
+ (when drupal-get-function-args
+ (let* ((symbol (php-get-pattern))
+ (args (funcall drupal-get-function-args symbol)))
+ (when args
+ (pos-tip-show (format "%s(%s)" symbol args))))))
+
;; Detect Drupal and Drupal version
- [nongnu] elpa/drupal-mode 9d5808972f 283/308: Add Travis notifications to Gitter.im room, (continued)
- [nongnu] elpa/drupal-mode 9d5808972f 283/308: Add Travis notifications to Gitter.im room, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode b0ca2c3965 285/308: Merge branch 'release/0.7.3' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a8d3e30000 291/308: Link to drupal.org using www prefix, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e58d96723f 297/308: Merge pull request #81 from arnested/misc-fixes-02-2020, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ee1a24c96a 301/308: Make sure we get the actual module name even when having double extensions like .info.yml, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode efef280529 299/308: Fix some more drupal.org URL's, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5bc4170e87 305/308: Fix byte-compiler warnings, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e1533052ad 306/308: Merge pull request #87 from skangas/silence-byte-compiler, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 89783165ad 225/308: Fixed wrong type argument in drupal-convert-line-ending., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 91cd3f9e2d 228/308: Added MELPA URLs to README., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2f8ce00821 074/308: A functions args is shown in tooltip after 5 sec of idle time.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 7682fe81f5 079/308: Fixed argument tip when no window-system., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode cb918eb5f1 076/308: Defined defvars earlier in file to avoid using free variables., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 194db27ee9 091/308: Added skeleton position at end of skeleton., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 929af1cefc 097/308: Autoload `drupal-search-url' as safe-local-variable., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9ea0f27c0e 098/308: Made `drupal-module-name' insert module name when called interactively., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6c76c15e7c 100/308: Added auto-insert skeleton for .install files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode fe8717b47c 106/308: Added `css-indent-offset'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bd83268c5d 131/308: Add custom checker for checking CSS/JS files with phpcs., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 889fc24427 145/308: Use setq., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2517b39f42 154/308: Added a simple `drupal-tail-drupal-debug-txt` function., ELPA Syncer, 2022/01/25