diff --git a/.travis.yml b/.travis.yml
index 68bb672..dcd2450 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,20 +1,14 @@
language: emacs-lisp
before_install:
- - curl -fsSkL https://gist.githubusercontent.com/rejeep/7736123/raw | sh
- - export PATH="/home/travis/.cask/bin:$PATH"
- - export PATH="/home/travis/.evm/bin:$PATH"
- - evm install $EVM_EMACS --use
- - cask
+ - git clone https://github.com/rejeep/evm.git $HOME/.evm
+ - export PATH=$HOME/.cask/bin:$HOME/.evm/bin:$PATH
+ - evm config path /tmp
+ - evm install $EVM_EMACS --use --skip
+ - curl -fsSkL https://raw.github.com/cask/cask/master/go | python
env:
- - EVM_EMACS=emacs-24.1-bin
- - EVM_EMACS=emacs-24.2-bin
- - EVM_EMACS=emacs-24.4-bin
- - EVM_EMACS=emacs-24.5-bin
+ - EVM_EMACS=emacs-25.3-travis
+ - EVM_EMACS=emacs-26.3-travis-linux-xenial
+ - EVM_EMACS=emacs-git-snapshot-travis-linux-xenial
script:
- emacs --version
- make test
-notifications:
- webhooks: https://webhooks.gitter.im/e/fa0500ce49cab8dc8144
- on_success: change
- on_failure: always
- on_start: never
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..15bca2b
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at arne@arnested.dk. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
diff --git a/COPYING b/COPYING
index 94a9ed0..e600086 100644
--- a/COPYING
+++ b/COPYING
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
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 .
+ along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-.
+.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-.
+.
diff --git a/Cask b/Cask
index efad37c..3347780 100644
--- a/Cask
+++ b/Cask
@@ -1,3 +1,3 @@
(package-file "drupal-mode.el")
-(source marmalade)
+(source melpa)
diff --git a/Makefile b/Makefile
index 808de21..86d4bf0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# This file is part of Drupal mode.
-# Copyright (C) 2012, 2013 Arne Jørgensen
+# Copyright (C) 2012, 2013, 2020 Arne Jørgensen
# Author: Arne Jørgensen
@@ -15,7 +15,7 @@
# General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with Drupal mode. If not, see .
+# along with Drupal mode. If not, see .
.PHONY: all test clean install
@@ -42,9 +42,9 @@ README: README.md
$(PANDOC) -t plain -o $@ $^
$(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
- $(CASK) package
+ $(CASK) pkg-file
-# create a tar ball in package.el format for uploading to http://marmalade-repo.org
+# create a tar ball in package.el format
$(PACKAGE_NAME).tar: README $(ARCHIVE_NAME).el $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME).info dir drupal/*.el drupal-tests.el drush-make-mode.el
$(TAR) -c -s "@^@$(PACKAGE_NAME)/@" -f $(PACKAGE_NAME).tar $^
diff --git a/README.md b/README.md
index db678f1..189ee7a 100644
--- a/README.md
+++ b/README.md
@@ -32,13 +32,9 @@ below) and depend on a few through the packaging system
## Installation
The easiest way to install Drupal mode is probably to install it via
-the ELPA archive at
-[Marmalade](http://marmalade-repo.org/packages/drupal-mode) or
-[MELPA Stable](http://stable.melpa.org/#/drupal-mode) (if you want
-bleeding edge use regular [MELPA](http://melpa.org/#/drupal-mode)).
-
-ELPA (package.el) is part of Emacs 24. For Emacs 23 see
-[Marmalade](http://marmalade-repo.org) for installation instructions.
+the ELPA archive [MELPA
+Stable](https://stable.melpa.org/#/drupal-mode) (if you want bleeding
+edge use regular [MELPA](https://melpa.org/#/drupal-mode)).
## Features of Drupal mode
@@ -46,7 +42,7 @@ ELPA (package.el) is part of Emacs 24. For Emacs 23 see
### Drupal Coding Standards
Drupal mode will make you write code that adheres to
-[Drupals coding standards](http://drupal.org/coding-standards#indenting).
+[Drupals coding standards](https://www.drupal.org/coding-standards).
It does this by:
@@ -54,7 +50,7 @@ It does this by:
#### Indentation
In php-mode code will be indented according to
-[Drupals coding standards](http://drupal.org/coding-standards#indenting). If not
+[Drupals coding standards](https://www.drupal.org/coding-standards). If not
it is considered a bug!
@@ -91,10 +87,10 @@ menu entry.
Files that are part of a Drupal project will try to identify the used
version of Drupal core and look up the documentation for the
-corresponding version at http://api.drupal.org.
+corresponding version at https://api.drupal.org.
If the symbol at point is believed to be a Drush command the
-documentation will be looked up at http://api.drush.org instead. If
+documentation will be looked up at https://api.drush.org instead. If
Drush is installed it will identify the version of Drush and look up
the documentation for the installed version of Drush.
@@ -131,7 +127,7 @@ Etags is a built-in part of Emacs.
### GNU Globals / gtags
-If you load [GNU Globals / gtags](http://www.gnu.org/software/global/)
+If you load [GNU Globals / gtags](https://www.gnu.org/software/global/)
support in Emacs then Drupal mode will set `gtags-rootdir` to your
DRUPAL_ROOT.
@@ -139,7 +135,7 @@ DRUPAL_ROOT.
### Drush utilities for Emacs users
If
-[Drush utilities for Emacs users](http://drupal.org/project/emacs_drush)
+[Drush utilities for Emacs users](https://www.drupal.org/project/emacs_drush)
is installed Drupal mode will update existing tag files in your
DRUPAL_ROOT after saving a buffer.
@@ -148,11 +144,11 @@ DRUPAL_ROOT after saving a buffer.
If ispell.el is loaded in Emacs then Drupal mode will set the language
of your Drupal mode buffers to `american` as stated in [Drupals coding
-standards](http://drupal.org/coding-standards).
+standards](https://www.drupal.org/coding-standards).
ispell.el is a built-in part of Emacs. An external program must be
installed to run the actual spell checking,
-i.e. [ispell](http://www.gnu.org/software/ispell/),
+i.e. [ispell](https://www.gnu.org/software/ispell/),
[aspell](http://aspell.net/), or
[hunspell](http://hunspell.sourceforge.net/).
@@ -162,14 +158,14 @@ i.e. [ispell](http://www.gnu.org/software/ispell/),
If support for
[flymake-phpcs.el](https://github.com/illusori/emacs-flymake-phpcs) is
loaded in Emacs and you have installed
-[Drupal Code Sniffer](http://drupal.org/project/drupalcs) rules then
+[Drupal Code Sniffer](https://www.drupal.org/project/drupalcs) rules then
Drupal mode will enable flymake-phpcs under php-mode.
For this to work you need:
-* [PHP CodeSniffer](http://pear.php.net/package/PHP_CodeSniffer)
-* [flymake-phpcs.el](http://marmalade-repo.org/packages/flymake-phpcs)
-* [Drupal Code Sniffer](http://drupal.org/project/drupalcs) rules
+* [PHP CodeSniffer](https://pear.php.net/package/PHP_CodeSniffer)
+* [flymake-phpcs.el](https://melpa.org/#/flymake-phpcs)
+* [Drupal Code Sniffer](https://www.drupal.org/project/drupalcs) rules
## Other takes on a Drupal mode
@@ -179,11 +175,11 @@ wild:
* [Search Github for drupal-mode](https://github.com/search?l=Emacs+Lisp&q=drupal&type=Repositories)
* At drupal.org:
- * http://drupal.org/sandbox/bartlantz/1405156
- * http://drupal.org/project/emacs
+ * https://www.drupal.org/sandbox/bartlantz/1405156
+ * https://www.drupal.org/project/emacs
All of them more or less based on
-[Configuring Emacs](http://drupal.org/node/59868).
+[Configuring Emacs](https://www.drupal.org/node/59868).
## Development of Drupal mode
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000..95a5c55
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,11 @@
+# Security Policy
+
+## Supported Versions
+
+All versions are supported.
+
+## Reporting a Vulnerability
+
+Security issues can be reported to [Arne Jørgensen](https://github.com/arnested)
+either by [mail](mailto:arne@arnested.dk) or any other channel you prefer and
+trust (see my [Keybase profile](https://keybase.io/arnested)).
diff --git a/drupal-mode.el b/drupal-mode.el
index 4c22434..83cb184 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -1,11 +1,11 @@
;;; drupal-mode.el --- Advanced minor mode for Drupal development
-;; Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2020 Arne Jørgensen
;; Author: Arne Jørgensen
;; URL: https://github.com/arnested/drupal-mode
;; Created: January 17, 2012
-;; Version: 0.7.3
+;; Version: 0.7.4
;; Package-Requires: ((php-mode "1.5.0"))
;; Keywords: programming, php, drupal
@@ -22,7 +22,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
@@ -33,7 +33,7 @@
;;; Code:
-(require 'cl)
+(require 'cl-lib)
(require 'php-mode)
(require 'format-spec)
(require 'json)
@@ -71,7 +71,7 @@ a single newline (\\n)."
(const :tag "Always" t)
(const :tag "Never" nil)
(const :tag "Ask" ask))
- :link '(url-link :tag "drupal.org" "https://drupal.org/coding-standards#indenting")
+ :link '(url-link :tag "drupal.org" "https://www.drupal.org/coding-standards")
:group 'drupal)
@@ -92,19 +92,17 @@ whitespace at the end."
(const :tag "Always" always)
(const :tag "Default" default)
(const :tag "Never" never))
- :link '(url-link :tag "drupal.org" "https://drupal.org/coding-standards#indenting")
+ :link '(url-link :tag "drupal.org" "https://www.drupal.org/coding-standards")
:group 'drupal)
-(defcustom drupal-search-url "http://api.drupal.org/api/search/%v/%s"
+(defcustom drupal-search-url "https://api.drupal.org/api/search/%v/%s"
"The URL to search the Drupal API.
%v is the Drupal major version.
%s is the search term."
- :type '(choice (const :tag "Api.drupal.org" "http://api.drupal.org/api/search/%v/%s")
- (const :tag "Drupalcontrib.org" "http://drupalcontrib.org/api/search/%v/%s")
- (string :tag "Other" "http://example.com/api/search/%v/%s"))
- :link '(url-link :tag "api.drupalcontrib.org" "http://api.drupalcontrib.org")
- :link '(url-link :tag "api.drupal.org" "http://api.drupal.org")
+ :type '(choice (const :tag "Api.drupal.org" "https://api.drupal.org/api/search/%v/%s")
+ (string :tag "Other" "https://example.com/api/search/%v/%s"))
+ :link '(url-link :tag "api.drupal.org" "https://api.drupal.org")
:group 'drupal)
;;;###autoload
@@ -116,7 +114,7 @@ whitespace at the end."
%v is the Drush version.
%s is the search term."
:type '(choice (const :tag "Api.drush.org" "http://api.drush.org/api/search/%v/%s")
- (string :tag "Other" "http://example.com/api/search/%v/%s"))
+ (string :tag "Other" "https://example.com/api/search/%v/%s"))
:link '(url-link :tag "api.drush.org" "http://api.drush.org")
:safe 'string-or-null-p
:group 'drupal-drush)
@@ -161,7 +159,7 @@ Include path to the executable if it is not in your $PATH."
:group 'drupal)
;;;###autoload
-(defcustom drupal-info-modes (list 'conf-windows-mode)
+(defcustom drupal-info-modes (list 'conf-windows-mode 'yaml-mode)
"Major modes to consider info files in Drupal mode."
:type '(repeat symbol)
:group 'drupal)
@@ -184,7 +182,10 @@ Drupal mode will only do auto fill in comments (auto filling code
is not nice).
If `Yes' enable `auto-fill-mode' in Drupal PHP mode buffers.
-If `No' don't enable `auto-fill-mode' in Drupal PHP mode buffers (`auto-fill-mode' can still be enabled by other settings)."
+
+If `No' don't enable `auto-fill-mode' in Drupal PHP mode
+buffers (`auto-fill-mode' can still be enabled by other
+settings)."
:type `(choice
:tag "Enable `auto-fill-mode'."
(const :tag "Yes" t)
@@ -309,7 +310,7 @@ function arguments.")
(setq comment-end "")
;; Setup cc-mode style stuff.
- (when (derived-mode-p 'c-mode)
+ (when (or (derived-mode-p 'php-base-mode) (derived-mode-p 'c-mode))
(c-add-language 'drupal-mode 'c-mode)
(c-set-style "drupal"))
@@ -333,16 +334,16 @@ function arguments.")
(indent-tabs-mode . nil)
(require-final-newline . t)
(c-offsets-alist . ((arglist-close . 0)
- (arglist-cont-nonempty . c-lineup-math)
- (arglist-intro . +)
+ (arglist-cont-nonempty . php-lineup-arglist)
(statement-cont . +)))
(c-doc-comment-style . (php-mode . javadoc))
(c-label-minimum-indentation . 1)
(c-special-indent-hook . c-gnu-impose-minimum)
)
"Drupal coding style.
-According to https://drupal.org/coding-standards#indenting."
- :link '(url-link :tag "drupal.org" "https://drupal.org/coding-standards#indenting")
+According to https://www.drupal.org/coding-standards."
+ :link '(url-link :tag "drupal.org" "https://www.drupal.org/coding-standards")
+ :type '(cons string (alist symbol sexp))
:group 'drupal)
(c-add-style "drupal" drupal-style)
@@ -442,13 +443,13 @@ of the project)."
(define-key drupal-mode-map
[menu-bar drupal drupal-project drupal-project-bugs]
- '(menu-item "Bug reports" (lambda () (interactive) (browse-url (concat "https://drupal.org/project/issues/" drupal-project "?categories=bug")))))
+ '(menu-item "Bug reports" (lambda () (interactive) (browse-url (concat "https://www.drupal.org/project/issues/" drupal-project "?categories=bug")))))
(define-key drupal-mode-map
[menu-bar drupal drupal-project drupal-project-issues]
- '(menu-item "Issues" (lambda () (interactive) (browse-url (concat "https://drupal.org/project/issues/" drupal-project "?categories=All")))))
+ '(menu-item "Issues" (lambda () (interactive) (browse-url (concat "https://www.drupal.org/project/issues/" drupal-project "?categories=All")))))
(define-key drupal-mode-map
[menu-bar drupal drupal-project drupal-project-home]
- '(menu-item "Project page" (lambda () (interactive) (browse-url (concat "https://drupal.org/project/" drupal-project)))))
+ '(menu-item "Project page" (lambda () (interactive) (browse-url (concat "https://www.drupal.org/project/" drupal-project)))))
(define-key drupal-mode-map
[menu-bar drupal drupal-project drupal-project-separator]
'("--"))
@@ -463,7 +464,7 @@ of the project)."
(defun drupal-convert-line-ending ()
"Convert to unix style line ending.
-According to https://drupal.org/coding-standards#indenting you
+According to https://www.drupal.org/coding-standards you
should save your files with unix style end of line."
(when (and drupal-mode
drupal-convert-line-ending
@@ -542,7 +543,7 @@ buffer."
(buffer-string)))))
(when (not config)
(error "No Drupal SQL configuration found."))
- (destructuring-bind (&key database driver &allow-other-keys) config
+ (cl-destructuring-bind (&key database driver &allow-other-keys) config
(let ((sql-interactive-product
(drupal--db-driver-to-sql-product driver))
(start-buffer (current-buffer))
@@ -755,7 +756,7 @@ the location of DRUPAL_ROOT."
(string= module-version "VERSION"))
(setq module-version version))
(puthash (expand-file-name (file-name-directory module)) `((drupal-module . ,(file-name-nondirectory
- (file-name-sans-extension module)))
+ (file-name-sans-extension (file-name-sans-extension module))))
(drupal-version . ,version)
(drupal-module-name . ,module-name)
(drupal-module-version . ,module-version)
@@ -809,13 +810,12 @@ older implementation of `locate-dominating-file'."
(let ((prev-user user))
(setq user (nth 2 (file-attributes dir)))
(or (null prev-user) (equal user prev-user))))
- (if (and (setq files (condition-case nil
- (directory-files dir 'full "\\(.+\\)\\.info\\'" 'nosort)
- (error nil)))
- (file-exists-p (concat (file-name-sans-extension (car files)) ".module")))
+ (if (setq files (condition-case nil
+ (directory-files dir 'full "\\(.+\\)\\.info\\(\\.yml\\)\\'" 'nosort)
+ (error nil)))
(if info-file-location
(throw 'found (car files))
- (throw 'found (file-name-nondirectory (file-name-sans-extension (car files)))))
+ (throw 'found (file-name-nondirectory (file-name-sans-extension(file-name-sans-extension (car files))))))
(if (equal dir
(setq dir (file-name-directory
(directory-file-name dir))))
@@ -834,12 +834,12 @@ Used in `drupal-insert-hook' and `drupal-insert-function'."
drupal-module
;; Otherwise fall back to a very naive
;; way of guessing the module name.
- (file-name-nondirectory (file-name-sans-extension (or buffer-file-name (buffer-name))))))))
+ (file-name-nondirectory (file-name-sans-extension (file-name-sans-extension (or buffer-file-name (buffer-name)))))))))
(if (called-interactively-p 'any)
(insert name)
name)))
-(defun* drupal-module-major-version (&key version default)
+(cl-defun drupal-module-major-version (&key version default)
"Return a modules major version number.
If VERSION is not set derive it from the buffer local variable
`drupal-major-version'.
@@ -896,6 +896,7 @@ mode-hook."
(eval-after-load 'eldoc '(require 'drupal/eldoc))
(eval-after-load 'etags '(require 'drupal/etags))
(eval-after-load 'gtags '(require 'drupal/gtags))
+(eval-after-load 'gxref '(require 'drupal/gxref))
(eval-after-load 'helm-gtags '(require 'drupal/helm-gtags))
(eval-after-load 'ggtags '(require 'drupal/ggtags))
(eval-after-load 'ispell '(require 'drupal/ispell))
diff --git a/drupal-tests.el b/drupal-tests.el
index 2db847a..d690adb 100644
--- a/drupal-tests.el
+++ b/drupal-tests.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
diff --git a/drupal/autoinsert.el b/drupal/autoinsert.el
index 3a32ada..b22f181 100644
--- a/drupal/autoinsert.el
+++ b/drupal/autoinsert.el
@@ -1,6 +1,6 @@
;;; drupal/autoinsert.el --- Drupal-mode support for `auto-insert-mode'
-;; Copyright (C) 2012, 2013, 2014, 2015, 2016 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2014, 2015, 2016, 2020 Arne Jørgensen
;; Author: Arne Jørgensen
;; Keywords:
@@ -18,7 +18,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
@@ -26,12 +26,13 @@
;;; Code:
-(define-auto-insert '("\\.info" . "Drupal info file") 'drupal/autoinsert-insert-info-skeleton)
-(define-auto-insert '("\\.module" . "Drupal module file") 'drupal/autoinsert-insert-module-skeleton)
-(define-auto-insert '("\\.install" . "Drupal install file") 'drupal/autoinsert-insert-install-skeleton)
-(define-auto-insert '("\\.test" . "Drupal test file") 'drupal/autoinsert-insert-test-skeleton)
-(define-auto-insert '("\\.api.php" . "Drupal API file") 'drupal/autoinsert-insert-api-skeleton)
-(define-auto-insert '("\\.variable.inc" . "Drupal variable module support file") 'drupal/autoinsert-insert-variable-module-skeleton)
+(define-auto-insert '("\\.info\\'" . "Drupal info file") 'drupal/autoinsert-insert-info-skeleton)
+(define-auto-insert '("\\.info\\.yml\\'" . "Drupal info YML file") 'drupal/autoinsert-insert-info-yml-skeleton)
+(define-auto-insert '("\\.module\\'" . "Drupal module file") 'drupal/autoinsert-insert-module-skeleton)
+(define-auto-insert '("\\.install\\'" . "Drupal install file") 'drupal/autoinsert-insert-install-skeleton)
+(define-auto-insert '("\\.test\\'" . "Drupal test file") 'drupal/autoinsert-insert-test-skeleton)
+(define-auto-insert '("\\.api\\.php\\'" . "Drupal API file") 'drupal/autoinsert-insert-api-skeleton)
+(define-auto-insert '("\\.variable.inc\\'" . "Drupal variable module support file") 'drupal/autoinsert-insert-variable-module-skeleton)
(define-skeleton drupal/autoinsert-insert-info-skeleton
"Drupal info file skeleton."
@@ -51,6 +52,16 @@
(when v2 "; required = ") & @ (when v2 "TRUE\n")
(when v2 "; hidden = ") & @ (when v2 "TRUE\n"))
+(define-skeleton drupal/autoinsert-insert-info-yml-skeleton
+ "Drupal 8 info.yml file skeleton."
+ nil
+ '(setq v1 (file-name-nondirectory (file-name-sans-extension (file-name-sans-extension (or buffer-file-name (buffer-name))))))
+ '(setq v2 (if (string= (drupal-major-version) "8") "^8 || ^9" (concat "^" (drupal-major-version))))
+ "name: " @ - (upcase-initials (replace-regexp-in-string "[-_\\.]+" " " v1)) \n
+ "description: " @ (replace-regexp-in-string "[-_\\.]+" " " v1) \n
+ "type: module" @ \n
+ "core_version_requirement: " @ v2 "\n")
+
(define-skeleton drupal/autoinsert-insert-module-skeleton
"Drupal module file skeleton."
nil
diff --git a/drupal/eldoc.el b/drupal/eldoc.el
index ed0f4e7..18e2917 100644
--- a/drupal/eldoc.el
+++ b/drupal/eldoc.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
diff --git a/drupal/emacs-drush.el b/drupal/emacs-drush.el
index ec5a30f..7e6c1da 100644
--- a/drupal/emacs-drush.el
+++ b/drupal/emacs-drush.el
@@ -1,6 +1,6 @@
;;; drupal/emacs-drush.el --- Drupal-mode support for Drush utilities for Emacs users
-;; Copyright (C) 2012, 2013, 2015 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2015, 2020 Arne Jørgensen
;; Author: Arne Jørgensen
@@ -17,12 +17,12 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
;; You need to install `Drush utilities for Emacs users'
-;; for this to work.
+;; for this to work.
;; If `Drush utilities for Emacs users' is installed it will run
;; `drush etags' on `after-save-hook' if a TAGS file is present in
@@ -43,7 +43,7 @@ Requires `Drush utilities for Emacs users' to be installed."
:type `(choice
(const :tag "Yes" t)
(const :tag "No" nil))
- :link '(url-link :tag "Drush utilities for Emacs users" "https://drupal.org/project/emacs_drush")
+ :link '(url-link :tag "Drush utilities for Emacs users" "https://www.drupal.org/project/emacs_drush")
:group 'drupal)
(defun drupal/emacs-drush-run-after-save ()
diff --git a/drupal/etags.el b/drupal/etags.el
index d502b45..9310105 100644
--- a/drupal/etags.el
+++ b/drupal/etags.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
diff --git a/drupal/flycheck.el b/drupal/flycheck.el
index 42b2252..b488323 100644
--- a/drupal/flycheck.el
+++ b/drupal/flycheck.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
@@ -48,7 +48,7 @@
The Drupal standard includes checks for non-PHP files, this
checker runs those.
-See URL `http://pear.php.net/package/PHP_CodeSniffer/'."
+See URL `https://pear.php.net/package/PHP_CodeSniffer/'."
:command ("phpcs" "--report=checkstyle"
(option "--standard=" flycheck-phpcs-standard concat)
;; Pass original file name to phpcs. We need to concat explicitly
diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index 49b15c8..ef35961 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -1,6 +1,6 @@
;;; drupal/flymake-phpcs.el --- Drupal-mode support for flymake-phpcs
-;; Copyright (C) 2012, 2013, 2014 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2014, 2020 Arne Jørgensen
;; Author: Arne Jørgensen
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
@@ -57,7 +57,7 @@ file (and thus on the remote machine), or in the same place as
(const :tag "No" nil)
(const :tag "Auto" auto)
(const :tag "Default" default))
- :link '(url-link :tag "Drupal Coder Sniffer" "https://drupal.org/project/coder")
+ :link '(url-link :tag "Drupal Coder Sniffer" "https://www.drupal.org/project/coder")
:group 'drupal))
(defun drupal/flymake-phpcs-enable ()
diff --git a/drupal/ggtags.el b/drupal/ggtags.el
index bbb0c34..3e31024 100644
--- a/drupal/ggtags.el
+++ b/drupal/ggtags.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
diff --git a/drupal/gtags.el b/drupal/gtags.el
index 9e67276..6d451ec 100644
--- a/drupal/gtags.el
+++ b/drupal/gtags.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
diff --git a/drupal/gxref.el b/drupal/gxref.el
new file mode 100644
index 0000000..07cdf1c
--- /dev/null
+++ b/drupal/gxref.el
@@ -0,0 +1,69 @@
+;;; drupal/gxref.el --- Drupal-mode support for gxref
+
+;; Copyright (C) 2012, 2013, 2014, 2016, 2017 Arne Jørgensen
+
+;; Author: Arne Jørgensen
+
+;; This file is part of Drupal mode.
+
+;; Drupal mode 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.
+
+;; Drupal mode 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 Drupal mode. If not, see .
+
+;;; Commentary:
+
+;; Enable drupal-mode support for gxref.
+
+;; You must have enabled gxref for this to take effect:
+
+;; (require 'gxref)
+;; (add-to-list 'xref-backend-functions 'gxref-xref-backend)
+
+;;; Code:
+
+(defvar drupal/gxref-global-command (if (boundp 'gxref-global-exe)
+ gxref-global-exe
+ (executable-find "global"))
+ "Name of the GNU GLOBAL `global' executable.
+Include path to the executable if it is not in your $PATH.")
+
+(defun drupal/gxref-enable ()
+ "Setup gxref for use in `drupal-mode'."
+ ;; We only setup in PHP modes for now.
+ (when (apply 'derived-mode-p drupal-php-modes)
+ ;; Setting the label is safe no matter whether we use gxref or not.
+ (set (make-local-variable 'gxref-gtags-label) "drupal")
+
+ ;; Only set symbol collection and function args getter if we think
+ ;; the user actually uses gxref (that is the user added
+ ;; `gxref-xref-backend' to `xref-backend-functions')
+ (when (and (boundp 'xref-backend-functions)
+ (memq 'gxref-xref-backend xref-backend-functions))
+ (setq drupal-symbol-collection #'(lambda ()
+ (xref-backend-identifier-completion-table (xref-find-backend))))
+ (setq drupal-get-function-args #'drupal/gxref-get-function-args))))
+
+(defun drupal/gxref-get-function-args (symbol &optional version)
+ "Get function arguments for SYMBOL from GNU GLOBAL.
+Optional argument VERSION is ignored."
+ (ignore-errors
+ (let* ((line (car (gxref--find-symbol symbol)))
+ (string (xref-item-summary line)))
+ (string-match "(\\(.*\\))" string)
+ (match-string-no-properties 1 string))))
+
+(add-hook 'drupal-mode-hook #'drupal/gxref-enable)
+
+
+
+(provide 'drupal/gxref)
+;;; drupal/gxref.el ends here
diff --git a/drupal/helm-gtags.el b/drupal/helm-gtags.el
index 8f74bd0..6c8dccf 100644
--- a/drupal/helm-gtags.el
+++ b/drupal/helm-gtags.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
diff --git a/drupal/ispell.el b/drupal/ispell.el
index 7f7ea05..719500a 100644
--- a/drupal/ispell.el
+++ b/drupal/ispell.el
@@ -1,6 +1,6 @@
;;; drupal/ispell.el --- Drupal-mode support for ispell
-;; Copyright (C) 2012, 2013 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2020 Arne Jørgensen
;; Author: Arne Jørgensen
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
@@ -30,7 +30,7 @@
(defun drupal/ispell-enable ()
"Set `ispell-local-dictionary' to `american'.
Comments and names should use US English spelling (e.g., `color'
-not `colour') according to https://drupal.org/coding-standards."
+not `colour') according to https://www.drupal.org/coding-standards."
(when (member "american" (ispell-valid-dictionary-list))
(setq ispell-local-dictionary "american")))
diff --git a/drupal/pcomplete.el b/drupal/pcomplete.el
index a1ffca2..c5631cd 100644
--- a/drupal/pcomplete.el
+++ b/drupal/pcomplete.el
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
diff --git a/drupal/phpcs.el b/drupal/phpcs.el
index 4dd4cbb..6d35a9b 100644
--- a/drupal/phpcs.el
+++ b/drupal/phpcs.el
@@ -1,6 +1,6 @@
;;; drupal/phpcs.el --- Drupal-mode common support for flymake-phpcs and flycheck
-;; Copyright (C) 2012, 2013, 2016 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2016, 2020 Arne Jørgensen
;; Author: Arne Jørgensen
@@ -17,7 +17,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
@@ -43,7 +43,7 @@ This can either be the name of an installed standard (to see
installed standards run `phpcs -i') or it can be the file name of
a standard. Adding file name requires PHP CodeSniffer version
1.3.4 or newer."
- :link '(url-link :tag "Drupal Coder Sniffer" "https://drupal.org/node/1419980")
+ :link '(url-link :tag "Drupal Coder Sniffer" "https://www.drupal.org/node/1419980")
:group 'drupal)
diff --git a/drupal/webjump.el b/drupal/webjump.el
index 4fc10dd..76a7c96 100644
--- a/drupal/webjump.el
+++ b/drupal/webjump.el
@@ -1,6 +1,6 @@
;;; drupal/webjump.el --- Drupal projects as webjump sites
-;; Copyright (C) 2012, 2013 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2019 Arne Jørgensen
;; Author: Arne Jørgensen
@@ -16,7 +16,7 @@
;; You should have received a copy of the GNU General Public License
;; along with Drupal mode. If not, see
-;; .
+;; .
;;; Commentary:
@@ -26,7 +26,7 @@
(require 'webjump)
-(add-to-list 'webjump-sites '("Drupal" . [simple-query "drupal.org" "https://drupal.org/project/" ""]))
+(add-to-list 'webjump-sites '("Drupal" . [simple-query "drupal.org" "https://www.drupal.org/project/" ""]))
diff --git a/drush-make-mode.el b/drush-make-mode.el
index 0d7c3bb..3181a66 100644
--- a/drush-make-mode.el
+++ b/drush-make-mode.el
@@ -1,6 +1,6 @@
;;; drush-make-mode.el --- Major mode for drush make files
-;; Copyright (C) 2013, 2014 Arne Jørgensen
+;; Copyright (C) 2013, 2014, 2020 Arne Jørgensen
;; Author: Arne Jørgensen
;; Keywords: languages, tools, extensions
@@ -18,7 +18,7 @@
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with Drupal mode. If not, see .
+;; along with Drupal mode. If not, see .
;;; Commentary:
@@ -35,7 +35,7 @@
:group 'drupal
;; Use `bug-reference-mode' for linking issues and patches.
- (set (make-local-variable 'bug-reference-url-format) "http://drupal.org/node/%s")
+ (set (make-local-variable 'bug-reference-url-format) "https://www.drupal.org/node/%s")
(set (make-local-variable 'bug-reference-bug-regexp) "\\(?:\\#\\(?2:[0-9]+\\)\\|\\[['\"]?\\(?2:[0-9]+\\)\\([^0-9].*\\)?\\(['\"]?\\]\\)\\)")
(bug-reference-mode)