Last active
February 24, 2019 03:54
-
-
Save mikedll/5b353c913225cd4303658ba7bf7aecb3 to your computer and use it in GitHub Desktop.
Parse lines of a file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun get-lines() | |
(let* ((mine-file (concat settings-dir "/common/emacs/mike/mine.txt")) | |
(cur-line nil) | |
(files-to-load (list)) | |
(my-configs-buf (find-file-noselect mine-file))) | |
(with-current-buffer my-configs-buf | |
(goto-char (point-min)) | |
(while (not (eq (point) (point-max))) | |
(setq cur-line (thing-at-point 'line t)) | |
(cond ((string-match "^#" cur-line) | |
(setq cur-line nil)) | |
((string-match "\n" cur-line) | |
(setq cur-line (replace-match "" t nil cur-line))) | |
(t (setq cur-line nil))) | |
(if (not (null cur-line)) | |
(setq files-to-load (cons cur-line files-to-load))) | |
(forward-line))) | |
;; reverse, since we cons-ed the list when building it. | |
(reverse files-to-load))) | |
(dolist (file (get-lines)) | |
(message file)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Will be loaded in this order. | |
mikedll-emacs-defaults.el | |
osx.el | |
windows.el | |
linux.el | |
mikedll-emacs-extensions.el | |
mikedll-editing-settings.el | |
load-languages.el | |
load-tools.el |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment