From 6cb0ecd79624a6bc7914e1c2d3968a7370ef0d0c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 25 Aug 2017 15:16:37 -0700 Subject: [PATCH] [Emacs] Reformat init.el org use-package --- dotfiles/emacs.d/init.el | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index 63bd6d24..f6190eaf 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -27,32 +27,33 @@ ;; Without this, org can behave very strangely (use-package org :init - ;; Taken from https://github.com/raxod502/radian/blob/master/radian-emacs/radian-org.el - (defun radian--org-git-version () - "Return the abbreviated SHA for the Org Git repo." - (let ((default-directory (concat user-emacs-directory - "straight/repos/org/"))) - (if (executable-find "git") - (with-temp-buffer - ;; Returns the shortest prefix of the SHA for HEAD that is - ;; unique, down to a minimum of 4 characters (see - ;; git-rev-parse(1)). - (call-process "git" nil '(t nil) nil - "rev-parse" "--short" "HEAD") - (if (> (buffer-size) 0) - (string-trim (buffer-string)) - ;; This shouldn't happen, unless somehow Org is not - ;; actually a Git repo. - "revision unknown")) - ;; This also shouldn't happen, because how would you have - ;; gotten Org in the first place, then? But the real world - ;; sucks and we have to account for stuff like this. - "git not available"))) - (defalias #'org-git-version #'radian--org-git-version) - (defun org-release () "N/A") - (provide 'org-version) - (with-eval-after-load 'org - (defalias #'org-git-version #'radian--org-git-version))) + (progn + ;; Taken from https://github.com/raxod502/radian/blob/master/radian-emacs/radian-org.el + (defun radian--org-git-version () + "Return the abbreviated SHA for the Org Git repo." + (let ((default-directory (concat user-emacs-directory + "straight/repos/org/"))) + (if (executable-find "git") + (with-temp-buffer + ;; Returns the shortest prefix of the SHA for HEAD that is + ;; unique, down to a minimum of 4 characters (see + ;; git-rev-parse(1)). + (call-process "git" nil '(t nil) nil + "rev-parse" "--short" "HEAD") + (if (> (buffer-size) 0) + (string-trim (buffer-string)) + ;; This shouldn't happen, unless somehow Org is not + ;; actually a Git repo. + "revision unknown")) + ;; This also shouldn't happen, because how would you have + ;; gotten Org in the first place, then? But the real world + ;; sucks and we have to account for stuff like this. + "git not available"))) + (defalias #'org-git-version #'radian--org-git-version) + (defun org-release () "N/A") + (provide 'org-version) + (with-eval-after-load 'org + (defalias #'org-git-version #'radian--org-git-version)))) (let ((debug-on-error t)) (org-babel-load-file