Browse Source

Actualizar php-mode

master
kj 3 years ago
parent
commit
719e3d9e1e
  1. 614
      elpa/archives/gnu/archive-contents
  2. 2
      elpa/archives/gnu/archive-contents.signed
  3. 7948
      elpa/archives/melpa/archive-contents
  4. 39
      elpa/php-mode-20200812.1129/php-local-manual.el
  5. BIN
      elpa/php-mode-20200812.1129/php-local-manual.elc
  6. BIN
      elpa/php-mode-20200812.1129/php-mode.elc
  7. BIN
      elpa/php-mode-20200812.1129/php.elc
  8. 2
      elpa/php-mode-20210519.1728/php-align.el
  9. BIN
      elpa/php-mode-20210519.1728/php-align.elc
  10. 2
      elpa/php-mode-20210519.1728/php-face.el
  11. BIN
      elpa/php-mode-20210519.1728/php-face.elc
  12. 217
      elpa/php-mode-20210519.1728/php-local-manual.el
  13. BIN
      elpa/php-mode-20210519.1728/php-local-manual.elc
  14. 48
      elpa/php-mode-20210519.1728/php-mode-autoloads.el
  15. 2
      elpa/php-mode-20210519.1728/php-mode-debug.el
  16. BIN
      elpa/php-mode-20210519.1728/php-mode-debug.elc
  17. 10
      elpa/php-mode-20210519.1728/php-mode-pkg.el
  18. 456
      elpa/php-mode-20210519.1728/php-mode.el
  19. BIN
      elpa/php-mode-20210519.1728/php-mode.elc
  20. 5
      elpa/php-mode-20210519.1728/php-project.el
  21. BIN
      elpa/php-mode-20210519.1728/php-project.elc
  22. 240
      elpa/php-mode-20210519.1728/php.el
  23. BIN
      elpa/php-mode-20210519.1728/php.elc
  24. 34
      init.el

614
elpa/archives/gnu/archive-contents

File diff suppressed because it is too large Load Diff

2
elpa/archives/gnu/archive-contents.signed

@ -1 +1 @@ @@ -1 +1 @@
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2020-12-05T06:05:02-0400 using RSA
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2021-06-07T05:05:02-0400 using RSA

7948
elpa/archives/melpa/archive-contents

File diff suppressed because it is too large Load Diff

39
elpa/php-mode-20200812.1129/php-local-manual.el

