[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/php-mode ece3dd51ce 10/15: Add php-ide-mode-functions inst
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/php-mode ece3dd51ce 10/15: Add php-ide-mode-functions instead of php-ide-mode-hooks |
Date: |
Sat, 18 Mar 2023 18:01:27 -0400 (EDT) |
branch: elpa/php-mode
commit ece3dd51ce8ef349335042097a836ef4cd2ff03a
Author: USAMI Kenta <tadsan@zonu.me>
Commit: USAMI Kenta <tadsan@zonu.me>
Add php-ide-mode-functions instead of php-ide-mode-hooks
---
lisp/php-ide.el | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/lisp/php-ide.el b/lisp/php-ide.el
index 8d6cc758a6..bd61e6ada3 100644
--- a/lisp/php-ide.el
+++ b/lisp/php-ide.el
@@ -57,9 +57,18 @@
;;
;; Put follows code into your .emacs (~/.emacs.d/init.el) file:
;;
-;; (defun my-php-mode-setup ()
+;; (defun init-php-mode-setup ()
;; (add-hook 'hack-local-variables-hook #'php-ide-mode t t))
;;
+;; (defun init-php-ide-mode-setup (feature activate)
+;; (pcase feature
+;; (`lsp-bridge
+;; (if activate
+;; (progn (yas-minor-mode +1)
+;; (corfu-mode -1))
+;; (yas-minor-mode -1)
+;; (corfu-mode +1)))))
+;;
;; (with-eval-after-load 'php-ide
;; (custom-set-variables
;; '(php-ide-features . 'eglot) ;; and/or 'none, 'phpactor, 'lsp-mode
@@ -67,7 +76,8 @@
;; ;; If you want to hide php-ide-mode from the mode line, set an empty
string
;; '(php-ide-mode-lighter ""))
;;
-;; (add-hook 'php-mode #'my-php-mode-setup))
+;; (add-hook 'php-mode-hook #'init-php-mode-setup)
+;; (add-hook 'php-ide-mode-functions #'init-php-ide-mode-setup))
;;
;; If you don't enable IDE support by default, set '(php-ide-feature 'none)
;;
@@ -168,7 +178,19 @@
:type 'string
:safe #'stringp)
-(defvar php-ide-mode-hooks nil)
+(defcustom php-ide-mode-functions nil
+ "Hook functions called when before activating or deactivating PHP-IDE.
+Notice that two arguments (FEATURE ACTIVATE) are given.
+
+FEATURE: A symbol, like 'lsp-mode.
+ACTIVATE: T is given when activeting, NIL when deactivating PHP-IDE."
+ :tag "PHP-IDE Mode Functions"
+ :group 'php-ide
+ :type '(repeat function)
+ :safe (lambda (functions)
+ (and (listp functions)
+ (cl-loop for function in functions
+ always (functionp function)))))
;;;###autoload
(define-minor-mode php-ide-mode
@@ -182,11 +204,11 @@
ide-features
(mapconcat (lambda (feature) (concat "'" (symbol-name
feature)))
(php-ide--avilable-features) ", ")))
- (run-hooks 'php-ide-mode-hooks)
(cl-loop for feature in ide-features
for ide-plist = (cdr-safe (assq feature php-ide-feature-alist))
do (if (null ide-plist)
(message "Please set `php-ide-feature' variable in
.dir-locals.el or custom variable")
+ (run-hook-with-args 'php-ide-mode-functions feature
php-ide-mode)
(if php-ide-mode
(php-ide--activate-buffer feature ide-plist)
(php-ide--deactivate-buffer ide-plist))))))
- [nongnu] elpa/php-mode 657a7b803d 08/15: Update CHANGELOG, (continued)
- [nongnu] elpa/php-mode 657a7b803d 08/15: Update CHANGELOG, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode bb5bec31ee 04/15: Add php-ide.el, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode a01bb220bf 09/15: Add php-ide-eglot-server-program command, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode 5d3e9462a2 01/15: Fix doc comment, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode 91cd91a107 07/15: Remove php-eglot.el, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode 67d818928a 02/15: Add php-ide-phpactor.el, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode e45fa0766f 05/15: Add lsp-bridge, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode acde9abad2 03/15: Add php-eglot.el, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode c601f75fb9 13/15: Merge pull request #734 from emacs-php/release/v1.24.3, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode 6d4ca45093 06/15: Add php-ide-mode-hooks, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode ece3dd51ce 10/15: Add php-ide-mode-functions instead of php-ide-mode-hooks,
ELPA Syncer <=
- [nongnu] elpa/php-mode 2714393979 14/15: Make PHP Mode requires Emacs 26.1+, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode 47e0813079 15/15: Merge pull request #736 from emacs-php/drop/emacs-25, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode bed4d8ced3 12/15: Bump up version 1.24.3, ELPA Syncer, 2023/03/18
- [nongnu] elpa/php-mode c68e18c06b 11/15: Merge pull request #709 from emacs-php/feature/php-ide, ELPA Syncer, 2023/03/18