Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 50 additions & 25 deletions php-face.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,103 +38,128 @@

(defface php-string '((t (:inherit font-lock-string-face)))
"PHP Mode face used to highlight string literals."
:group 'php-faces)
:group 'php-faces
:tag "PHP String")

(defface php-keyword '((t (:inherit font-lock-keyword-face)))
"PHP Mode face used to highlight keywords."
:group 'php-faces)
:group 'php-faces
:tag "PHP Keyword")

(defface php-builtin '((t (:inherit font-lock-builtin-face)))
"PHP Mode face used to highlight builtins."
:group 'php-faces)
:group 'php-faces
:tag "PHP Built-in")

(defface php-function-name '((t (:inherit font-lock-function-name-face)))
"PHP Mode face used to highlight function names."
:group 'php-faces)
:group 'php-faces
:tag "PHP Function Name")

(defface php-function-call '((t (:inherit default)))
"PHP Mode face used to highlight function names in calles."
:group 'php-faces)
:group 'php-faces
:tag "PHP Function Call")

(defface php-method-call '((t (:inherit php-function-call)))
"PHP Mode face used to highlight method names in calles."
:group 'php-faces)
:group 'php-faces
:tag "PHP Method Call")

(defface php-static-method-call '((t (:inherit php-method-call)))
"PHP Mode face used to highlight static method names in calles."
:group 'php-faces)
:group 'php-faces
:tag "PHP Static Method Call")

(defface php-variable-name '((t (:inherit font-lock-variable-name-face)))
"PHP Mode face used to highlight variable names."
:group 'php-faces)
:group 'php-faces
:tag "PHP Variable Name")

(defface php-property-name '((t (:inherit php-variable-name)))
"PHP Mode face used to highlight property names."
:group 'php-faces)
:group 'php-faces
:tag "PHP Property Name")

(defface php-variable-sigil '((t (:inherit default)))
"PHP Mode face used to highlight variable sigils ($)."
:group 'php-faces)
:group 'php-faces
:tag "PHP Variable Sigil")

(defface php-object-op '((t (:inherit default)))
"PHP Mode face used to object operators (->)."
:group 'php-faces)
:group 'php-faces
:tag "PHP Object Op")

(defface php-paamayim-nekudotayim '((t (:inherit default)))
"PHP Mode face used to highlight \"Paamayim Nekudotayim\" scope resolution operators (::)."
:group 'php-faces)
:group 'php-faces
:tag "PHP Paamayim Nekudotayim")

(defface php-type '((t (:inherit font-lock-type-face)))
"PHP Mode face used to highlight types."
:group 'php-faces)
:group 'php-faces
:tag "PHP Type")

(defface php-constant '((t (:inherit font-lock-constant-face)))
"PHP Mode face used to highlight constants."
:group 'php-faces)
:group 'php-faces
:tag "PHP Constant")

(defface php-constant-assign '((t (:inherit font-lock-type-face)))
"PHP Mode face used to highlight constant assigning (\"const\" statement)."
:group 'php-faces)
:group 'php-faces
:tag "PHP Constant Assign")

(defface php-magical-constant '((t (:inherit font-lock-builtin-face)))
"PHP Mode face used to highlight magical constants."
:group 'php-faces)
:group 'php-faces
:tag "PHP Magical Constant")

(defface php-$this '((t (:inherit php-constant)))
"PHP Mode face used to highlight $this variables."
:group 'php-faces)
:group 'php-faces
:tag "PHP $this")

(defface php-$this-sigil '((t (:inherit php-constant)))
"PHP Mode face used to highlight sigils($) of $this variable."
:group 'php-faces)
:group 'php-faces
:tag "PHP $this Sigil")

(defface php-errorcontrol-op '((t (:inherit font-lock-type-face)))
"PHP Mode face used to highlight errorcontrol operators (@).."
:group 'php-face)
:group 'php-faces
:tag "PHP ErrorControl Op")

(defface php-php-tag '((t (:inherit font-lock-preprocessor-face)))
"PHP Mode face used to highlight PHP tags."
:group 'php-faces)
:group 'php-faces
:tag "PHP php Tag")

