Skip to content

Commit e58d967

Browse files
authored
Merge pull request #81 from arnested/misc-fixes-02-2020
Misc fixes 02 2020
2 parents ee53f9e + cca428d commit e58d967

File tree

8 files changed

+64
-62
lines changed

8 files changed

+64
-62
lines changed

.travis.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
language: emacs-lisp
22
before_install:
3-
- curl -fsSkL https://gist.githubusercontent.com/rejeep/7736123/raw | sh
4-
- export PATH="/home/travis/.cask/bin:$PATH"
5-
- export PATH="/home/travis/.evm/bin:$PATH"
6-
- evm install $EVM_EMACS --use
7-
- cask
3+
- git clone https://github.com/rejeep/evm.git $HOME/.evm
4+
- export PATH=$HOME/.cask/bin:$HOME/.evm/bin:$PATH
5+
- evm config path /tmp
6+
- evm install $EVM_EMACS --use --skip
7+
- curl -fsSkL https://raw.github.com/cask/cask/master/go | python
88
env:
9-
- EVM_EMACS=emacs-24.1-bin
10-
- EVM_EMACS=emacs-24.2-bin
11-
- EVM_EMACS=emacs-24.4-bin
12-
- EVM_EMACS=emacs-24.5-bin
9+
- EVM_EMACS=emacs-25.3-travis
10+
- EVM_EMACS=emacs-26.3-travis-linux-xenial
11+
- EVM_EMACS=emacs-git-snapshot-travis-linux-xenial
1312
script:
1413
- emacs --version
1514
- make test

Cask

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(package-file "drupal-mode.el")
22

3-
(source marmalade)
3+
(source melpa)

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is part of Drupal mode.
22

3-
# Copyright (C) 2012, 2013 Arne Jørgensen
3+
# Copyright (C) 2012, 2013, 2020 Arne Jørgensen
44

55
# Author: Arne Jørgensen <arne@arnested.dk>
66

@@ -42,9 +42,9 @@ README: README.md
4242
$(PANDOC) -t plain -o $@ $^
4343

