Skip to content

Remove pkg-info dependency #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions elixir-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
;; Created: Mon Nov 7 2011
;; Keywords: languages elixir
;; Version: 2.4.0
;; Package-Requires: ((emacs "25") (pkg-info "0.6"))
;; Package-Requires: ((emacs "25"))

;; This file is not a part of GNU Emacs.

Expand All @@ -38,7 +38,6 @@

(require 'easymenu) ; Elixir Mode menu definition
(require 'elixir-smie) ; Syntax and indentation support
(require 'pkg-info) ; Display Elixir Mode package version
(require 'elixir-format) ; Elixir Format functions

(defgroup elixir nil
Expand Down Expand Up @@ -464,6 +463,19 @@ is used to limit the scan."
(interactive)
(browse-url elixir-mode-doc-url))

(defconst elixir--version
(eval-when-compile
(require 'lisp-mnt)
(let ((file (or byte-compile-current-file
load-file-name
(buffer-file-name))))
(if file
(with-temp-buffer
(insert-file-contents file)
(lm-version))
"Unknown")))
"The current version of `elixir-mode'.")

;;;###autoload
(defun elixir-mode-version (&optional show-version)
"Get the Elixir-Mode version as string.
Expand All @@ -478,10 +490,9 @@ If the version number could not be determined, signal an error,
if called interactively, or if SHOW-VERSION is non-nil, otherwise
just return nil."
(interactive (list t))
(let ((version (pkg-info-version-info 'elixir-mode)))
(when show-version
(message "Elixir-Mode version: %s" version))
version))
(when show-version
(message "Elixir-Mode version: %s" elixir--version))
elixir--version)

(defun elixir-mode-fill-doc-string ()
(interactive)
Expand Down