mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
ein:version: accept optional prefix arg to copy version to clipboard
This commit is contained in:
parent
82a832de1a
commit
25835fdce4
1 changed files with 5 additions and 2 deletions
|
@ -124,11 +124,12 @@ pair of TO-PYTHON and FROM-PYTHON."
|
||||||
(defun ein:default-url-or-port ()
|
(defun ein:default-url-or-port ()
|
||||||
(or ein:default-url-or-port (car ein:url-or-port) 8888))
|
(or ein:default-url-or-port (car ein:url-or-port) 8888))
|
||||||
|
|
||||||
(defun ein:version ()
|
(defun ein:version (&optional copy-to-kill)
|
||||||
"Return a longer version string.
|
"Return a longer version string.
|
||||||
|
With prefix argument, copy the string to kill ring.
|
||||||
The result contains `ein:version' and either git revision (if
|
The result contains `ein:version' and either git revision (if
|
||||||
the source is in git repository) or elpa version."
|
the source is in git repository) or elpa version."
|
||||||
(interactive)
|
(interactive "P")
|
||||||
(let* ((suffix ; git or elpa
|
(let* ((suffix ; git or elpa
|
||||||
(or (and (ein:git-root-p
|
(or (and (ein:git-root-p
|
||||||
(concat (file-name-as-directory ein:source-dir) ".."))
|
(concat (file-name-as-directory ein:source-dir) ".."))
|
||||||
|
@ -139,6 +140,8 @@ the source is in git repository) or elpa version."
|
||||||
(version (if suffix (concat ein:version "-" suffix) ein:version)))
|
(version (if suffix (concat ein:version "-" suffix) ein:version)))
|
||||||
(when (called-interactively-p 'interactive)
|
(when (called-interactively-p 'interactive)
|
||||||
(message "EIN version is %s" version))
|
(message "EIN version is %s" version))
|
||||||
|
(when copy-to-kill
|
||||||
|
(kill-new version))
|
||||||
version))
|
version))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue