Add function to retrieve library version
This could come in handy when checking for necessary library versions.
This commit is contained in:
parent
cac41d0759
commit
242d5cbcba
3
init.el
3
init.el
|
@ -612,7 +612,8 @@
|
|||
db/replace-variables-in-string
|
||||
db/dired-ediff-files
|
||||
db/grep-read-files
|
||||
db/make-selector-from-table-header))
|
||||
db/make-selector-from-table-header
|
||||
db/get-library-version))
|
||||
|
||||
(use-package db-hydras
|
||||
:commands (hydra-toggle/body
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
(autoload 'async-start "async")
|
||||
(autoload 'lispy-mode "lispy")
|
||||
(autoload 'ldap-search "ldap")
|
||||
(autoload 'find-libary-name "find-func")
|
||||
(autoload 'lm-header "lisp-mnt")
|
||||
|
||||
(declare-function w32-shell-execute "w32fns.c")
|
||||
|
||||
|
@ -606,6 +608,14 @@ duplicates when elements are considered as symbols."
|
|||
(nth idx row)
|
||||
(user-error "Unknow column name %s" column)))))))
|
||||
|
||||
(defun db/get-library-version (library)
|
||||
;; From bbatsov: https://emacs.stackexchange.com/a/69923
|
||||
"Return a version string for LIBRARY."
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (find-library-name library))
|
||||
(or (lm-header "package-version")
|
||||
(lm-header "version"))))
|
||||
|
||||
|
||||
;;; Base45 Decoding
|
||||
|
||||
|
|
Loading…
Reference in New Issue