@ -1,39 +0,0 @@ @@ -1,39 +0,0 @@
;;; php-local-manual.el --- Tools for local PHP manual -*- lexical-binding: t; -*-
;; Copyright (C) 2020 Friends of Emacs-PHP development
;; Author: Eric James Michael Ritz
;; Maintainer: USAMI Kenta <tadsan@zonu.me>
;; URL: https://github.com/emacs-php/php-mode
;; Keywords: docs, php
;; Version: 2.0.0
;; License: GPL-3.0-or-later
;; This program 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.
;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This package helps you search the locally installed PHP Manual.
;; If you're only developing online, this feature is probably unnecessary.
;;; Code:
(require 'php-mode)
(defalias 'php-local-manual-search #'php-search-local-documentation)
;; TODO: move implementation
;; (define-obsolete-function-alias 'php-search-local-documentation #'php-local-manual-search)
(provide 'php-local-manual)
;;; php-local-manual.el ends here

BIN
elpa/php-mode-20200812.1129/php-local-manual.elc

Binary file not shown.

BIN
elpa/php-mode-20200812.1129/php-mode.elc

Binary file not shown.

BIN
elpa/php-mode-20200812.1129/php.elc

Binary file not shown.

2
elpa/php-mode-20200812.1129/php-align.el → elpa/php-mode-20210519.1728/php-align.el

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
;; Maintainer: USAMI Kenta <tadsan@zonu.me>
;; Keywords: php languages convenience align
;; Homepage: https://github.com/emacs-php/php-mode
;; Version: 1.23.0
;; Version: 1.24.0
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify

BIN
elpa/php-mode-20200812.1129/php-align.elc → elpa/php-mode-20210519.1728/php-align.elc

Binary file not shown.

2
elpa/php-mode-20200812.1129/php-face.el → elpa/php-mode-20210519.1728/php-face.el

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
;; Author: USAMI Kenta <tadsan@zonu.me>
;; Created: 5 May 2019
;; Version: 1.23.0
;; Version: 1.24.0
;; Keywords: faces, php
;; Homepage: https://github.com/emacs-php/php-mode
;; License: GPL-3.0-or-later

BIN
elpa/php-mode-20200812.1129/php-face.elc → elpa/php-mode-20210519.1728/php-face.elc

Binary file not shown.

217
elpa/php-mode-20210519.1728/php-local-manual.el

@ -0,0 +1,217 @@ @@ -0,0 +1,217 @@
;;; php-local-manual.el --- Tools for local PHP manual -*- lexical-binding: t; -*-
;; Copyright (C) 2020 Friends of Emacs-PHP development
;; Author: phil-s
;; Maintainer: USAMI Kenta <tadsan@zonu.me>
;; URL: https://github.com/emacs-php/php-mode/wiki/Local-PHP-Manual
;; Keywords: docs, php
;; Version: 2.0.0
;; License: GPL-3.0-or-later
;; This program 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.
;; This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This package helps you search the locally installed PHP Manual.
;; If you're only developing online, this feature is probably unnecessary.
;;
;; ## Notice
;;
;; This file is marked as an unmaintained feature.
;; https://github.com/emacs-php/php-mode/wiki/Unmaintained-Features
;;
;; ## How to use
;;
;; see https://github.com/emacs-php/php-mode/wiki/Local-PHP-Manual
;;
;; ### php-local-manual-search
;;
;; Put follows code into your .emacs (~/.emacs.d/init.el) file:
;;
;; (custom-set-variables
;; '(php-manual-path (expand-file-name "~/local/share/php-manual"))
;; '(php-search-documentation-function #'php-local-manual-search))
;;
;;; Code:
(require 'php)
(require 'etags)
(defconst php-local-manual-documentation-types
'("function" "control-structures" "class" "book")
;; "intro" and "ref" also look interesting, but for all practical purposes
;; their terms are sub-sets of the "book" terms (with the few exceptions
;; being very unlikely search terms).
"The set (and priority sequence) of documentation file prefixes
under which to search for files in the local documentation directory.")
(defvar php-local-manual--words-cache nil)
(defun php-local-manual--read-arg ()
"Obtain interactive argument for searching documentation."
;; Cache the list of documentation words available for completion,
;; based on the defined types-of-interest.
(let ((types-list php-local-manual-documentation-types)
(words-cache php-local-manual--words-cache)
(local-manual (and (stringp php-manual-path)
(not (string= php-manual-path "")))))
(when (and local-manual
(not (assq types-list words-cache)))
;; Generate the cache on the first run, or if the types changed.
;; We read the filenames matching our types list in the local
;; documentation directory, and extract the 'middle' component
;; of each. e.g. "function.array-map.html" => "array_map".
(let* ((types-opt (regexp-opt types-list))
(pattern (concat "\\`" types-opt "\\.\\(.+\\)\\.html\\'"))
(collection
(mapcar (lambda (filename)
(subst-char-in-string ?- ?_ (replace-regexp-in-string
pattern "\\1" filename)))
(directory-files php-manual-path nil pattern))))
;; Replace the entire cache. If the types changed, we don't need
;; to retain the collection for the previous value.
(setq words-cache (list (cons types-list collection)))
(setq php-local-manual--words-cache words-cache)))
;; By default we search for (current-word) immediately, without prompting.
;; With a prefix argument, or if there is no (current-word), we perform a
;; completing read for a word from the cached collection.
(let* ((default (current-word))
(prompt (if default
(format "Search PHP docs (%s): " default)
"Search PHP docs: "))
(collection (and local-manual
(cdr (assq types-list words-cache))))
(word (if (or current-prefix-arg (not default))
(completing-read prompt collection nil nil nil nil default)
default)))
;; Return interactive argument list.
(list word))))
;;;###autoload
(defun php-local-manual-search (word)
"Search the local PHP documentation (i.e. in `php-manual-path') for
the word at point. The function returns t if the requested documentation
exists, and nil otherwise.
With a prefix argument, prompt (with completion) for a word to search for."
(interactive (php-local-manual--read-arg))
(let ((file (catch 'found
(cl-loop for type in php-local-manual-documentation-types do
(let* ((doc-html (format "%s.%s.html"
type
(replace-regexp-in-string
"_" "-" (downcase word))))
(file (expand-file-name doc-html php-manual-path)))
(when (file-exists-p file)
(throw 'found file)))))))
(when file
(let ((file-url (if (string-prefix-p "file://" file)
file
(concat "file://" file))))
(php-browse-documentation-url file-url))
t)))
;;;###autoload
(define-obsolete-function-alias 'php-search-local-documentation #'php-local-manual-search "2.0.0")
;; Define function name completion function
(defvar php-local-manual--completion-table nil
"Obarray of tag names defined in current tags table and functions known to PHP.")
(defun php-local-manual-complete-function ()
"Perform function completion on the text around point.
Completes to the set of names listed in the current tags table
and the standard php functions.
The string to complete is chosen in the same way as the default
for \\[find-tag] (which see)."
(interactive)
(let ((pattern (php-get-pattern))
beg
completion
(php-functions (php-local-manual-completion-table)))
(if (not pattern) (message "Nothing to complete")
(if (not (search-backward pattern nil t))
(message "Can't complete here")
(setq beg (point))
(forward-char (length pattern))
(setq completion (try-completion pattern php-functions nil))
(cond ((eq completion t))
((null completion)
(message "Can't find completion for \"%s\"" pattern)
(ding))
((not (string= pattern completion))
(delete-region beg (point))
(insert completion))
(t
(let ((selected (completing-read
"Select completion: "
(all-completions pattern php-functions)
nil t pattern)))
(delete-region beg (point))
(insert selected))))))))
(defun php-local-manual-completion-table ()
"Build variable `php-local-manual--completion-table' on demand.
The table includes the PHP functions and the tags from the
current `tags-file-name'."
(or (and tags-file-name
(save-excursion (tags-verify-table tags-file-name))
php-local-manual--completion-table)
(let ((tags-table
(when tags-file-name
(with-current-buffer (get-file-buffer tags-file-name)
(etags-tags-completion-table))))
(php-table
(cond ((and (not (string= "" php-completion-file))
(file-readable-p php-completion-file))
(php-local-manual-build-table-from-file php-completion-file))
((and (not (string= "" php-manual-path))
(file-directory-p php-manual-path))
(php-local-manual-build-table-from-path php-manual-path))
(t nil))))
(unless (or php-table tags-table)
(user-error
(concat "No TAGS file active nor are "
"`php-completion-file' or `php-manual-path' set")))
(when tags-table
;; Combine the tables.
(if (obarrayp tags-table)
(mapatoms (lambda (sym) (intern (symbol-name sym) php-table))
tags-table)
(setq php-table (append tags-table php-table))))
(setq php-local-manual--completion-table php-table))))
(defun php-local-manual-build-table-from-file (filename)
(let ((table (make-vector 1022 0))
(buf (find-file-noselect filename)))
(with-current-buffer buf
(goto-char (point-min))
(while (re-search-forward
"^\\([-a-zA-Z0-9_.]+\\)\n"
nil t)
(intern (buffer-substring (match-beginning 1) (match-end 1))
table)))
(kill-buffer buf)
table))
(defun php-local-manual-build-table-from-path (path)
"Return list of PHP function name from `PATH' directory."
(cl-loop for file in (directory-files path nil "^function\\..+\\.html$")
if (string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file)
collect (replace-regexp-in-string
"-" "_" (substring file (match-beginning 1) (match-end 1)) t)))
(provide 'php-local-manual)
;;; php-local-manual.el ends here

BIN
elpa/php-mode-20210519.1728/php-local-manual.elc

Binary file not shown.

48
elpa/php-mode-20200812.1129/php-mode-autoloads.el → elpa/php-mode-20210519.1728/php-mode-autoloads.el

@ -12,24 +12,16 @@ @@ -12,24 +12,16 @@
(let ((loads (get 'php 'custom-loads))) (if (member '"php" loads) nil (put 'php 'custom-loads (cons '"php" loads))))
(autoload 'php-mode-maybe "php" "\
Select PHP mode or other major mode.
\(fn)" t nil)
Select PHP mode or other major mode." t nil)
(autoload 'php-current-class "php" "\
Insert current class name if cursor in class context.
\(fn)" t nil)
Insert current class name if cursor in class context." t nil)
(autoload 'php-current-namespace "php" "\
Insert current namespace if cursor in namespace context.
\(fn)" t nil)
Insert current namespace if cursor in namespace context." t nil)
(autoload 'php-copyit-fqsen "php" "\
Copy/kill class/method FQSEN.
\(fn)" t nil)
Copy/kill class/method FQSEN." t nil)
(autoload 'php-run-builtin-web-server "php" "\
Run PHP Built-in web server.
@ -56,13 +48,16 @@ Find php.ini FILE by `php --ini'. @@ -56,13 +48,16 @@ Find php.ini FILE by `php --ini'.
;;; Generated autoloads from php-align.el
(autoload 'php-align-setup "php-align" "\
Setup alignment configuration for PHP code.
\(fn)" nil nil)
Setup alignment configuration for PHP code." nil nil)
(autoload 'php-align-mode "php-align" "\
Alignment lines for PHP script.
If called interactively, enable Php-Align mode if ARG is
positive, and disable it if ARG is zero or negative. If called
from Lisp, also enable the mode if ARG is omitted or nil, and
toggle it if ARG is `toggle'; disable the mode otherwise.
\(fn &optional ARG)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "php-align" '("php-align-")))
@ -82,7 +77,18 @@ Alignment lines for PHP script. @@ -82,7 +77,18 @@ Alignment lines for PHP script.
;;;;;; 0 0 0))
;;; Generated autoloads from php-local-manual.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "php-local-manual" '("php-local-manual-search")))
(autoload 'php-local-manual-search "php-local-manual" "\
Search the local PHP documentation (i.e. in `php-manual-path') for
the word at point. The function returns t if the requested documentation
exists, and nil otherwise.
With a prefix argument, prompt (with completion) for a word to search for.
\(fn WORD)" t nil)
(define-obsolete-function-alias 'php-search-local-documentation #'php-local-manual-search "2.0.0")
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "php-local-manual" '("php-local-manual-")))
;;;***
@ -91,7 +97,7 @@ Alignment lines for PHP script. @@ -91,7 +97,7 @@ Alignment lines for PHP script.
(let ((loads (get 'php-mode 'custom-loads))) (if (member '"php-mode" loads) nil (put 'php-mode 'custom-loads (cons '"php-mode" loads))))
(if (version< emacs-version "24.4") (dolist (i '("php" "php5" "php7")) (add-to-list 'interpreter-mode-alist (cons i 'php-mode))) (add-to-list 'interpreter-mode-alist (cons "php\\(?:-?[3457]\\(?:\\.[0-9]+\\)*\\)?" 'php-mode)))
(add-to-list 'interpreter-mode-alist (cons "php\\(?:-?[34578]\\(?:\\.[0-9]+\\)*\\)?" 'php-mode))
(define-obsolete-variable-alias 'php-available-project-root-files 'php-project-available-root-files "1.19.0")
@ -217,14 +223,10 @@ Function name or path to server-start script.") @@ -217,14 +223,10 @@ Function name or path to server-start script.")
(put 'php-project-server-start 'safe-local-variable #'(lambda (v) (or (functionp v) (php-project--eval-bootstrap-scripts v))))
(autoload 'php-project-get-bootstrap-scripts "php-project" "\
Return list of bootstrap script.
\(fn)" nil nil)
Return list of bootstrap script." nil nil)
(autoload 'php-project-get-root-dir "php-project" "\
Return path to current PHP project.
\(fn)" nil nil)
Return path to current PHP project." nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "php-project" '("php-project-")))

2
elpa/php-mode-20200812.1129/php-mode-debug.el → elpa/php-mode-20210519.1728/php-mode-debug.el

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
;; Author: USAMI Kenta <tadsan@zonu.me>
;; URL: https://github.com/emacs-php/php-mode
;; Keywords: maint
;; Version: 1.23.0
;; Version: 1.24.0
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify

BIN
elpa/php-mode-20200812.1129/php-mode-debug.elc → elpa/php-mode-20210519.1728/php-mode-debug.elc

Binary file not shown.

10
elpa/php-mode-20200812.1129/php-mode-pkg.el → elpa/php-mode-20210519.1728/php-mode-pkg.el

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
(define-package "php-mode" "20200812.1129" "Major mode for editing PHP code"
'((emacs "24.3"))
:commit "f4c7c6995dadcdc6da5fefadfd362f8418b2eec1" :keywords
'("languages" "php")
:authors
(define-package "php-mode" "20210519.1728" "Major mode for editing PHP code"
'((emacs "25.2"))
:commit "9561a6c0a92a3d7c00e7e57972f42cb5be775898" :authors
'(("Eric James Michael Ritz"))
:maintainer
'("USAMI Kenta" . "tadsan@zonu.me")
:keywords
'("languages" "php")
:url "https://github.com/emacs-php/php-mode")
;; Local Variables:
;; no-byte-compile: t

456
elpa/php-mode-20200812.1129/php-mode.el → elpa/php-mode-20210519.1728/php-mode.el

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
;;; php-mode.el --- Major mode for editing PHP code
;;; php-mode.el --- Major mode for editing PHP code -*- lexical-binding: t; -*-
;; Copyright (C) 2020 Friends of Emacs-PHP development
;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad
@ -9,11 +9,11 @@ @@ -9,11 +9,11 @@
;; Maintainer: USAMI Kenta <tadsan@zonu.me>
;; URL: https://github.com/emacs-php/php-mode
;; Keywords: languages php
;; Version: 1.23.0
;; Package-Requires: ((emacs "24.3"))
;; Version: 1.24.0
;; Package-Requires: ((emacs "25.2"))
;; License: GPL-3.0-or-later
(defconst php-mode-version-number "1.23.0"
(defconst php-mode-version-number "1.24.0"
"PHP Mode version number.")
;; This program is free software; you can redistribute it and/or modify
@ -56,9 +56,9 @@ @@ -56,9 +56,9 @@
(require 'php)
(require 'php-face)
(require 'cc-mode)
(require 'cc-langs)
(eval-when-compile
(require 'cc-langs)
(require 'cc-fonts))
;; Boilerplate from other `cc-mode' derived modes. See
@ -69,45 +69,22 @@ @@ -69,45 +69,22 @@
(require 'font-lock)
(require 'custom)
(require 'etags)
(require 'speedbar)
(require 'imenu)
(require 'nadvice nil t)
(require 'cl-lib)
(require 'package)
(require 'nadvice)
(require 'mode-local)
(require 'php-project)
(eval-when-compile
(require 'rx)
(require 'cl-lib)
(require 'regexp-opt)
(defvar add-log-current-defun-header-regexp)
(defvar add-log-current-defun-function)
(defvar c-vsemi-status-unknown-p)
(defvar syntax-propertize-via-font-lock))
;; Work around emacs bug#18845, cc-mode expects cl to be loaded
;; while php-mode only uses cl-lib (without compatibility aliases)
(eval-and-compile
(when (and (= emacs-major-version 24) (>= emacs-minor-version 4))
(require 'cl)))
;; Work around https://github.com/emacs-php/php-mode/issues/310.
;;
;; In emacs 24.4 and 24.5, lines after functions with a return type
;; are incorrectly analyzed as member-init-cont.
;;
;; Before emacs 24.4, c member initializers are not supported this
;; way. Starting from emacs 25.1, cc-mode only detects member
;; initializers when the major mode is c++-mode.
(eval-and-compile
(if (and (= emacs-major-version 24) (or (= emacs-minor-version 4)
(= emacs-minor-version 5)))
(defun c-back-over-member-initializers ()
;; Override of cc-engine.el, cc-mode in emacs 24.4 and 24.5 are too
;; optimistic in recognizing c member initializers. Since we don't
;; need it in php-mode, just return nil.
nil)))
(autoload 'php-mode-debug "php-mode-debug"
"Display informations useful for debugging PHP Mode." t)
@ -191,21 +168,10 @@ enabled." @@ -191,21 +168,10 @@ enabled."
:tag "PHP Mode Do Not Use Semantic Imenu"
:type 'boolean)
(defcustom php-completion-file ""
"Path to the file which contains the function names known to PHP."
:type 'string)
(defcustom php-manual-path ""
"Path to the directory which contains the PHP manual."
:type 'string)
;;;###autoload
(if (version< emacs-version "24.4")
(dolist (i '("php" "php5" "php7"))
(add-to-list 'interpreter-mode-alist (cons i 'php-mode)))
(add-to-list 'interpreter-mode-alist
;; Match php, php-3, php5, php7, php5.5, php-7.0.1, etc.
(cons "php\\(?:-?[3457]\\(?:\\.[0-9]+\\)*\\)?" 'php-mode)))
(add-to-list 'interpreter-mode-alist
;; Match php, php-3, php5, php7, php5.5, php-7.0.1, etc.
(cons "php\\(?:-?[34578]\\(?:\\.[0-9]+\\)*\\)?" 'php-mode))
(defcustom php-mode-hook nil
"List of functions to be executed on entry to `php-mode'."
@ -318,6 +284,9 @@ In that case set to `NIL'." @@ -318,6 +284,9 @@ In that case set to `NIL'."
:tag "PHP Mode Enable Project Local Variable"
:type 'boolean)
(defconst php-mode-cc-vertion
(eval-when-compile c-version))
(defun php-mode-version ()
"Display string describing the version of PHP Mode."
(interactive)
@ -414,8 +383,7 @@ In that case set to `NIL'." @@ -414,8 +383,7 @@ In that case set to `NIL'."
php "\\s-*\\(<\\?(=\\|\\sw+)\\)")
(c-lang-defconst c-identifier-ops
php '(
(left-assoc "\\" "::" "->")
php '((left-assoc "\\" "::" "->")
(prefix "\\" "::")))
(c-lang-defconst c-operators
@ -472,25 +440,25 @@ In that case set to `NIL'." @@ -472,25 +440,25 @@ In that case set to `NIL'."
(c-lang-defconst c-primitive-type-kwds
php '("int" "integer" "bool" "boolean" "float" "double" "real"
"string" "object" "void" "mixed"))
"string" "object" "void" "mixed" "never"))
(c-lang-defconst c-class-decl-kwds
"Keywords introducing declarations where the following block (if any)
contains another declaration level that should be considered a class."
php '("class" "trait" "interface"))
php '("class" "trait" "interface" "enum"))
(c-lang-defconst c-brace-list-decl-kwds
"Keywords introducing declarations where the following block (if
any) is a brace list.
PHP does not have an \"enum\"-like keyword."
PHP does not have an C-like \"enum\" keyword."
php nil)
(c-lang-defconst c-typeless-decl-kwds
php (append (c-lang-const c-class-decl-kwds) '("function")))
(c-lang-defconst c-modifier-kwds
php '("abstract" "const" "final" "static"))
php '("abstract" "const" "final" "static" "case"))
(c-lang-defconst c-protection-kwds
"Access protection label keywords in classes."
@ -528,8 +496,7 @@ PHP does not have an \"enum\"-like keyword." @@ -528,8 +496,7 @@ PHP does not have an \"enum\"-like keyword."
(c-lang-defconst c-other-kwds
"Keywords not accounted for by any other `*-kwds' language constant."
php
'(
"__halt_compiler"
'("__halt_compiler"
"and"
"array"
"as"
@ -911,19 +878,18 @@ This is was done due to the problem reported here: @@ -911,19 +878,18 @@ This is was done due to the problem reported here:
(if pos
(goto-char pos)
(setq pos (point)))
(unless (php-in-string-or-comment-p)
(or
;; Detect PHP8 attribute: <<Attribute()>>
(when (and (< 2 pos) (< 2 (- pos (c-point 'bol))))
(backward-char 2)
(looking-at-p ">>\\s-*\\(?:<<\\|$\\)"))
;; Detect HTML/XML tag and PHP tag (<?php, <?=, ?>)
(when php-mode-template-compatibility
(beginning-of-line)
(looking-at-p
(eval-when-compile
(rx (or (: bol (0+ space) "<" (in "a-z\\?"))
(: (0+ not-newline) (in "a-z\\?") ">" (0+ space) eol))))))))))
(cond
;; Detect PHP8 attribute: #[Attribute()]
((and (< 1 pos) (< 1 (- pos (c-point 'bol))))
(backward-char 1)
(looking-at-p (eval-when-compile (rx "]" (* (syntax whitespace)) (or "#[" line-end)))))
;; Detect HTML/XML tag and PHP tag (<?php, <?=, ?>)
(php-mode-template-compatibility
(beginning-of-line)
(looking-at-p
(eval-when-compile
(rx (or (: bol (0+ space) "<" (in "?a-z"))
(: (0+ not-newline) (in "?a-z") ">" (0+ space) eol)))))))))
(defun php-c-vsemi-status-unknown-p ()
"Always return NIL. See `c-vsemi-status-unknown-p'."
@ -967,7 +933,12 @@ this ^ lineup" @@ -967,7 +933,12 @@ this ^ lineup"
(eval-and-compile
(defconst php-heredoc-start-re
"<<<\\(?:\\_<.+?\\_>\\|'\\_<.+?\\_>'\\|\"\\_<.+?\\_>\"\\)$"
(rx "<<<"
(* (syntax whitespace))
(or (group (+ (or (syntax word) (syntax symbol))))
(: "\"" (group (+ (or (syntax word) (syntax symbol)))) "\"")
(: "'" (group (+ (or (syntax word) (syntax symbol)))) "'"))
line-end)
"Regular expression for the start of a PHP heredoc."))
(defun php-heredoc-end-re (heredoc-start)
@ -976,27 +947,40 @@ this ^ lineup" @@ -976,27 +947,40 @@ this ^ lineup"
(string-match "\\_<.+?\\_>" heredoc-start)
(concat "^\\s-*\\(" (match-string 0 heredoc-start) "\\)\\W"))
(defun php-syntax-propertize-function (start end)
"Apply propertize rules from START to END."
(goto-char start)
(while (and (< (point) end)
(re-search-forward php-heredoc-start-re end t))
(php-heredoc-syntax))
(goto-char start)
(while (re-search-forward "['\"]" end t)
(when (php-in-comment-p)
(c-put-char-property (match-beginning 0)
'syntax-table (string-to-syntax "_")))))
(defun php-heredoc-syntax ()
"Mark the boundaries of searched heredoc."
(goto-char (match-beginning 0))
(c-put-char-property (point) 'syntax-table (string-to-syntax "|"))
(if (re-search-forward (php-heredoc-end-re (match-string 0)) nil t)
(goto-char (match-end 1))
;; Did not find the delimiter so go to the end of the buffer.
(goto-char (point-max)))
(c-put-char-property (1- (point)) 'syntax-table (string-to-syntax "|")))
(eval-and-compile
(defconst php-syntax-propertize-rules
`((php-heredoc-start-re
(0 (ignore (php--syntax-propertize-heredoc
(match-beginning 0)
(or (match-string 1) (match-string 2) (match-string 3))
(null (match-string 3))))))
(,(rx "#[")
(0 (ignore (php--syntax-propertize-attributes (match-beginning 0)))))
(,(rx (or "'" "\"" ))
(0 (ignore (php--syntax-propertize-quotes-in-comment (match-beginning 0)))))))
(defmacro php-build-propertize-function ()
`(syntax-propertize-rules ,@php-syntax-propertize-rules))
(defalias 'php-syntax-propertize-function (php-build-propertize-function)))
(defun php--syntax-propertize-heredoc (start id is-heredoc)
"Apply propertize Heredoc and Nowdoc from START, with ID and IS-HEREDOC."
(let ((terminator (rx-to-string `(: line-start (* (syntax whitespace)) ,id word-boundary))))
(put-text-property start (1+ start) 'syntax-table (string-to-syntax "|"))
(re-search-forward terminator nil t)
(when (match-string 0)
(put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "|")))))
(defun php--syntax-propertize-quotes-in-comment (pos)
"Apply propertize quotes (' and \") from POS."
(when (php-in-comment-p)
(put-text-property pos (1+ pos) 'syntax-table (string-to-syntax "_"))))
(defun php--syntax-propertize-attributes (start)
"Apply propertize PHP8 #[Attributes] (without # comment) from START."
(unless (php-in-string-p)
(put-text-property start (1+ start) 'syntax-table (string-to-syntax "."))))
(defvar-local php-mode--propertize-extend-region-current nil
"Prevent undesirable recursion in PHP-SYNTAX-PROPERTIZE-EXTEND-REGION")
@ -1010,8 +994,7 @@ this ^ lineup" @@ -1010,8 +994,7 @@ this ^ lineup"
;; turn call this to be called again.
(push pair php-mode--propertize-extend-region-current)
(unwind-protect
(let ((new-start)
(new-end))
(let (new-start new-end)
(goto-char start)
(when (re-search-backward php-heredoc-start-re nil t)
(let ((maybe (point)))
@ -1095,8 +1078,7 @@ After setting the stylevars run hooks according to STYLENAME @@ -1095,8 +1078,7 @@ After setting the stylevars run hooks according to STYLENAME
(defun php-mode--disable-delay-set-style (&rest args)
"Disable php-mode-set-style-delay on after hook. `ARGS' be ignore."
(setq php-mode--delayed-set-style nil)
(when (fboundp 'advice-remove)
(advice-remove #'php-mode--disable-delay-set-style #'c-set-style)))
(advice-remove #'php-mode--disable-delay-set-style #'c-set-style))
(defun php-mode-set-style-delay ()
"Set the current `php-mode' buffer to use the style by custom or local variables."
@ -1131,6 +1113,13 @@ After setting the stylevars run hooks according to STYLENAME @@ -1131,6 +1113,13 @@ After setting the stylevars run hooks according to STYLENAME
:syntax-table php-mode-syntax-table
;; :after-hook (c-update-modeline)
;; (setq abbrev-mode t)
(unless (string= php-mode-cc-vertion c-version)
(user-error "CC Mode has been updated. %s"
(if (package-installed-p 'php-mode)
"Please run `M-x package-reinstall php-mode' command."
"Please byte recompile PHP Mode files.")))
(when php-mode-disable-c-mode-hook
(setq-local c-mode-hook nil)
(setq-local java-mode-hook nil))
@ -1141,7 +1130,7 @@ After setting the stylevars run hooks according to STYLENAME @@ -1141,7 +1130,7 @@ After setting the stylevars run hooks according to STYLENAME
(setq-local comment-start "// ")
(setq-local comment-start-skip
(eval-when-compile
(rx (group (or (: "#")
(rx (group (or (: "#" (not (any "[")))
(: "/" (+ "/"))
(: "/*")))
(* (syntax whitespace)))))
@ -1160,7 +1149,9 @@ After setting the stylevars run hooks according to STYLENAME @@ -1160,7 +1149,9 @@ After setting the stylevars run hooks according to STYLENAME
(add-hook 'syntax-propertize-extend-region-functions
#'php-syntax-propertize-extend-region t t)
(setq imenu-generic-expression php-imenu-generic-expression)
(setq imenu-generic-expression (if (symbolp php-imenu-generic-expression)
(symbol-value php-imenu-generic-expression)
php-imenu-generic-expression))
;; PHP vars are case-sensitive
(setq case-fold-search t)
@ -1175,8 +1166,7 @@ After setting the stylevars run hooks according to STYLENAME @@ -1175,8 +1166,7 @@ After setting the stylevars run hooks according to STYLENAME
(progn
(add-hook 'hack-local-variables-hook #'php-mode-set-style-delay t t)
(setq php-mode--delayed-set-style t)
(when (fboundp 'advice-add)
(advice-add #'c-set-style :after #'php-mode--disable-delay-set-style '(local))))
(advice-add #'c-set-style :after #'php-mode--disable-delay-set-style '(local)))
(let ((php-mode-enable-backup-style-variables nil))
(php-set-style (symbol-name php-mode-coding-style))))
@ -1208,7 +1198,8 @@ After setting the stylevars run hooks according to STYLENAME @@ -1208,7 +1198,8 @@ After setting the stylevars run hooks according to STYLENAME
(when (fboundp 'c-looking-at-or-maybe-in-bracelist)
(advice-add #'c-looking-at-or-maybe-in-bracelist
:override 'php-c-looking-at-or-maybe-in-bracelist))
:override 'php-c-looking-at-or-maybe-in-bracelist '(local)))
(advice-add #'fixup-whitespace :after #'php-mode--fixup-whitespace-after '(local))
(when (>= emacs-major-version 25)
(with-silent-modifications
@ -1227,10 +1218,7 @@ After setting the stylevars run hooks according to STYLENAME @@ -1227,10 +1218,7 @@ After setting the stylevars run hooks according to STYLENAME
#'semantic-create-imenu-index)
"Imenu index function for PHP.")
;; Define function name completion function
(defvar php-completion-table nil
"Obarray of tag names defined in current tags table and functions known to PHP.")
(autoload 'php-local-manual-complete-function "php-local-manual")
(defun php-complete-function ()
"Perform function completion on the text around point.
@ -1239,102 +1227,7 @@ and the standard php functions. @@ -1239,102 +1227,7 @@ and the standard php functions.
The string to complete is chosen in the same way as the default
for \\[find-tag] (which see)."
(interactive)
(let ((pattern (php-get-pattern))
beg
completion
(php-functions (php-completion-table)))
(if (not pattern) (message "Nothing to complete")
(if (not (search-backward pattern nil t))
(message "Can't complete here")
(setq beg (point))
(forward-char (length pattern))
(setq completion (try-completion pattern php-functions nil))
(cond ((eq completion t))
((null completion)
(message "Can't find completion for \"%s\"" pattern)
(ding))
((not (string= pattern completion))
(delete-region beg (point))
(insert completion))
(t
(let ((selected (completing-read
"Select completion: "
(all-completions pattern php-functions)
nil t pattern)))
(delete-region beg (point))
(insert selected))))))))
(defun php-completion-table ()
"Build variable `php-completion-table' on demand.
The table includes the PHP functions and the tags from the
current `tags-file-name'."
(or (and tags-file-name
(save-excursion (tags-verify-table tags-file-name))
php-completion-table)
(let ((tags-table
(when tags-file-name
(with-current-buffer (get-file-buffer tags-file-name)
(etags-tags-completion-table))))
(php-table
(cond ((and (not (string= "" php-completion-file))
(file-readable-p php-completion-file))
(php-build-table-from-file php-completion-file))
((and (not (string= "" php-manual-path))
(file-directory-p php-manual-path))
(php-build-table-from-path php-manual-path))
(t nil))))
(unless (or php-table tags-table)
(error
(concat "No TAGS file active nor are "
"`php-completion-file' or `php-manual-path' set")))
(when tags-table
;; Combine the tables.
(if (obarrayp tags-table)
(mapatoms (lambda (sym) (intern (symbol-name sym) php-table))
tags-table)
(setq php-table (append tags-table php-table))))
(setq php-completion-table php-table))))
(defun php-build-table-from-file (filename)
(let ((table (make-vector 1022 0))
(buf (find-file-noselect filename)))
(with-current-buffer buf
(goto-char (point-min))
(while (re-search-forward
"^\\([-a-zA-Z0-9_.]+\\)\n"
nil t)
(intern (buffer-substring (match-beginning 1) (match-end 1))
table)))
(kill-buffer buf)
table))
(defun php-build-table-from-path (path)
"Return list of PHP function name from `PATH' directory."
(cl-loop for file in (directory-files path nil "^function\\..+\\.html$")
if (string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file)
collect (replace-regexp-in-string
"-" "_" (substring file (match-beginning 1) (match-end 1)) t)))
;; Find the pattern we want to complete
;; find-tag-default from GNU Emacs etags.el
(defun php-get-pattern ()
(save-excursion
(while (looking-at "\\sw\\|\\s_")
(forward-char 1))
(if (or (re-search-backward "\\sw\\|\\s_"
(save-excursion (beginning-of-line) (point))
t)
(re-search-forward "\\(\\sw\\|\\s_\\)+"
(save-excursion (end-of-line) (point))
t))
(progn (goto-char (match-end 0))
(buffer-substring-no-properties
(point)
(progn (forward-sexp -1)
(while (looking-at "\\s'")
(forward-char 1))
(point))))
nil)))
(php-local-manual-complete-function))
(defun php-show-arglist ()
"Show function arguments at cursor position."
@ -1354,130 +1247,6 @@ current `tags-file-name'." @@ -1354,130 +1247,6 @@ current `tags-file-name'."
(message "Arglist for %s: %s" tagname arglist)
(message "Unknown function: %s" tagname))))
(defcustom php-search-documentation-browser-function nil
"Function to display PHP documentation in a WWW browser.
If non-nil, this shadows the value of `browse-url-browser-function' when
calling `php-search-documentation' or `php-search-local-documentation'."
:group 'php
:tag "PHP Search Documentation Browser Function"
:type '(choice (const :tag "default" nil) function)
:link '(variable-link browse-url-browser-function))
(defun php-browse-documentation-url (url)
"Browse a documentation URL using the configured browser function.
See `php-search-documentation-browser-function'."
(let ((browse-url-browser-function
(or php-search-documentation-browser-function
browse-url-browser-function)))
(browse-url url)))
(defvar php-search-local-documentation-types
(list "function" "control-structures" "class" "book")
;; "intro" and "ref" also look interesting, but for all practical purposes
;; their terms are sub-sets of the "book" terms (with the few exceptions
;; being very unlikely search terms).
"The set (and priority sequence) of documentation file prefixes
under which to search for files in the local documentation directory.")
(defvar php-search-local-documentation-words-cache nil)
(defun php--search-documentation-read-arg ()
"Obtain interactive argument for searching documentation."
;; Cache the list of documentation words available for completion,
;; based on the defined types-of-interest.
(let ((types-list php-search-local-documentation-types)
(words-cache php-search-local-documentation-words-cache)
(local-manual (and (stringp php-manual-path)
(not (string= php-manual-path "")))))
(when (and local-manual
(not (assq types-list words-cache)))
;; Generate the cache on the first run, or if the types changed.
;; We read the filenames matching our types list in the local
;; documentation directory, and extract the 'middle' component
;; of each. e.g. "function.array-map.html" => "array_map".
(let* ((types-opt (regexp-opt types-list))
(pattern (concat "\\`" types-opt "\\.\\(.+\\)\\.html\\'"))
(collection
(mapcar (lambda (filename) (subst-char-in-string
?- ?_ (replace-regexp-in-string
pattern "\\1" filename)))
(directory-files php-manual-path nil pattern))))
;; Replace the entire cache. If the types changed, we don't need
;; to retain the collection for the previous value.
(setq words-cache (list (cons types-list collection)))
(setq php-search-local-documentation-words-cache words-cache)))
;; By default we search for (current-word) immediately, without prompting.
;; With a prefix argument, or if there is no (current-word), we perform a
;; completing read for a word from the cached collection.
(let* ((default (current-word))
(prompt (if default
(format "Search PHP docs (%s): " default)
"Search PHP docs: "))
(collection (and local-manual
(cdr (assq types-list words-cache))))
(word (if (or current-prefix-arg (not default))
(completing-read prompt collection nil nil nil nil default)
default)))
;; Return interactive argument list.
(list word))))
(defun php-search-local-documentation (word)
"Search the local PHP documentation (i.e. in `php-manual-path') for
the word at point. The function returns t if the requested documentation
exists, and nil otherwise.
With a prefix argument, prompt (with completion) for a word to search for."
(interactive (php--search-documentation-read-arg))
(let ((file (catch 'found
(cl-loop for type in php-search-local-documentation-types do
(let* ((doc-html (format "%s.%s.html"
type
(replace-regexp-in-string
"_" "-" (downcase word))))
(file (expand-file-name doc-html php-manual-path)))
(when (file-exists-p file)
(throw 'found file)))))))
(when file
(let ((file-url (if (string-prefix-p "file://" file)
file
(concat "file://" file))))
(php-browse-documentation-url file-url))
t)))
(defsubst php-search-web-documentation (word)
"Return URL to search PHP manual search by `WORD'."
(php-browse-documentation-url (concat (or php-search-url php-site-url) word)))
;; Define function documentation function
(defun php-search-documentation (word)
"Search PHP documentation for the `WORD' at point.
If `php-manual-path' has a non-empty string value then the command
will first try searching the local documentation. If the requested
documentation does not exist it will fallback to searching the PHP
website.
With a prefix argument, prompt for a documentation word to search
for. If the local documentation is available, it is used to build
a completion list."
(interactive (php--search-documentation-read-arg))
(if (and (stringp php-manual-path)
(not (string= php-manual-path "")))
(or (php-search-local-documentation word)
(php-search-web-documentation word))
(php-search-web-documentation word)))
;; Define function for browsing manual
(defun php-browse-manual ()
"Bring up manual for PHP."
(interactive)
(browse-url (if (stringp php-manual-url)
php-manual-url
(format "%smanual/%s/" php-site-url php-manual-url))))
;; Font Lock
(defconst php-phpdoc-type-keywords
(list "string" "integer" "int" "boolean" "bool" "float"
@ -1670,7 +1439,9 @@ a completion list." @@ -1670,7 +1439,9 @@ a completion list."
;; Logical operators (and, or, &&, ...)
;; Not operator (!) is defined in "before cc-mode" section above.
("\\(&&\\|||\\)" 1 'php-logical-op)))
("\\(&&\\|||\\)" 1 'php-logical-op)
;; string interpolation ("$var, ${var}, {$var}")
(php-mode--string-interpolated-variable-font-lock-find 0 nil)))
"Detailed highlighting for PHP Mode.")
(defvar php-font-lock-keywords php-font-lock-keywords-3
@ -1702,37 +1473,24 @@ The output will appear in the buffer *PHP*." @@ -1702,37 +1473,24 @@ The output will appear in the buffer *PHP*."
(defconst php-string-interpolated-variable-regexp
"{\\$[^}\n\\\\]*\\(?:\\\\.[^}\n\\\\]*\\)*}\\|\\${\\sw+}\\|\\$\\sw+")
(defun php-string-intepolated-variable-font-lock-find (limit)
(while (re-search-forward php-string-interpolated-variable-regexp limit t)
(let ((quoted-stuff (nth 3 (syntax-ppss))))
(when (and quoted-stuff (member quoted-stuff '(?\" ?`)))
(put-text-property (match-beginning 0) (match-end 0)
'face 'php-variable-name))))
(defun php-mode--string-interpolated-variable-font-lock-find (limit)
"Apply text-property to LIMIT for string interpolation by font-lock."
(let (quoted-stuff)
(while (re-search-forward php-string-interpolated-variable-regexp limit t)
(setq quoted-stuff (php-in-string-p))
(when (or (eq ?\" quoted-stuff) (eq ?` quoted-stuff))
(put-text-property (match-beginning 0) (match-end 0) 'face 'php-variable-name))))
nil)
(eval-after-load 'php-mode
'(progn
(font-lock-add-keywords
'php-mode
`((php-string-intepolated-variable-font-lock-find))
'append)))
;;; Correct the behavior of `delete-indentation' by modifying the
;;; logic of `fixup-whitespace'.
(defadvice fixup-whitespace (after php-mode-fixup-whitespace)
(defun php-mode--fixup-whitespace-after ()
"Remove whitespace before certain characters in PHP Mode."
(let* ((no-behind-space ";\\|,\\|->\\|::")
(no-front-space "->\\|::"))
(when (and (eq major-mode 'php-mode)
(or (looking-at-p (concat " \\(" no-behind-space "\\)"))
(save-excursion
(forward-char -2)
(looking-at-p no-front-space))))
(delete-char 1))))
(ad-activate 'fixup-whitespace)
(when (or (looking-at-p " \\(?:;\\|,\\|->\\|::\\)")
(save-excursion
(forward-char -2)
(looking-at-p "->\\|::")))
(delete-char 1)))
;;;###autoload
(progn

BIN
elpa/php-mode-20210519.1728/php-mode.elc

Binary file not shown.

5
elpa/php-mode-20200812.1129/php-project.el → elpa/php-mode-20210519.1728/php-project.el

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
;; Author: USAMI Kenta <tadsan@zonu.me>
;; Keywords: tools, files
;; URL: https://github.com/emacs-php/php-mode
;; Version: 1.23.0
;; Version: 1.24.0
;; License: GPL-3.0-or-later
;; This program is free software; you can redistribute it and/or modify
@ -66,7 +66,8 @@ @@ -66,7 +66,8 @@
;;
;;; Code:
(require 'cl-lib)
(eval-when-compile
(require 'cl-lib))
(require 'projectile nil t)
;; Constants

BIN
elpa/php-mode-20200812.1129/php-project.elc → elpa/php-mode-20210519.1728/php-project.elc

Binary file not shown.

240
elpa/php-mode-20200812.1129/php.el → elpa/php-mode-20210519.1728/php.el

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
;; Author: USAMI Kenta <tadsan@zonu.me>
;; Created: 5 Dec 2018
;; Version: 1.23.0
;; Version: 1.24.0
;; Keywords: languages, php
;; Homepage: https://github.com/emacs-php/php-mode
;; License: GPL-3.0-or-later
@ -27,7 +27,8 @@ @@ -27,7 +27,8 @@
;; This file provides common variable and functions for PHP packages.
;;; Code:
(require 'cl-lib)
(eval-when-compile
(require 'cl-lib))
(require 'flymake)
(require 'php-project)
(require 'rx)
@ -46,7 +47,7 @@ @@ -46,7 +47,7 @@
:tag "PHP Executable"
:type 'string)
(defcustom php-site-url "https://php.net/"
(defcustom php-site-url "https://www.php.net/"
"Default PHP.net site URL.
The URL to use open PHP manual and search word."
@ -78,6 +79,70 @@ You can replace \"en\" with your ISO language code." @@ -78,6 +79,70 @@ You can replace \"en\" with your ISO language code."
:type '(choice (string :tag "URL to search PHP documentation")
(const :tag "Use `php-site-url' variable" nil)))
(defcustom php-completion-file ""
"Path to the file which contains the function names known to PHP."
:type 'string)
(defcustom php-manual-path ""
"Path to the directory which contains the PHP manual."
:type 'string)
(defcustom php-search-documentation-function #'php-search-web-documentation
"Function to search PHP Manual at cursor position."
:group 'php
:tag "PHP Search Documentation Function"
:type '(choice (const :tag "Use online documentation" #'php-search-web-documentation)
(const :tag "Use local documentation" #'php-local-manual-search)
(function :tag "Use other function")))
(defcustom php-search-documentation-browser-function nil
"Function to display PHP documentation in a WWW browser.
If non-nil, this shadows the value of `browse-url-browser-function' when
calling `php-search-documentation' or `php-search-local-documentation'."
:group 'php
:tag "PHP Search Documentation Browser Function"
:type '(choice (const :tag "default" nil) function)
:link '(variable-link browse-url-browser-function))
;; Define function for browsing manual
(defun php-browse-documentation-url (url)
"Browse a documentation URL using the configured browser function.
See `php-search-documentation-browser-function'."
(let ((browse-url-browser-function
(or php-search-documentation-browser-function
browse-url-browser-function)))
(browse-url url)))
(defun php-browse-manual ()
"Bring up manual for PHP."
(interactive)
(browse-url (if (stringp php-manual-url)
php-manual-url
(format "%smanual/%s/" php-site-url php-manual-url))))
(defun php-search-web-documentation (word)
"Return URL to search PHP manual search by `WORD'."
(interactive (list (current-word)))
(php-browse-documentation-url (concat (or php-search-url php-site-url) word)))
(defun php-search-documentation (&optional word)
"Search PHP documentation for the `WORD' at point.
If `php-manual-path' has a non-empty string value then the command
will first try searching the local documentation. If the requested
documentation does not exist it will fallback to searching the PHP
website.
With a prefix argument, prompt for a documentation word to search
for. If the local documentation is available, it is used to build
a completion list."
(interactive)
(if (called-interactively-p 'interactive)
(call-interactively php-search-documentation-function)
(funcall php-search-documentation-function word)))
(defcustom php-class-suffix-when-insert "::"
"Suffix for inserted class."
:group 'php
@ -163,7 +228,7 @@ it is the character that will terminate the string, or t if the string should be @@ -163,7 +228,7 @@ it is the character that will terminate the string, or t if the string should be
"Regular expression for a PHP function.")
(eval-when-compile
(defun php-create-regexp-for-method (&optional visibility)
(cl-defun php-create-regexp-for-method (&optional visibility &key include-args)
"Make a regular expression for methods with the given VISIBILITY.
VISIBILITY must be a string that names the visibility for a PHP
@ -178,22 +243,25 @@ which will be the name of the method." @@ -178,22 +243,25 @@ which will be the name of the method."
(setq visibility (list visibility)))
(rx-to-string `(: line-start
(* (syntax whitespace))
,@(if visibility
`((* (or "abstract" "final" "static")
(+ (syntax whitespace)))
(or ,@visibility)
(+ (syntax whitespace))
(* (or "abstract" "final" "static")
(+ (syntax whitespace))))
'((* (* (or "abstract" "final" "static"
"private" "protected" "public")
(+ (syntax whitespace))))))
"function"
(+ (syntax whitespace))
(? "&" (* (syntax whitespace)))
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace))
"(")))
(group
,@(if visibility
`((* (or "abstract" "final" "static")
(+ (syntax whitespace)))
(or ,@visibility)
(+ (syntax whitespace))
(* (or "abstract" "final" "static")
(+ (syntax whitespace))))
'((* (* (or "abstract" "final" "static"
"private" "protected" "public")
(+ (syntax whitespace))))))
"function"
(+ (syntax whitespace))
(? "&" (* (syntax whitespace)))
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace))
"("
,@(when include-args
'((* any) line-end))))))
(defun php-create-regexp-for-classlike (type)
"Accepts a `TYPE' of a 'classlike' object as a string, such as
@ -211,7 +279,101 @@ can be used to match against definitions for that classlike." @@ -211,7 +279,101 @@ can be used to match against definitions for that classlike."
;; this is not necessarily correct for all values of `type'.
"\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)")))
(defconst php-imenu-generic-expression
(defconst php-imenu-generic-expression-default
(eval-when-compile
`(("Methods"
,(php-create-regexp-for-method nil :include-args t) 1)
("Properties"
,(rx line-start
(* (syntax whitespace))
(group
(+ (or "public" "protected" "private" "static" "var")
(+ (syntax whitespace)))
(* (? (? (or "|" "?"))
(or "\\" (syntax word) (syntax symbol))
(+ (syntax whitespace))))
"$" (+ (or (syntax word) (syntax symbol)))
word-boundary))
1)
("Constants"
,(rx line-start
(* (syntax whitespace))
(group
(* (or "public" "protected" "private")
(+ (syntax whitespace)))
"const"
(+ (syntax whitespace))
(+ (or (syntax word) (syntax symbol)))
(* (syntax whitespace))
(? "=" (* (syntax whitespace))
(repeat 0 40 any))))
1)
("Functions"
,(rx line-start
(* (syntax whitespace))
(group
"function"
(+ (syntax whitespace))
(+ (or (syntax word) (syntax symbol)))
(* (syntax whitespace))
"("
(repeat 0 100 any)))
1)
("Import"
,(rx line-start
;; (* (syntax whitespace))
(group
"use"
(+ (syntax whitespace))
(repeat 0 100 any)))
1)
("Classes"
,(php-create-regexp-for-classlike "\\(?:class\\|interface\\|trait\\|enum\\)") 0)
("Namespace"
,(php-create-regexp-for-classlike "namespace") 1)))
"Imenu generic expression for PHP Mode. See `imenu-generic-expression'.")
(defconst php-imenu-generic-expression-simple
(eval-when-compile
`(("Methods"
,(php-create-regexp-for-method nil) 2)
("Properties"
,(rx line-start
(* (syntax whitespace))
(+ (or "public" "protected" "private" "static" "var")
(+ (syntax whitespace)))
(* (? (? (or "|" "?"))
(or "\\" (syntax word) (syntax symbol))
(+ (syntax whitespace))))
(group
"$" (+ (or (syntax word) (syntax symbol))))
word-boundary)
1)
("Constants"
,(rx line-start
(* (syntax whitespace))
(group
(* (or "public" "protected" "private")
(+ (syntax whitespace)))
"const"
(+ (syntax whitespace))
(+ (or (syntax word) (syntax symbol)))))
1)
("Functions"
,(rx line-start
(* (syntax whitespace))
"function"
(+ (syntax whitespace))
(group
(+ (or (syntax word) (syntax symbol)))))
1)
("Classes"
,(php-create-regexp-for-classlike "\\(?:class\\|interface\\|trait\\|enum\\)") 1)
("Namespace"
,(php-create-regexp-for-classlike "namespace") 1)))
"Imenu generic expression for PHP Mode. See `imenu-generic-expression'.")
(defconst php-imenu-generic-expression-legacy
(eval-when-compile
`(("Namespaces"
,(php-create-regexp-for-classlike "namespace") 1)
@ -224,17 +386,25 @@ can be used to match against definitions for that classlike." @@ -224,17 +386,25 @@ can be used to match against definitions for that classlike."
("All Methods"
,(php-create-regexp-for-method) 1)
("Private Methods"
,(php-create-regexp-for-method '("private")) 1)
,(php-create-regexp-for-method '("private")) 2)
("Protected Methods"
,(php-create-regexp-for-method '("protected")) 1)
,(php-create-regexp-for-method '("protected")) 2)
("Public Methods"
,(php-create-regexp-for-method '("public")) 1)
,(php-create-regexp-for-method '("public")) 2)
("Anonymous Functions"
"\\<\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*=\\s-*f\\(unctio\\)?n\\s-*(" 1)
("Named Functions"
"^\\s-*function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1)))
"Imenu generic expression for PHP Mode. See `imenu-generic-expression'.")
(defcustom php-imenu-generic-expression 'php-imenu-generic-expression-default
"Default Imenu generic expression for PHP Mode. See `imenu-generic-expression'."
:type '(choice (alist :key-type string :value-type list)
(const 'php-imenu-generic-expression-legacy)
(const 'php-imenu-generic-expression-simple)
variable)
:group 'php)
(defconst php--re-namespace-pattern
(eval-when-compile
(php-create-regexp-for-classlike "namespace")))
@ -250,6 +420,28 @@ can be used to match against definitions for that classlike." @@ -250,6 +420,28 @@ can be used to match against definitions for that classlike."
(when (re-search-backward re-pattern nil t)
(match-string-no-properties 1)))))
(defun php-get-pattern ()
"Find the pattern we want to complete.
`find-tag-default' from GNU Emacs etags.el"
(save-excursion
(save-match-data
(while (looking-at "\\sw\\|\\s_")
(forward-char 1))
(when (or (re-search-backward "\\sw\\|\\s_"
(save-excursion (beginning-of-line) (point))
t)
(re-search-forward "\\(\\sw\\|\\s_\\)+"
(save-excursion (end-of-line) (point))
t))
(goto-char (match-end 0))
(buffer-substring-no-properties
(point)
(progn
(forward-sexp -1)
(while (looking-at "\\s'")
(forward-char 1))
(point)))))))
;;; Provide support for Flymake so that users can see warnings and
;;; errors in real-time as they write code.
(defun php-flymake-php-init ()

BIN
elpa/php-mode-20210519.1728/php.elc

Binary file not shown.

34
init.el

@ -13,26 +13,23 @@ @@ -13,26 +13,23 @@
;; If there is more than one, they won't work right.
'(ansi-color-names-vector
["#212121" "#CC5542" "#6aaf50" "#7d7c61" "#5180b3" "#DC8CC3" "#9b55c3" "#bdbdb3"])
'(compilation-message-face (quote default))
'(custom-enabled-themes (quote (dracula)))
'(compilation-message-face 'default)
'(custom-enabled-themes '(dracula))
'(custom-safe-themes
(quote
("24714e2cb4a9d6ec1335de295966906474fdb668429549416ed8636196cb1441" "fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "c7eb06356fd16a1f552cfc40d900fe7326ae17ae7578f0ef5ba1edd4fdd09e58" "f3ab34b145c3b2a0f3a570ddff8fabb92dafc7679ac19444c31058ac305275e1" "dcdd1471fde79899ae47152d090e3551b889edf4b46f00df36d653adc2bf550d" "3994b1c5c1f412c025bb71b2df5973a421c257afee5278684639c205d79d93ee" default)))
'("24714e2cb4a9d6ec1335de295966906474fdb668429549416ed8636196cb1441" "fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "c7eb06356fd16a1f552cfc40d900fe7326ae17ae7578f0ef5ba1edd4fdd09e58" "f3ab34b145c3b2a0f3a570ddff8fabb92dafc7679ac19444c31058ac305275e1" "dcdd1471fde79899ae47152d090e3551b889edf4b46f00df36d653adc2bf550d" "3994b1c5c1f412c025bb71b2df5973a421c257afee5278684639c205d79d93ee" default))
'(fci-rule-color "#2e2e2e")
'(highlight-changes-colors (quote ("#FD5FF0" "#AE81FF")))
'(highlight-changes-colors '("#FD5FF0" "#AE81FF"))
'(highlight-tail-colors
(quote
(("#3C3D37" . 0)
'(("#3C3D37" . 0)
("#679A01" . 20)
("#4BBEAE" . 30)
("#1DB4D0" . 50)
("#9A8F21" . 60)
("#A75B00" . 70)
("#F309DF" . 85)
("#3C3D37" . 100))))
("#3C3D37" . 100)))
'(hl-todo-keyword-faces
(quote
(("TODO" . "#dc752f")
'(("TODO" . "#dc752f")
("NEXT" . "#dc752f")
("THEM" . "#2d9574")
("PROG" . "#4f97d7")
@ -46,19 +43,17 @@ @@ -46,19 +43,17 @@
("TEMP" . "#b1951d")
("FIXME" . "#dc752f")
("XXX+" . "#dc752f")
("\\?\\?\\?+" . "#dc752f"))))
("\\?\\?\\?+" . "#dc752f")))
'(inhibit-startup-screen t)
'(magit-diff-use-overlays nil)
'(package-selected-packages
(quote
(dumb-jump csharp-mode yaml-mode smooth-scrolling web-mode multi-web-mode spacemacs-theme flycheck ac-emmet markdown-preview-mode multiple-cursors git-gutter powerline ample-zen-theme monokai-theme dracula-theme auto-complete neotree all-the-icons spinner markdown-mode lv ht f dash-functional)))
'(pdf-view-midnight-colors (quote ("#b2b2b2" . "#292b2e")))
'(dumb-jump csharp-mode yaml-mode smooth-scrolling web-mode multi-web-mode spacemacs-theme flycheck ac-emmet markdown-preview-mode multiple-cursors git-gutter powerline ample-zen-theme monokai-theme dracula-theme auto-complete neotree all-the-icons spinner markdown-mode lv ht f dash-functional))
'(pdf-view-midnight-colors '("#b2b2b2" . "#292b2e"))
'(pos-tip-background-color "#FFFACE")
'(pos-tip-foreground-color "#272822")
'(vc-annotate-background "#3b3b3b")
'(vc-annotate-color-map
(quote
((20 . "#dd5542")
'((20 . "#dd5542")
(40 . "#CC5542")
(60 . "#fb8512")
(80 . "#baba36")
@ -75,11 +70,10 @@ @@ -75,11 +70,10 @@
(300 . "#528fd1")
(320 . "#5180b3")
(340 . "#6380b3")
(360 . "#DC8CC3"))))
(360 . "#DC8CC3")))
'(vc-annotate-very-old-color "#DC8CC3")
'(weechat-color-list
(quote
(unspecified "#272822" "#3C3D37" "#F70057" "#F92672" "#86C30D" "#A6E22E" "#BEB244" "#E6DB74" "#40CAE4" "#66D9EF" "#FB35EA" "#FD5FF0" "#74DBCD" "#A1EFE4" "#F8F8F2" "#F8F8F0"))))
'(unspecified "#272822" "#3C3D37" "#F70057" "#F92672" "#86C30D" "#A6E22E" "#BEB244" "#E6DB74" "#40CAE4" "#66D9EF" "#FB35EA" "#FD5FF0" "#74DBCD" "#A1EFE4" "#F8F8F2" "#F8F8F0")))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@ -154,7 +148,7 @@ @@ -154,7 +148,7 @@
(setq mouse-wheel-progressive-speed nil) ;Deshabilita la velocidad progresiva del scroll (mientras más scroll haces, mas rápido va)
;Neotree con iconitos y con tamaño dinámico y sin número de líneas.
(require 'all-the-icons)
(require 'all-the-icons)
(require 'neotree)
(setq neo-theme (if (display-graphic-p) 'icons 'all-the-icons))
(setq neo-window-fixed-size nil)

Loading…
Cancel
Save