Skip to content

Commit

Permalink
Merge pull request #87 from CyberShadow/emacs-24-plus
Browse files Browse the repository at this point in the history
Drop support for Emacs < 24.3
  • Loading branch information
CyberShadow committed Apr 9, 2018
2 parents 8d0ed04 + 8cf1ec5 commit 09745ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

An Emacs major mode for editing D code.

This mode is currently known to work with Emacs 24 and 25, and believed to work with Emacs 23.
This mode is currently known to work with Emacs 24 and 25.

The best way of installing this major mode, at least for Emacs 24, is to use the packaging system. Add MELPA
or MELPA Stable to the list of repositories to access this mode. For those who want only formal, tagged
Expand Down
23 changes: 11 additions & 12 deletions d-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
;; Maintainer: Russel Winder <russel@winder.org.uk>
;; Vladimir Panteleev <vladimir@thecybershadow.net>
;; Created: March 2007
;; Version: 201802141931
;; Version: 201804041719
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "24.3"))

;;;; NB Version number is date and time yyyymmddhhMM UTC.
;;;; A hook to update it automatically on save is available here:
Expand Down Expand Up @@ -77,11 +78,13 @@
;; "Symbol's value as variable is void: compilation-error-regexp-alist-alist" errors
(require 'compile)

;; Work around Emacs (cc-mode) bug #18845
(eval-when-compile
(when (and (= emacs-major-version 24) (>= emacs-minor-version 4))
(require 'cl)))

;; The set-difference function is used from the Common Lisp extensions.
;; Note that this line produces a compilation warning in Emacs 24 and newer,
;; however the replacement (cl-seq.el for our use case) was introduced
;; in the same major version.
(require 'cl)
(require 'cl-lib)

;; Used to specify regular expressions in a sane way.
(require 'rx)
Expand Down Expand Up @@ -171,8 +174,8 @@ operators."

(c-lang-defconst c-block-prefix-disallowed-chars
;; Allow ':' for inherit list starters.
d (set-difference (c-lang-const c-block-prefix-disallowed-chars)
'(?:)))
d (cl-set-difference (c-lang-const c-block-prefix-disallowed-chars)
'(?:)))

(defconst doxygen-font-lock-doc-comments
(let ((symbol "[a-zA-Z0-9_]+")
Expand Down Expand Up @@ -715,12 +718,8 @@ The expression is added to `compilation-error-regexp-alist' and
:type 'hook
:group 'c)

;; For compatibility with Emacs < 24
(defalias 'd-parent-mode
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))

;;;###autoload
(define-derived-mode d-mode d-parent-mode "D"
(define-derived-mode d-mode prog-mode "D"
"Major mode for editing code written in the D Programming Language.
See http://dlang.org for more information about the D language.
Expand Down

0 comments on commit 09745ba

Please sign in to comment.