[Emacs] Reformat init.el org use-package
This commit is contained in:
parent
0907711ab4
commit
6cb0ecd796
@ -27,32 +27,33 @@
|
|||||||
;; Without this, org can behave very strangely
|
;; Without this, org can behave very strangely
|
||||||
(use-package org
|
(use-package org
|
||||||
:init
|
:init
|
||||||
;; Taken from https://github.com/raxod502/radian/blob/master/radian-emacs/radian-org.el
|
(progn
|
||||||
(defun radian--org-git-version ()
|
;; Taken from https://github.com/raxod502/radian/blob/master/radian-emacs/radian-org.el
|
||||||
"Return the abbreviated SHA for the Org Git repo."
|
(defun radian--org-git-version ()
|
||||||
(let ((default-directory (concat user-emacs-directory
|
"Return the abbreviated SHA for the Org Git repo."
|
||||||
"straight/repos/org/")))
|
(let ((default-directory (concat user-emacs-directory
|
||||||
(if (executable-find "git")
|
"straight/repos/org/")))
|
||||||
(with-temp-buffer
|
(if (executable-find "git")
|
||||||
;; Returns the shortest prefix of the SHA for HEAD that is
|
(with-temp-buffer
|
||||||
;; unique, down to a minimum of 4 characters (see
|
;; Returns the shortest prefix of the SHA for HEAD that is
|
||||||
;; git-rev-parse(1)).
|
;; unique, down to a minimum of 4 characters (see
|
||||||
(call-process "git" nil '(t nil) nil
|
;; git-rev-parse(1)).
|
||||||
"rev-parse" "--short" "HEAD")
|
(call-process "git" nil '(t nil) nil
|
||||||
(if (> (buffer-size) 0)
|
"rev-parse" "--short" "HEAD")
|
||||||
(string-trim (buffer-string))
|
(if (> (buffer-size) 0)
|
||||||
;; This shouldn't happen, unless somehow Org is not
|
(string-trim (buffer-string))
|
||||||
;; actually a Git repo.
|
;; This shouldn't happen, unless somehow Org is not
|
||||||
"revision unknown"))
|
;; actually a Git repo.
|
||||||
;; This also shouldn't happen, because how would you have
|
"revision unknown"))
|
||||||
;; gotten Org in the first place, then? But the real world
|
;; This also shouldn't happen, because how would you have
|
||||||
;; sucks and we have to account for stuff like this.
|
;; gotten Org in the first place, then? But the real world
|
||||||
"git not available")))
|
;; sucks and we have to account for stuff like this.
|
||||||
(defalias #'org-git-version #'radian--org-git-version)
|
"git not available")))
|
||||||
(defun org-release () "N/A")
|
(defalias #'org-git-version #'radian--org-git-version)
|
||||||
(provide 'org-version)
|
(defun org-release () "N/A")
|
||||||
(with-eval-after-load 'org
|
(provide 'org-version)
|
||||||
(defalias #'org-git-version #'radian--org-git-version)))
|
(with-eval-after-load 'org
|
||||||
|
(defalias #'org-git-version #'radian--org-git-version))))
|
||||||
|
|
||||||
(let ((debug-on-error t))
|
(let ((debug-on-error t))
|
||||||
(org-babel-load-file
|
(org-babel-load-file
|
||||||
|
Loading…
Reference in New Issue
Block a user