summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--init.el55
-rw-r--r--lisp/mrl_functions.el49
2 files changed, 53 insertions, 51 deletions
diff --git a/init.el b/init.el
index c70f798..3c3352e 100644
--- a/init.el
+++ b/init.el
@@ -4,6 +4,8 @@
;;; basic config
;;; Code:
+
+
(defvar mrl/startup-time (current-time))
(defun mrl/emacs-load-time ()
(let ((time (float-time (time-subtract (current-time) mrl/startup-time))))
@@ -28,9 +30,6 @@
(setq use-package-always-ensure t)
(require 'use-package)
-;; my macros
-(add-to-list 'load-path "~/.emacs.d/macros/mrl_macros.macs")
-
;; easy revert buffer, which I never use
(global-set-key (kbd "C-c R") (lambda () (interactive) (revert-buffer t t)))
@@ -70,8 +69,9 @@ Restart works only on graphic display."
;; notmuch is apparently already installed with notmuch from arch
(require 'notmuch)
-;; org and notmuch
+;; load my crap
(add-to-list 'load-path "~/.emacs.d/lisp")
+(require 'mrl_functions)
(require 'org-notmuch)
(org-link-set-parameters "notmuch"
@@ -224,53 +224,6 @@ Restart works only on graphic display."
(setq coding-system-for-read 'utf-8)
(setq coding-system-for-write 'utf-8)
-;; for markdown mode
-(defun mrl/get-start-and-lines-in-region ()
- "Cumbersome newbie way to get start line and number
-of lines in region."
- (let (pos1 pos2)
- (setq pos1 (region-beginning)
- pos2 (region-end))
- (let ((line1 (line-number-at-pos pos1))
- (line2 (line-number-at-pos pos2)))
- (list line1 (- line2 line1)))))
-
-(defun mrl/clear-check-region (start lines)
- "Clears check marks given a start line and number
-of lines to run through."
- (setq count 0)
- (while (> lines 0)
- (save-excursion
- (goto-line (+ start count))
- (beginning-of-line)
- (forward-char 3)
- (delete-char 1)
- (insert-char ?\s))
- (next-line)
- (setq count (+ count 1))
- (setq lines (- lines 1))))
-
-
-(defun mrl/clear-check-from-region ()
- "Interactive func to clear markdown checks from a region."
- (interactive)
- (save-excursion
- (mrl/clear-check-region
- (car (mrl/get-start-and-lines-in-region))
- (car (last (mrl/get-start-and-lines-in-region))))))
-
-;; do this for a region next
-(defun mrl/clear-check-single-line (&optional lines)
- "Remove the check from LINES number of markdown checkbox lines."
- (interactive "p")
- (while (> lines 0)
- (save-excursion
- (beginning-of-line)
- (forward-char 3)
- (delete-char 1)
- (insert-char ?\s))
- (next-line)
- (setq lines (- lines 1))))
;; PACKAGES
diff --git a/lisp/mrl_functions.el b/lisp/mrl_functions.el
new file mode 100644
index 0000000..75f0eaa
--- /dev/null
+++ b/lisp/mrl_functions.el
@@ -0,0 +1,49 @@
+;; for markdown mode
+(defun mrl/get-start-and-lines-in-region ()
+ "Cumbersome newbie way to get start line and number
+of lines in region."
+ (let (pos1 pos2)
+ (setq pos1 (region-beginning)
+ pos2 (region-end))
+ (let ((line1 (line-number-at-pos pos1))
+ (line2 (line-number-at-pos pos2)))
+ (list line1 (- line2 line1)))))
+
+(defun mrl/clear-check-region (start lines)
+ "Clears check marks given a start line and number
+of lines to run through."
+ (setq count 0)
+ (while (> lines 0)
+ (save-excursion
+ (goto-line (+ start count))
+ (beginning-of-line)
+ (forward-char 3)
+ (delete-char 1)
+ (insert-char ?\s))
+ (next-line)
+ (setq count (+ count 1))
+ (setq lines (- lines 1))))
+
+
+(defun mrl/clear-check-from-region ()
+ "Interactive func to clear markdown checks from a region."
+ (interactive)
+ (save-excursion
+ (mrl/clear-check-region
+ (car (mrl/get-start-and-lines-in-region))
+ (car (last (mrl/get-start-and-lines-in-region))))))
+
+;; do this for a region next
+(defun mrl/clear-check-single-line (&optional lines)
+ "Remove the check from LINES number of markdown checkbox lines."
+ (interactive "p")
+ (while (> lines 0)
+ (save-excursion
+ (beginning-of-line)
+ (forward-char 3)
+ (delete-char 1)
+ (insert-char ?\s))
+ (next-line)
+ (setq lines (- lines 1))))
+(provide 'mrl_functions)
+;;; mrl_functions ends here