summary refs log tree commit diff
path: root/emacs.d/lib
diff options
context:
space:
mode:
Diffstat (limited to 'emacs.d/lib')
-rw-r--r--emacs.d/lib/my-functions.el46
1 files changed, 46 insertions, 0 deletions
diff --git a/emacs.d/lib/my-functions.el b/emacs.d/lib/my-functions.el
index 1281be3..3513a84 100644
--- a/emacs.d/lib/my-functions.el
+++ b/emacs.d/lib/my-functions.el
@@ -1,3 +1,49 @@
+;; these functions are for loading my configuration
+(defun fc/load-time (emacs-start-time)
+  "How long did it take to load the configuration."
+  (let ((load-time (float-time (time-subtract (current-time) emacs-start-time))))
+    (message (format "Emacs loaded in %.3fs" load-time))))
+
+(defun fc/system-info ()
+  "Display system informations"
+  (format
+   (concat "### System information :\n"
+           "- OS: %s\n"
+           "- Emacs: %s")
+   system-type
+   emacs-version))
+
+(defun fc/emacs-is-ready ()
+  "Emacs is ready"
+  (message "Emacs is ready."))
+
+;; font manipulation
+(defun fc/scale-up-or-down-font-size (direction)
+  "Scale the font. If DIRECTION is positive or zero the font is scaled up,
+otherwise it is scaled down."
+  (interactive)
+  (let ((scale 0.5))
+    (if (eq direction 0)
+        (text-scale-set 0)
+      (if (< direction 0)
+          (text-scale-decrease scale)
+        (text-scale-increase scale)))))
+
+(defun fc/scale-up-font ()
+  "Scale up the font."
+  (interactive)
+  (fc/scale-up-or-down-font-size 1))
+
+(defun fc/scale-down-font ()
+  "Scale up the font."
+  (interactive)
+  (fc/scale-up-or-down-font-size -1))
+
+(defun fc/reset-font-size ()
+  "Reset the font size."
+  (interactive)
+  (fc/scale-up-or-down-font-size 0))
+
 ;; jump to the scratch buffer
 (defun fc/switch-to-scratch ()
   "Switch to scratch, grab the region if it's active."