From 9d793aa1121ab8b8abf57260721082e2666c6490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Mon, 20 Nov 2017 23:54:48 +0100 Subject: [PATCH 01/20] Add support for gxref/xref --- drupal-mode.el | 1 + drupal/gxref.el | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 drupal/gxref.el diff --git a/drupal-mode.el b/drupal-mode.el index 4c22434..0134975 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -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/gxref.el b/drupal/gxref.el new file mode 100644 index 0000000..61afe24 --- /dev/null +++ b/drupal/gxref.el @@ -0,0 +1,68 @@ +;;; 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." + (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 From 47fda0a38a5b197f4606137d9c3b7d44aaeaa886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Tue, 21 Nov 2017 00:09:18 +0100 Subject: [PATCH 02/20] Ignore errors in `drupal/gxref-get-function-args` `drupal/gxref-get-function-args` would throw an error if the symbol was not in the GTAGS file (because we assumed `xref-item-summary` would operate on an eieio object). Instead cluttering the code with even more checks we just ignore errors. --- drupal/gxref.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drupal/gxref.el b/drupal/gxref.el index 61afe24..5e0e42a 100644 --- a/drupal/gxref.el +++ b/drupal/gxref.el @@ -55,10 +55,11 @@ Include path to the executable if it is not in your $PATH.") (defun drupal/gxref-get-function-args (symbol &optional version) "Get function arguments for SYMBOL from GNU GLOBAL. Optional argument VERSION is ignored." - (let* ((line (car (gxref--find-symbol symbol))) - (string (xref-item-summary line))) - (string-match "(\\(.*\\))" string) - (match-string-no-properties 1 string))) + (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) From 95bf73b4b66d660390f5a807d5420fba1f4dedf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 9 Nov 2019 16:16:21 +0100 Subject: [PATCH 03/20] Create SECURITY.md --- SECURITY.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 SECURITY.md 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)). From ee53f9e12bb3a80d65876a005b3a5a8ae6c7ab59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 9 Nov 2019 16:16:41 +0100 Subject: [PATCH 04/20] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md 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 From ba80d4d5c8d0d6fe5609f8fb83d6ee33eec2cd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 8 Feb 2020 14:50:02 +0100 Subject: [PATCH 05/20] Remove drupalcontrib.com as search URL option --- drupal-mode.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drupal-mode.el b/drupal-mode.el index 0134975..af77a2a 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -1,6 +1,6 @@ ;;; 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 Arne Jørgensen ;; Author: Arne Jørgensen ;; URL: https://github.com/arnested/drupal-mode @@ -96,15 +96,13 @@ whitespace at the end." :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 From a8d3e30000055572ac2e117e38dd843857f2e2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 8 Feb 2020 14:51:32 +0100 Subject: [PATCH 06/20] Link to drupal.org using www prefix --- drupal/webjump.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drupal/webjump.el b/drupal/webjump.el index 4fc10dd..90c42cf 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 @@ -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/" ""])) From 3ce73dd22128f137c89cf51a3dbdc8dbb08fc068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 8 Feb 2020 15:05:22 +0100 Subject: [PATCH 07/20] Fix array member indentation in function calls ```php $foo = bar([ 'baz', ]); ``` ```php $foo = bar([ 'baz', ]); ``` --- drupal-mode.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drupal-mode.el b/drupal-mode.el index af77a2a..f77bf40 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -1,6 +1,6 @@ ;;; drupal-mode.el --- Advanced minor mode for Drupal development -;; Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2019 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 @@ -331,8 +331,7 @@ 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 . 0) (statement-cont . +))) (c-doc-comment-style . (php-mode . javadoc)) (c-label-minimum-indentation . 1) From 690f2c55922a3196f6a56874287386db71009219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 8 Feb 2020 15:13:10 +0100 Subject: [PATCH 08/20] Cleanup URLs in documentation --- Cask | 2 +- Makefile | 6 +++--- README.md | 40 ++++++++++++++++++---------------------- drush-make-mode.el | 4 ++-- 4 files changed, 24 insertions(+), 28 deletions(-) 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..3cc4c14 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 @@ -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..a183657 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://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://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/drush-make-mode.el b/drush-make-mode.el index 0d7c3bb..5bbe9a8 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 @@ -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) From 76c28888f76ccb7ef42c7c0e79ba9bdc89f3c931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 8 Feb 2020 16:35:18 +0100 Subject: [PATCH 09/20] Adjust buffer name patterns for autoinsert Fixes #77. --- drupal/autoinsert.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drupal/autoinsert.el b/drupal/autoinsert.el index 3a32ada..fb2cfdf 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: @@ -26,12 +26,12 @@ ;;; 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 '("\\.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." From dc82e5430c532be482b8fdf8986cbc6e1a500ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 8 Feb 2020 16:36:01 +0100 Subject: [PATCH 10/20] Handle .info.yml files --- drupal-mode.el | 13 ++++++------- drupal/autoinsert.el | 11 +++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/drupal-mode.el b/drupal-mode.el index f77bf40..fdc564d 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -159,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) @@ -806,13 +806,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)))) @@ -831,7 +830,7 @@ 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))) diff --git a/drupal/autoinsert.el b/drupal/autoinsert.el index fb2cfdf..e3cbc12 100644 --- a/drupal/autoinsert.el +++ b/drupal/autoinsert.el @@ -27,6 +27,7 @@ ;;; Code: (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) @@ -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 From cca428d723ebdbcb09013f46d637ee58d45ca0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 8 Feb 2020 18:56:14 +0100 Subject: [PATCH 11/20] Run tests on Emacs 25.3, 26.3, and snapshot --- .travis.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 68bb672..7b1c79b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +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 From 3e0ed63e4bf25b459ae08eb654c1597ec3ce58d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sun, 9 Feb 2020 10:52:48 +0100 Subject: [PATCH 12/20] Fix array member indentation in function calls - take 2 The fix in 3ce73dd22128f137c89cf51a3dbdc8dbb08fc068 didn't quite do it. It messed up indentation of stuff like: ```php $someObject = new SomeClass(); $otherObject= new OtherClass($someObject ->methodOne() ->methodTwo() ); ``` --- drupal-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drupal-mode.el b/drupal-mode.el index fdc564d..2765b76 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -331,7 +331,7 @@ function arguments.") (indent-tabs-mode . nil) (require-final-newline . t) (c-offsets-alist . ((arglist-close . 0) - (arglist-cont-nonempty . 0) + (arglist-cont-nonempty . php-lineup-arglist) (statement-cont . +))) (c-doc-comment-style . (php-mode . javadoc)) (c-label-minimum-indentation . 1) From efef28052919061d03cd3b25bc20bbb75d34ed3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sun, 9 Feb 2020 17:00:26 +0100 Subject: [PATCH 13/20] Fix some more drupal.org URL's --- README.md | 4 ++-- drupal-mode.el | 16 ++++++++-------- drupal/emacs-drush.el | 6 +++--- drupal/flymake-phpcs.el | 4 ++-- drupal/ispell.el | 4 ++-- drupal/phpcs.el | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index a183657..189ee7a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ It does this by: #### Indentation In php-mode code will be indented according to -[Drupals coding standards](https://drupal.org/coding-standards). If not +[Drupals coding standards](https://www.drupal.org/coding-standards). If not it is considered a bug! @@ -165,7 +165,7 @@ For this to work you need: * [PHP CodeSniffer](https://pear.php.net/package/PHP_CodeSniffer) * [flymake-phpcs.el](https://melpa.org/#/flymake-phpcs) -* [Drupal Code Sniffer](https://drupal.org/project/drupalcs) rules +* [Drupal Code Sniffer](https://www.drupal.org/project/drupalcs) rules ## Other takes on a Drupal mode diff --git a/drupal-mode.el b/drupal-mode.el index 2765b76..fd66cb0 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -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,7 +92,7 @@ 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) @@ -338,8 +338,8 @@ function arguments.") (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") :group 'drupal) (c-add-style "drupal" drupal-style) @@ -439,13 +439,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] '("--")) @@ -460,7 +460,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 diff --git a/drupal/emacs-drush.el b/drupal/emacs-drush.el index ec5a30f..1a402f4 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 @@ -22,7 +22,7 @@ ;;; 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/flymake-phpcs.el b/drupal/flymake-phpcs.el index 49b15c8..3217fef 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 @@ -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/ispell.el b/drupal/ispell.el index 7f7ea05..9056d8b 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 @@ -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/phpcs.el b/drupal/phpcs.el index 4dd4cbb..f8e190e 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 @@ -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) From a1c77dca8beb42835c69680bcc0fd48416c14096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sun, 9 Feb 2020 17:02:35 +0100 Subject: [PATCH 14/20] Prefer HTTPS URLs wherever we can --- COPYING | 8 ++++---- Makefile | 2 +- drupal-mode.el | 4 ++-- drupal-tests.el | 2 +- drupal/autoinsert.el | 2 +- drupal/eldoc.el | 2 +- drupal/emacs-drush.el | 2 +- drupal/etags.el | 2 +- drupal/flycheck.el | 4 ++-- drupal/flymake-phpcs.el | 2 +- drupal/ggtags.el | 2 +- drupal/gtags.el | 2 +- drupal/gxref.el | 2 +- drupal/helm-gtags.el | 2 +- drupal/ispell.el | 2 +- drupal/pcomplete.el | 2 +- drupal/phpcs.el | 2 +- drupal/webjump.el | 2 +- drush-make-mode.el | 2 +- 19 files changed, 24 insertions(+), 24 deletions(-) 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/Makefile b/Makefile index 3cc4c14..86d4bf0 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/drupal-mode.el b/drupal-mode.el index fd66cb0..9e8f7ab 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -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: @@ -114,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) 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 e3cbc12..b22f181 100644 --- a/drupal/autoinsert.el +++ b/drupal/autoinsert.el @@ -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: 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 1a402f4..7e6c1da 100644 --- a/drupal/emacs-drush.el +++ b/drupal/emacs-drush.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/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 3217fef..ef35961 100644 --- a/drupal/flymake-phpcs.el +++ b/drupal/flymake-phpcs.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/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 index 5e0e42a..07cdf1c 100644 --- a/drupal/gxref.el +++ b/drupal/gxref.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/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 9056d8b..719500a 100644 --- a/drupal/ispell.el +++ b/drupal/ispell.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/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 f8e190e..6d35a9b 100644 --- a/drupal/phpcs.el +++ b/drupal/phpcs.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/webjump.el b/drupal/webjump.el index 90c42cf..76a7c96 100644 --- a/drupal/webjump.el +++ b/drupal/webjump.el @@ -16,7 +16,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with Drupal mode. If not, see -;; . +;; . ;;; Commentary: diff --git a/drush-make-mode.el b/drush-make-mode.el index 5bbe9a8..3181a66 100644 --- a/drush-make-mode.el +++ b/drush-make-mode.el @@ -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: From ee1a24c96a7487bb9df8dd15656be7d8330028f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Mon, 10 Feb 2020 23:22:22 +0100 Subject: [PATCH 15/20] Make sure we get the actual module name even when having double extensions like .info.yml --- drupal-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drupal-mode.el b/drupal-mode.el index 9e8f7ab..0d7e82e 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -752,7 +752,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) From 4f3cffa76d8359449bf0e960f884320130f24b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Tue, 8 Dec 2020 19:36:29 +0100 Subject: [PATCH 16/20] Update .travis.yml --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b1c79b..dcd2450 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,3 @@ env: script: - emacs --version - make test -notifications: - webhooks: https://webhooks.gitter.im/e/fa0500ce49cab8dc8144 - on_success: change - on_failure: always - on_start: never From ed90b0c4d808365e9ae9f16cc8a96eff17815621 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 9 Jan 2022 18:16:56 +0100 Subject: [PATCH 17/20] Bump version to 0.7.4 --- drupal-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drupal-mode.el b/drupal-mode.el index 0d7e82e..f0ded77 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -5,7 +5,7 @@ ;; 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 From 53d6809d846fbe627a16186126c9749edbb3b598 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 9 Jan 2022 18:20:12 +0100 Subject: [PATCH 18/20] Fix #84: Use cl-lib instead of deprecated cl --- drupal-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drupal-mode.el b/drupal-mode.el index 0d7e82e..9daeb3d 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -33,7 +33,7 @@ ;;; Code: -(require 'cl) +(require 'cl-lib) (require 'php-mode) (require 'format-spec) (require 'json) @@ -539,7 +539,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)) @@ -835,7 +835,7 @@ Used in `drupal-insert-hook' and `drupal-insert-function'." (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'. From 5bc4170e871cd6ae0f6dc3d5ab466a8405721fb9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 9 Jan 2022 18:25:08 +0100 Subject: [PATCH 19/20] Fix byte-compiler warnings --- drupal-mode.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drupal-mode.el b/drupal-mode.el index 0d7e82e..c0d4e09 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -182,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) @@ -340,6 +343,7 @@ function arguments.") "Drupal coding style. 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) From 541a0c014aa1860855df5a8457192d7d9032daa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Fri, 16 Aug 2024 13:22:52 +0200 Subject: [PATCH 20/20] Fix c-basic-offset, indent-tabs-mode, and more php-mode is no longer based on c-mode, but php-base-mode (see https://github.com/emacs-php/php-mode/pull/772). This prevented the drupal style to be used. --- drupal-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drupal-mode.el b/drupal-mode.el index 07d91a9..83cb184 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -310,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"))