diff --git a/init.el b/init.el index 1f124fc9..949bfa15 100644 --- a/init.el +++ b/init.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2015-06-10 17:29:44 kmodi> +;; Time-stamp: <2015-06-16 16:58:29 kmodi> ;; Author: Kaushal Modi ;; Record the start time @@ -7,15 +7,19 @@ ;; (setq debug-on-message "Making tags") ;; Global variables -(setq user-home-directory (concat (getenv "HOME") "/")) ; must end with / -(setq user-emacs-directory (concat user-home-directory ".emacs.d/")) ; must end with / -(setq emacs-version-short (replace-regexp-in-string - "\\([0-9]+\\)\\.\\([0-9]+\\).*" - "\\1_\\2" emacs-version)) ; 25.0.50.1 -> 25_0 -(setq org-directory (concat user-home-directory "org/")) ; must end with / -(setq setup-packages-file (locate-user-emacs-file "setup-packages.el")) -(setq custom-file (locate-user-emacs-file - (concat "custom_" emacs-version-short ".el"))) +(setq user-home-directory (concat (getenv "HOME") "/")) ; must end with / +(setq user-emacs-directory (concat user-home-directory ".emacs.d/")) ; must end with / +(setq emacs-version-short (replace-regexp-in-string + "\\([0-9]+\\)\\.\\([0-9]+\\).*" + "\\1_\\2" emacs-version)) ; 25.0.50.1 -> 25_0 +(setq org-directory (concat user-home-directory "org/")) ; must end with / +(setq setup-packages-file (locate-user-emacs-file "setup-packages.el")) +(setq custom-file (locate-user-emacs-file + (concat "custom_" emacs-version-short ".el"))) +(setq user-personal-directory (let ((dir (concat user-emacs-directory + "personal/"))) + (make-directory dir :parents) + dir)) ;; A list of packages to ensure are installed at launch (setq my-packages @@ -139,6 +143,10 @@ (require 'cl) (require 'cl-lib) +;; Place `setup-var-overrides.el' with `(provide 'setup-var-overrides)' in +;; `user-personal-directory' +(require 'setup-var-overrides nil :noerror) + (load custom-file :noerror :nomessage) ; Load the emacs `M-x customize` generated file (load setup-packages-file nil :nomessage) ; Load the packages @@ -149,12 +157,6 @@ ;; I call this function in setup-packages.el and so am keeping the ;; commented out version here so that package.el does not add it again. -;; Optional file containing `setq' statements to disable loading of selected -;; packages. Format to be used: (setq disable-pkg-PKGNAME t) -;; Example: (setq disable-pkg-pdf-tools t) -;; Place `setup-disables.el' with `(provide 'setup-disables)' in `setup-files/' -(require 'setup-disables nil :noerror) - ;; Start `benchmark-init' as soon as possible (require 'benchmark-init) @@ -281,9 +283,10 @@ (require 'setup-calc) (require 'setup-image) +;; Place `setup-work.el' with `(provide 'setup-work)' in `user-personal-directory' (require 'setup-work nil :noerror) -;; Place `setup-personal.el' with `(provide 'setup-personal)' in `setup-files/' +;; Place `setup-personal.el' with `(provide 'setup-personal)' in `user-personal-directory' (require 'setup-personal nil :noerror) ;; Load certain setup files after a 1 second idle time after emacs has loaded. diff --git a/personal/setup-var-overrides-EXAMPLE.el b/personal/setup-var-overrides-EXAMPLE.el new file mode 100644 index 00000000..d638319b --- /dev/null +++ b/personal/setup-var-overrides-EXAMPLE.el @@ -0,0 +1,22 @@ +;; Time-stamp: <2015-06-16 17:11:37 kmodi> + +;; Variable overrides + +;; This file can be used to override variables using `setq' forms. +;; An example use is to disable loading of selected packages. +;; Format to be used: (setq disable-pkg-PKGNAME t) +;; Example: (setq disable-pkg-pdf-tools t) ; Disable loading of `pdf-tools' +;; Note that all packages CANNOT be disabled in this manner. + +;; (setq user-personal-directory "~/.emacs.d/personal/") + +;; (setq disable-pkg-pdf-tools t) +;; (setq disable-pkg-yasnippet t) +;; (setq disable-pkg-ivy t) +;; (setq disable-pkg-shackle t) +;; (setq disable-pkg-fci t) +;; (setq disable-pkg-hl-anything t) + + +;; Below line *has to be uncommented* for the setup in this file to be effective +;; (provide 'setup-var-overrides) diff --git a/setup-files/setup-latex.el b/setup-files/setup-latex.el index 11ff0588..618096c5 100755 --- a/setup-files/setup-latex.el +++ b/setup-files/setup-latex.el @@ -18,7 +18,7 @@ "AucTeX install directory.") (when (file-exists-p auctex-install-dir) - (prepend-path auctex-install-dir) + (add-to-list 'load-path auctex-install-dir) (load "auctex.el" nil t t) (load "preview-latex.el" nil t t) diff --git a/setup-packages.el b/setup-packages.el index 67027a93..5a101249 100755 --- a/setup-packages.el +++ b/setup-packages.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2015-05-28 11:09:46 kmodi> +;; Time-stamp: <2015-06-16 16:34:44 kmodi> ;; Package management ;; Loading of packages at startup @@ -14,17 +14,11 @@ (require 'package) (when (version<= "25.0" emacs-version) - (setq package-menu-async t) ; If non-nil, do activities asynchronously, like refreshing menu - ) + (setq package-menu-async t)) ; If non-nil, do activities asynchronously, like refreshing menu -(defun prepend-path ( my-path ) - (setq load-path (cons (expand-file-name my-path) load-path))) - -(defun append-path ( my-path ) - (setq load-path (append load-path (list (expand-file-name my-path))))) - -(prepend-path (concat user-emacs-directory "elisp/")) -(prepend-path (concat user-emacs-directory "setup-files/")) +(add-to-list 'load-path (concat user-emacs-directory "elisp/")) +(add-to-list 'load-path (concat user-emacs-directory "setup-files/")) +(add-to-list 'load-path user-personal-directory) ;; Create the package install directory if it doesn't exist (setq package-user-dir (concat user-emacs-directory "elpa_"