4444
$(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
45-
$(CASK) package
45+
$(CASK) pkg-file
4646

47-
# create a tar ball in package.el format for uploading to http://marmalade-repo.org
47+
# create a tar ball in package.el format
4848
$(PACKAGE_NAME).tar: README $(ARCHIVE_NAME).el $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME).info dir drupal/*.el drupal-tests.el drush-make-mode.el
4949
$(TAR) -c -s "@^@$(PACKAGE_NAME)/@" -f $(PACKAGE_NAME).tar $^
5050

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,25 @@ below) and depend on a few through the packaging system
3232
## Installation
3333

3434
The easiest way to install Drupal mode is probably to install it via
35-
the ELPA archive at
36-
[Marmalade](http://marmalade-repo.org/packages/drupal-mode) or
37-
[MELPA Stable](http://stable.melpa.org/#/drupal-mode) (if you want
38-
bleeding edge use regular [MELPA](http://melpa.org/#/drupal-mode)).
39-
40-
ELPA (package.el) is part of Emacs 24. For Emacs 23 see
41-
[Marmalade](http://marmalade-repo.org) for installation instructions.
35+
the ELPA archive [MELPA
36+
Stable](https://stable.melpa.org/#/drupal-mode) (if you want bleeding
37+
edge use regular [MELPA](https://melpa.org/#/drupal-mode)).
4238

4339

4440
## Features of Drupal mode
4541

4642
### Drupal Coding Standards
4743

4844
Drupal mode will make you write code that adheres to
49-
[Drupals coding standards](http://drupal.org/coding-standards#indenting).
45+
[Drupals coding standards](https://www.drupal.org/coding-standards).
5046

5147
It does this by:
5248

5349

5450
#### Indentation
5551

5652
In php-mode code will be indented according to
57-
[Drupals coding standards](http://drupal.org/coding-standards#indenting). If not
53+
[Drupals coding standards](https://drupal.org/coding-standards). If not
5854
it is considered a bug!
5955

6056

@@ -91,10 +87,10 @@ menu entry.
9187

9288
Files that are part of a Drupal project will try to identify the used
9389
version of Drupal core and look up the documentation for the
94-
corresponding version at http://api.drupal.org.
90+
corresponding version at https://api.drupal.org.
9591

9692
If the symbol at point is believed to be a Drush command the
97-
documentation will be looked up at http://api.drush.org instead. If
93+
documentation will be looked up at https://api.drush.org instead. If
9894
Drush is installed it will identify the version of Drush and look up
9995
the documentation for the installed version of Drush.
10096

@@ -131,15 +127,15 @@ Etags is a built-in part of Emacs.
131127

132128
### GNU Globals / gtags
133129

134-
If you load [GNU Globals / gtags](http://www.gnu.org/software/global/)
130+
If you load [GNU Globals / gtags](https://www.gnu.org/software/global/)
135131
support in Emacs then Drupal mode will set `gtags-rootdir` to your
136132
DRUPAL_ROOT.
137133

138134

139135
### Drush utilities for Emacs users
140136

141137
If
142-
[Drush utilities for Emacs users](http://drupal.org/project/emacs_drush)
138+
[Drush utilities for Emacs users](https://www.drupal.org/project/emacs_drush)
143139
is installed Drupal mode will update existing tag files in your
144140
DRUPAL_ROOT after saving a buffer.
145141

@@ -148,11 +144,11 @@ DRUPAL_ROOT after saving a buffer.
148144

149145
If ispell.el is loaded in Emacs then Drupal mode will set the language
150146
of your Drupal mode buffers to `american` as stated in [Drupals coding
151-
standards](http://drupal.org/coding-standards).
147+
standards](https://www.drupal.org/coding-standards).
152148

153149
ispell.el is a built-in part of Emacs. An external program must be
154150
installed to run the actual spell checking,
155-
i.e. [ispell](http://www.gnu.org/software/ispell/),
151+
i.e. [ispell](https://www.gnu.org/software/ispell/),
156152
[aspell](http://aspell.net/), or
157153
[hunspell](http://hunspell.sourceforge.net/).
158154

@@ -162,14 +158,14 @@ i.e. [ispell](http://www.gnu.org/software/ispell/),
162158
If support for
163159
[flymake-phpcs.el](https://github.com/illusori/emacs-flymake-phpcs) is
164160
loaded in Emacs and you have installed
165-
[Drupal Code Sniffer](http://drupal.org/project/drupalcs) rules then
161+
[Drupal Code Sniffer](https://www.drupal.org/project/drupalcs) rules then
166162
Drupal mode will enable flymake-phpcs under php-mode.
167163

168164
For this to work you need:
169165

170-
* [PHP CodeSniffer](http://pear.php.net/package/PHP_CodeSniffer)
171-
* [flymake-phpcs.el](http://marmalade-repo.org/packages/flymake-phpcs)
172-
* [Drupal Code Sniffer](http://drupal.org/project/drupalcs) rules
166+
* [PHP CodeSniffer](https://pear.php.net/package/PHP_CodeSniffer)
167+
* [flymake-phpcs.el](https://melpa.org/#/flymake-phpcs)
168+
* [Drupal Code Sniffer](https://drupal.org/project/drupalcs) rules
173169

174170

175171
## Other takes on a Drupal mode
@@ -179,11 +175,11 @@ wild:
179175

180176
* [Search Github for drupal-mode](https://github.com/search?l=Emacs+Lisp&q=drupal&type=Repositories)
181177
* At drupal.org:
182-
* http://drupal.org/sandbox/bartlantz/1405156
183-
* http://drupal.org/project/emacs
178+
* https://www.drupal.org/sandbox/bartlantz/1405156
179+
* https://www.drupal.org/project/emacs
184180

185181
All of them more or less based on
186-
[Configuring Emacs](http://drupal.org/node/59868).
182+
[Configuring Emacs](https://www.drupal.org/node/59868).
187183

188184

189185
## Development of Drupal mode

drupal-mode.el

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; drupal-mode.el --- Advanced minor mode for Drupal development
22

3-
;; Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017 Arne Jørgensen
3+
;; Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2020 Arne Jørgensen
44

55
;; Author: Arne Jørgensen <arne@arnested.dk>
66
;; URL: https://github.com/arnested/drupal-mode
@@ -96,15 +96,13 @@ whitespace at the end."
9696
:group 'drupal)
9797

9898

99-
(defcustom drupal-search-url "http://api.drupal.org/api/search/%v/%s"
99+
(defcustom drupal-search-url "https://api.drupal.org/api/search/%v/%s"
100100
"The URL to search the Drupal API.
101101
%v is the Drupal major version.
102102
%s is the search term."
103-
:type '(choice (const :tag "Api.drupal.org" "http://api.drupal.org/api/search/%v/%s")
104-
(const :tag "Drupalcontrib.org" "http://drupalcontrib.org/api/search/%v/%s")
105-
(string :tag "Other" "http://example.com/api/search/%v/%s"))
106-
:link '(url-link :tag "api.drupalcontrib.org" "http://api.drupalcontrib.org")
107-
:link '(url-link :tag "api.drupal.org" "http://api.drupal.org")
103+
:type '(choice (const :tag "Api.drupal.org" "https://api.drupal.org/api/search/%v/%s")
104+
(string :tag "Other" "https://example.com/api/search/%v/%s"))
105+
:link '(url-link :tag "api.drupal.org" "https://api.drupal.org")
108106
:group 'drupal)
109107

110108
;;;###autoload
@@ -161,7 +159,7 @@ Include path to the executable if it is not in your $PATH."
161159
:group 'drupal)
162160

163161
;;;###autoload
164-
(defcustom drupal-info-modes (list 'conf-windows-mode)
162+
(defcustom drupal-info-modes (list 'conf-windows-mode 'yaml-mode)
165163
"Major modes to consider info files in Drupal mode."
166164
:type '(repeat symbol)
167165
:group 'drupal)
@@ -333,8 +331,7 @@ function arguments.")
333331
(indent-tabs-mode . nil)
334332
(require-final-newline . t)
335333
(c-offsets-alist . ((arglist-close . 0)
336-
(arglist-cont-nonempty . c-lineup-math)
337-
(arglist-intro . +)
334+
(arglist-cont-nonempty . 0)
338335
(statement-cont . +)))
339336
(c-doc-comment-style . (php-mode . javadoc))
340337
(c-label-minimum-indentation . 1)
@@ -809,13 +806,12 @@ older implementation of `locate-dominating-file'."
809806
(let ((prev-user user))
810807
(setq user (nth 2 (file-attributes dir)))
811808
(or (null prev-user) (equal user prev-user))))
812-
(if (and (setq files (condition-case nil
813-
(directory-files dir 'full "\\(.+\\)\\.info\\'" 'nosort)
814-
(error nil)))
815-
(file-exists-p (concat (file-name-sans-extension (car files)) ".module")))
809+
(if (setq files (condition-case nil
810+
(directory-files dir 'full "\\(.+\\)\\.info\\(\\.yml\\)\\'" 'nosort)
811+
(error nil)))
816812
(if info-file-location
817813
(throw 'found (car files))
818-
(throw 'found (file-name-nondirectory (file-name-sans-extension (car files)))))
814+
(throw 'found (file-name-nondirectory (file-name-sans-extension(file-name-sans-extension (car files))))))
819815
(if (equal dir
820816
(setq dir (file-name-directory
821817
(directory-file-name dir))))
@@ -834,7 +830,7 @@ Used in `drupal-insert-hook' and `drupal-insert-function'."
834830
drupal-module
835831
;; Otherwise fall back to a very naive
836832
;; way of guessing the module name.
837-
(file-name-nondirectory (file-name-sans-extension (or buffer-file-name (buffer-name))))))))
833+
(file-name-nondirectory (file-name-sans-extension (file-name-sans-extension (or buffer-file-name (buffer-name)))))))))
838834
(if (called-interactively-p 'any)
839835
(insert name)
840836
name)))

drupal/autoinsert.el

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; drupal/autoinsert.el --- Drupal-mode support for `auto-insert-mode'
22

3-
;; Copyright (C) 2012, 2013, 2014, 2015, 2016 Arne Jørgensen
3+
;; Copyright (C) 2012, 2013, 2014, 2015, 2016, 2020 Arne Jørgensen
44

55
;; Author: Arne Jørgensen <arne@arnested.dk>
66
;; Keywords:
@@ -26,12 +26,13 @@
2626

2727
;;; Code:
2828

29-
(define-auto-insert '("\\.info" . "Drupal info file") 'drupal/autoinsert-insert-info-skeleton)
30-
(define-auto-insert '("\\.module" . "Drupal module file") 'drupal/autoinsert-insert-module-skeleton)
31-
(define-auto-insert '("\\.install" . "Drupal install file") 'drupal/autoinsert-insert-install-skeleton)
32-
(define-auto-insert '("\\.test" . "Drupal test file") 'drupal/autoinsert-insert-test-skeleton)
33-
(define-auto-insert '("\\.api.php" . "Drupal API file") 'drupal/autoinsert-insert-api-skeleton)
34-
(define-auto-insert '("\\.variable.inc" . "Drupal variable module support file") 'drupal/autoinsert-insert-variable-module-skeleton)
29+
(define-auto-insert '("\\.info\\'" . "Drupal info file") 'drupal/autoinsert-insert-info-skeleton)
30+
(define-auto-insert '("\\.info\\.yml\\'" . "Drupal info YML file") 'drupal/autoinsert-insert-info-yml-skeleton)
31+
(define-auto-insert '("\\.module\\'" . "Drupal module file") 'drupal/autoinsert-insert-module-skeleton)
32+
(define-auto-insert '("\\.install\\'" . "Drupal install file") 'drupal/autoinsert-insert-install-skeleton)
33+
(define-auto-insert '("\\.test\\'" . "Drupal test file") 'drupal/autoinsert-insert-test-skeleton)
34+
(define-auto-insert '("\\.api\\.php\\'" . "Drupal API file") 'drupal/autoinsert-insert-api-skeleton)
35+
(define-auto-insert '("\\.variable.inc\\'" . "Drupal variable module support file") 'drupal/autoinsert-insert-variable-module-skeleton)
3536

3637
(define-skeleton drupal/autoinsert-insert-info-skeleton
3738
"Drupal info file skeleton."
@@ -51,6 +52,16 @@
5152
(when v2 "; required = ") & @ (when v2 "TRUE\n")
5253
(when v2 "; hidden = ") & @ (when v2 "TRUE\n"))
5354

55+
(define-skeleton drupal/autoinsert-insert-info-yml-skeleton
56+
"Drupal 8 info.yml file skeleton."
57+
nil
58+
'(setq v1 (file-name-nondirectory (file-name-sans-extension (file-name-sans-extension (or buffer-file-name (buffer-name))))))
59+
'(setq v2 (if (string= (drupal-major-version) "8") "^8 || ^9" (concat "^" (drupal-major-version))))
60+
"name: " @ - (upcase-initials (replace-regexp-in-string "[-_\\.]+" " " v1)) \n
61+
"description: " @ (replace-regexp-in-string "[-_\\.]+" " " v1) \n
62+
"type: module" @ \n
63+
"core_version_requirement: " @ v2 "\n")
64+
5465
(define-skeleton drupal/autoinsert-insert-module-skeleton
5566
"Drupal module file skeleton."
5667
nil

drupal/webjump.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; drupal/webjump.el --- Drupal projects as webjump sites
22

3-
;; Copyright (C) 2012, 2013 Arne Jørgensen
3+
;; Copyright (C) 2012, 2013, 2019 Arne Jørgensen
44

55
;; Author: Arne Jørgensen <arne@arnested.dk>
66

@@ -26,7 +26,7 @@
2626

2727
(require 'webjump)
2828

29-
(add-to-list 'webjump-sites '("Drupal" . [simple-query "drupal.org" "https://drupal.org/project/" ""]))
29+
(add-to-list 'webjump-sites '("Drupal" . [simple-query "drupal.org" "https://www.drupal.org/project/" ""]))
3030

3131

3232

drush-make-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; drush-make-mode.el --- Major mode for drush make files
22

3-
;; Copyright (C) 2013, 2014 Arne Jørgensen
3+
;; Copyright (C) 2013, 2014, 2020 Arne Jørgensen
44

55
;; Author: Arne Jørgensen <arne@arnested.dk>
66
;; Keywords: languages, tools, extensions
@@ -35,7 +35,7 @@
3535
:group 'drupal
3636

3737
;; Use `bug-reference-mode' for linking issues and patches.
38-
(set (make-local-variable 'bug-reference-url-format) "http://drupal.org/node/%s")
38+
(set (make-local-variable 'bug-reference-url-format) "https://www.drupal.org/node/%s")
3939
(set (make-local-variable 'bug-reference-bug-regexp) "\\(?:\\#\\(?2:[0-9]+\\)\\|\\[['\"]?\\(?2:[0-9]+\\)\\([^0-9].*\\)?\\(['\"]?\\]\\)\\)")
4040
(bug-reference-mode)
4141

0 commit comments

Comments
 (0)