(defface php-doc-annotation-tag '((t . (:inherit font-lock-constant-face)))
"Face used to highlight annotation tags in doc-comment."
:group 'php-faces)
:group 'php-faces
:tag "PHPDoc Annotation Tag")

(defface php-doc-variable-sigil '((t (:inherit font-lock-variable-name-face)))
"PHP Mode face used to highlight variable sigils($)."
:group 'php-faces)
:group 'php-faces
:tag "PHPDoc Variable Sigil")

(defface php-doc-$this '((t (:inherit php-type)))
"PHP Mode face used to highlight $this variable in doc-comment."
:group 'php-faces)
:group 'php-faces
:tag "PHPDoc $this")

(defface php-doc-$this-sigil '((t (:inherit php-type)))
"PHP Mode face used to highlight sigil of $this variable in doc-comment."
:group 'php-faces)
:group 'php-faces
:tag "PHPDoc $this Sigil")

(defface php-doc-class-name '((t (:inherit php-string)))
"Face used to class names in doc-comment."
:group 'php-faces)
:group 'php-faces
:tag "PHPDoc Class Name")

(define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0")

Expand Down
33 changes: 33 additions & 0 deletions php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@
(defcustom php-mode-default-face 'default
"Default face in `php-mode' buffers."
:group 'php-mode
:tag "PHP Mode Default Face"
:type 'face)

(define-obsolete-variable-alias 'php-speedbar-config 'php-mode-speedbar-config "1.20.0")
(defcustom php-mode-speedbar-config t
"When set to true automatically configures Speedbar to observe PHP files.
Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s345]?\\)\""
:group 'php-mode
:tag "PHP Mode Speedbar Config"
:type 'boolean
:set (lambda (sym val)
(set-default sym val)
Expand All @@ -154,6 +156,7 @@ Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s345]?\\
"Normally `php-mode' starts with the speedbar closed.
Turning this on will open it whenever `php-mode' is loaded."
:group 'php-mode
:tag "PHP Mode Speedbar Open"
:type 'boolean
:set (lambda (sym val)
(set-default sym val)
Expand All @@ -164,6 +167,7 @@ Turning this on will open it whenever `php-mode' is loaded."
(defcustom php-mode-template-compatibility t
"Should detect presence of html tags."
:group 'php-mode
:tag "PHP Mode Template Compatibility"
:type 'boolean)

(defun php-mode-extra-constants-create-regexp (kwds)
Expand Down Expand Up @@ -194,13 +198,15 @@ of constants when set."
(defcustom php-mode-lineup-cascaded-calls nil
"Indent chained method calls to the previous line."
:group 'php-mode
:tag "PHP Mode Lineup Cascaded Calls"
:type 'boolean)


(define-obsolete-variable-alias 'php-extra-constants 'php-mode-extra-constants "1.20.0")
(defcustom php-mode-extra-constants '()
"A list of additional strings to treat as PHP constants."
:group 'php-mode
:tag "PHP Mode Extra Constants"
:type '(repeat string)
:set 'php-mode-extra-constants-set)

Expand All @@ -213,6 +219,8 @@ set to `semantic-create-imenu-index' due to `c-mode' being its
parent. Set this variable to t if you want to use
`imenu-default-create-index-function' even with `semantic-mode'
enabled."
:group 'php-mode
:tag "PHP Mode Do Not Use Semantic Imenu"
:type 'boolean)

(defcustom php-completion-file ""
Expand All @@ -233,38 +241,54 @@ enabled."

(defcustom php-mode-hook nil
"List of functions to be executed on entry to `php-mode'."
:group 'php-mode
:tag "PHP Mode Hook"
:type 'hook)

(defcustom php-mode-pear-hook nil
"Hook called when a PHP PEAR file is opened with `php-mode'."
:group 'php-mode
:tag "PHP Mode Pear Hook"
:type 'hook)

(defcustom php-mode-drupal-hook nil
"Hook called when a Drupal file is opened with `php-mode'."
:group 'php-mode
:tag "PHP Mode Drupal Hook"
:type 'hook)

(defcustom php-mode-wordpress-hook nil
"Hook called when a WordPress file is opened with `php-mode'."
:group 'php-mode
:tag "PHP Mode WordPress Hook"
:type 'hook)

(defcustom php-mode-symfony2-hook nil
"Hook called when a Symfony2 file is opened with `php-mode'."
:group 'php-mode
:tag "PHP Mode Symfony2 Hook"
:type 'hook)

(defcustom php-mode-psr2-hook nil
"Hook called when a PSR-2 file is opened with `php-mode'."
:group 'php-mode
:tag "PHP Mode PSR-2 Hook"
:type 'hook)

(defcustom php-mode-force-pear nil
"Normally PEAR coding rules are enforced only when the filename contains \"PEAR.\"
Turning this on will force PEAR rules on all PHP files."
:group 'php-mode
:tag "PHP Mode Force Pear"
:type 'boolean)

(defcustom php-mode-warn-if-mumamo-off t
"Warn once per buffer if you try to indent a buffer without
mumamo-mode turned on. Detects if there are any HTML tags in the
buffer before warning, but this is is not very smart; e.g. if you
have any tags inside a PHP string, it will be fooled."
:group 'php-mode
:tag "PHP Mode Warn If MuMaMo Off"
:type '(choice (const :tag "Warn" t) (const "Don't warn" nil)))

(defcustom php-mode-coding-style 'pear
Expand All @@ -282,6 +306,8 @@ This variable can take one of the following symbol values:
`Symfony2' - use coding styles preferred for working with Symfony2 projects.

`PSR-2' - use coding styles preferred for working with projects using PSR-2 standards."
:group 'php-mode
:tag "PHP Mode Coding Style"
:type '(choice (const :tag "Default" default)
(const :tag "PEAR" pear)
(const :tag "Drupal" drupal)
Expand All @@ -297,18 +323,24 @@ This variable can take one of the following symbol values:

If you want to suppress styles from being overwritten by directory / file
local variables, set NIL."
:group 'php-mode
:tag "PHP Mode Enable Project Coding Style"
:type 'boolean)

(defcustom php-mode-enable-backup-style-variables t
"When set to `T', back up values set by hook and buffer local variables.

This function may interfere with other hooks and other behaviors.
In that case set to `NIL'."
:group 'php-mode
:tag "PHP Mode Enable Backup Style Variables"
:type 'boolean)

(define-obsolete-variable-alias 'php-mode-disable-parent-mode-hooks 'php-mode-disable-c-mode-hook "1.21.0")
(defcustom php-mode-disable-c-mode-hook t
"When set to `T', do not run hooks of parent modes (`java-mode', `c-mode')."
:group 'php-mode
:tag "PHP Mode Disable C Mode Hook"
:type 'boolean
:group 'php-mode)

Expand Down Expand Up @@ -1234,6 +1266,7 @@ current `tags-file-name'."
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))

Expand Down
7 changes: 7 additions & 0 deletions php.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,23 @@

(defcustom php-executable (or (executable-find "php") "/usr/bin/php")
"The location of the PHP executable."
:group 'php
:tag "PHP Executable"
:type 'string)

(defcustom php-site-url "https://php.net/"
"Default PHP.net site URL.

The URL to use open PHP manual and search word."
:group 'php
:tag "PHP Site URL"
:type 'string)

(defcustom php-manual-url 'en
"URL at which to find PHP manual.
You can replace \"en\" with your ISO language code."
:group 'php
:tag "PHP Manual URL"
:type '(choice (const :tag "English" 'en)
(const :tag "Brazilian Portuguese" 'pt_BR)
(const :tag "Chinese (Simplified)" 'zh)
Expand All @@ -66,6 +72,7 @@ You can replace \"en\" with your ISO language code."
(defcustom php-search-url nil
"URL at which to search for documentation on a word."
:group 'php
:tag "PHP Search URL"
:type '(choice (string :tag "URL to search PHP documentation")
(const :tag "Use `php-site-url' variable" nil)))

Expand Down