summaryrefslogtreecommitdiffstats
path: root/.emacs.d/ports.el
diff options
context:
space:
mode:
authorGravatar ryuslash2010-07-01 22:28:59 +0200
committerGravatar ryuslash2010-07-01 22:28:59 +0200
commitc38f147ead1d57f48a75df8653ed3ed1c12eebd3 (patch)
treee6585a87f98c5430d2443ebc3ee3a4b5decc8eec /.emacs.d/ports.el
parent104692129fd34a52dd967095f57371d1781c9172 (diff)
downloaddotfiles-c38f147ead1d57f48a75df8653ed3ed1c12eebd3.tar.gz
dotfiles-c38f147ead1d57f48a75df8653ed3ed1c12eebd3.zip
Added xmodmap
Added rainbow.el to emacs Showing some extra messages with install.bat and install.sh Added some elisp to check which distro I'm on at that moment, though I don't yet use it
Diffstat (limited to '.emacs.d/ports.el')
-rw-r--r--.emacs.d/ports.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/.emacs.d/ports.el b/.emacs.d/ports.el
new file mode 100644
index 0000000..eec3854
--- /dev/null
+++ b/.emacs.d/ports.el
@@ -0,0 +1,29 @@
+;; function copied from dim-ports.al by Dimitri Fontaine
+;; http://git.naquadah.org/?p=~dim/emacs.d.git;a=summary
+(defun lsb-release (&optional property)
+ "Parse lsb-release output and return an alist, or the value for the given property"
+ (when (file-executable-p "/usr/bin/lsb_release")
+ (let* ((lsbr (shell-command-to-string "/usr/bin/lsb_release -a 2>/dev/null"))
+ (props (split-string lsbr "[:\n]" t))
+ (kv))
+ (while (>= (length props) 2)
+ ;; Don't keep extra spaces. This way seems like the easy one in elisp.
+ (let ((key (mapconcat 'identity (split-string (car props)) " "))
+ (val (mapconcat 'identity (split-string (cadr props)) " ")))
+ (setq kv (add-to-list 'kv (cons key val)))
+ (setq props (cddr props))))
+ (if property
+ (cdr (assoc property (lsb-release)))
+ kv))))
+
+;; function copied from dim-ports.al by Dimitri Fontaine
+;; http://git.naquadah.org/?p=~dim/emacs.d.git;a=summary
+(defmacro when-running-ubuntu (&rest body)
+ "eval body only when running under Ubuntu"
+ (when (equal (lsb-release "Distributor ID") "Ubuntu") ,@body))
+
+;; function adapted from dim-ports.al by Dimitri Fontaine
+;; http://git.naquadah.org/?p=~dim/emacs.d.git;a=summary
+(defmacro when-running-fedora (&rest body)
+ "eval body only when running under Fedora"
+ (when (equal (lsb-release "Distributor ID") "Fedora") ,@body)) \ No newline at end of file