summaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/php-mode.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/php-mode.el')
-rw-r--r--.emacs.d/lisp/php-mode.el23
1 files changed, 22 insertions, 1 deletions
diff --git a/.emacs.d/lisp/php-mode.el b/.emacs.d/lisp/php-mode.el
index 8e09fa3..5db6f23 100644
--- a/.emacs.d/lisp/php-mode.el
+++ b/.emacs.d/lisp/php-mode.el
@@ -1533,10 +1533,31 @@ The output will appear in the buffer *PHP*."
1533 (modify-syntax-entry ?\\ "w") 1533 (modify-syntax-entry ?\\ "w")
1534 ad-do-it 1534 ad-do-it
1535 (modify-syntax-entry ?\\ old-syntax))) 1535 (modify-syntax-entry ?\\ old-syntax)))
1536
1537
1538(defcustom php-class-suffix-when-insert "::"
1539 "Suffix for inserted class."
1540 :type 'string)
1541
1542(defcustom php-namespace-suffix-when-insert "\\"
1543 "Suffix for inserted namespace."
1544 :type 'string)
1545
1546(defvar php--re-namespace-pattern
1547 (php-create-regexp-for-classlike "namespace"))
1548
1549(defvar php--re-classlike-pattern
1550 (php-create-regexp-for-classlike (regexp-opt '("class" "interface" "trait"))))
1551
1552(defun php-get-current-element (re-pattern)
1553 "Return backward matched element by RE-PATTERN."
1554 (save-excursion
1555 (when (re-search-backward re-pattern nil t)
1556 (match-string-no-properties 1))))
1536 1557
1537 1558
1538;;;###autoload 1559;;;###autoload
1539(dolist (pattern '("\\.php[s345t]?\\'" "\\.phtml\\'" "/Amkfile\\'" "\\.amk\\'")) 1560(dolist (pattern '("\\.php[s345t]?\\'" "/\\.php_cs\\(\\.dist\\)?\\'" "\\.phtml\\'" "/Amkfile\\'" "\\.amk\\'"))
1540 (add-to-list 'auto-mode-alist `(,pattern . php-mode) t)) 1561 (add-to-list 'auto-mode-alist `(,pattern . php-mode) t))
1541 1562
1542(provide 'php-mode) 1563(provide 'php-mode)