Merge pull request #534 from RadicalZephyr/user-init-file

Enhance find-user-init-file
This commit is contained in:
Bozhidar Batsov 2014-05-15 23:55:19 +03:00
commit ae51a22147
4 changed files with 88 additions and 36 deletions

View file

@ -550,10 +550,12 @@ This follows freedesktop standards, should work in X servers."
'(2 "_NET_WM_STATE_FULLSCREEN" 0)) '(2 "_NET_WM_STATE_FULLSCREEN" 0))
(error "Only X server is supported"))) (error "Only X server is supported")))
(defun prelude-find-user-init-file () (defun prelude-find-user-init-file (&optional arg)
"Edit the `user-init-file', in another window." "Edit the `prelude-user-init-file', in another window.
(interactive) With a prefix argument ARG, find the `user-init-file' instead."
(find-file-other-window user-init-file)) (interactive "P")
(if arg (find-file-other-window user-init-file)
(find-file-other-window prelude-user-init-file)))
(defun prelude-find-shell-init-file () (defun prelude-find-shell-init-file ()
"Edit the shell init file in another window." "Edit the shell init file in another window."

81
core/prelude-custom.el Normal file
View file

@ -0,0 +1,81 @@
;;; prelude-custom.el --- Emacs Prelude: Prelude's customizable variables.
;;
;; Copyright © 2011-2013 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
;; Version: 1.0.0
;; Keywords: convenience
;; This file is not part of GNU Emacs.
;;; Commentary:
;; Refinements of the core editing experience in Emacs.
;;; License:
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
;; customize
(defgroup prelude nil
"Emacs Prelude configuration."
:prefix "prelude-"
:group 'convenience)
(defcustom prelude-auto-save t
"Non-nil values enable Prelude's auto save."
:type 'boolean
:group 'prelude)
(defcustom prelude-guru t
"Non-nil values enable `guru-mode'."
:type 'boolean
:group 'prelude)
(defcustom prelude-whitespace t
"Non-nil values enable Prelude's whitespace visualization."
:type 'boolean
:group 'prelude)
(defcustom prelude-clean-whitespace-on-save t
"Cleanup whitespace from file before it's saved.
Will only occur if `prelude-whitespace' is also enabled."
:type 'boolean
:group 'prelude)
(defcustom prelude-flyspell t
"Non-nil values enable Prelude's flyspell support."
:type 'boolean
:group 'prelude)
(defcustom prelude-user-init-file (expand-file-name "personal/"
user-emacs-directory)
"Path to your personal customization file.
Prelude recommends you only put personal customizations in the
personal folder. This variable allows you to specify a specific
folder as the one that should be visited when running
`prelude-find-user-init-file'. This can be easily set to the desired buffer
in lisp by putting `(setq prelude-user-init-file buffer-file-name)'
in the desired elisp file."
:type 'string
:group 'prelude)
(provide 'prelude-custom)
;;; prelude-custom.el ends here

View file

@ -32,38 +32,6 @@
;;; Code: ;;; Code:
;; customize
(defgroup prelude nil
"Emacs Prelude configuration."
:prefix "prelude-"
:group 'convenience)
(defcustom prelude-auto-save t
"Non-nil values enable Prelude's auto save."
:type 'boolean
:group 'prelude)
(defcustom prelude-guru t
"Non-nil values enable guru-mode."
:type 'boolean
:group 'prelude)
(defcustom prelude-whitespace t
"Non-nil values enable Prelude's whitespace visualization."
:type 'boolean
:group 'prelude)
(defcustom prelude-clean-whitespace-on-save t
"Cleanup whitespace from file before it's saved.
Will only occur if prelude-whitespace is also enabled."
:type 'boolean
:group 'prelude)
(defcustom prelude-flyspell t
"Non-nil values enable Prelude's flyspell support."
:type 'boolean
:group 'prelude)
;; Death to the tabs! However, tabs historically indent to the next ;; Death to the tabs! However, tabs historically indent to the next
;; 8-character offset; specifying anything else will cause *mass* ;; 8-character offset; specifying anything else will cause *mass*
;; confusion, as it will change the appearance of every existing file. ;; confusion, as it will change the appearance of every existing file.

View file

@ -100,6 +100,7 @@ by Prelude.")
;; the core stuff ;; the core stuff
(require 'prelude-packages) (require 'prelude-packages)
(require 'prelude-ui) (require 'prelude-ui)
(require 'prelude-custom) ;; Needs to be loaded before core and editor
(require 'prelude-core) (require 'prelude-core)
(require 'prelude-mode) (require 'prelude-mode)
(require 'prelude-editor) (require 'prelude-editor)