Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ non-platform specific configuration files.
| Mac OS X | Carbon Emacs | `carbon-emacs-` | carbon-emacs-applescript.el |
| | Cocoa Emacs | `cocoa-emacs-` | cocoa-emacs-plist.el |
| GNU/Linux | | `linux-` | linux-commands.el |
| *BSD | | `bsd-` | bsd-commands.el |
| All | Non-window system | `nw-` | nw-key.el |

### Byte-compilation
Expand Down
10 changes: 10 additions & 0 deletions init-loader.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
;; ------------------------------------------------------------------------
;; GNU/Linux linux- linux-commands.el
;; ------------------------------------------------------------------------
;; *BSD bsd- bsd-commands.el
;; ------------------------------------------------------------------------
;; All Non-window system nw- nw-key.el
;;
;; If `init-loader-byte-compile' is non-nil, each configuration file
Expand Down Expand Up @@ -133,6 +135,10 @@ example, 00_foo.el, 01_bar.el ... 99_keybinds.el."
"Regular expression of GNU/Linux specific configuration file names."
:type 'regexp)

(defcustom init-loader-bsd-regexp "\\`bsd-"
"Regular expression of *BSD specific configuration file names."
:type 'regexp)

;;;###autoload
(defun* init-loader-load (&optional (init-dir init-loader-directory))
"Load configuration files in INIT-DIR."
Expand Down Expand Up @@ -163,6 +169,10 @@ example, 00_foo.el, 01_bar.el ... 99_keybinds.el."
(when (eq system-type 'gnu/linux)
(init-loader-re-load init-loader-linux-regexp init-dir))

;; *BSD
(when (eq system-type 'berkeley-unix)
(init-loader-re-load init-loader-bsd-regexp init-dir))

;; no-window
(when (not window-system)
(init-loader-re-load init-loader-nw-regexp init-dir))
Expand Down
8 changes: 7 additions & 1 deletion test-init-loader.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
"meadow-shell.el"
"meadow-w32-symlinks.el"
"linux-fonts.el"
"linux-commands.el"))
"linux-commands.el"
"bsd-config.el"
"bsd-migemo.el"))

;; TODO flet is obsoleted from Emacs 24.3

Expand Down Expand Up @@ -78,6 +80,10 @@
(expected '("linux-commands.el" "linux-fonts.el")))
(should (equal got expected)))

(let ((got (init-loader--re-load-files init-loader-bsd-regexp "" t))
(expected '("bsd-config.el" "bsd-migemo.el")))
(should (equal got expected)))

(let ((got (init-loader--re-load-files init-loader-nw-regexp "" t))
(expected '("nw-config.el")))
(should (equal got expected)))
Expand Down