2011-10-08 23:05:06 +03:00
|
|
|
;;; prelude-ui.el --- Emacs Prelude: UI optimizations and tweaks.
|
|
|
|
;;
|
2012-04-17 17:35:21 +03:00
|
|
|
;; Copyright (c) 2011-2012 Bozhidar Batsov
|
2011-10-08 23:05:06 +03:00
|
|
|
;;
|
2012-04-17 17:35:21 +03:00
|
|
|
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
|
|
|
|
;; URL: http://batsov.com/emacs-prelude
|
2011-10-08 23:05:06 +03:00
|
|
|
;; Version: 1.0.0
|
|
|
|
;; Keywords: convenience
|
|
|
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; We dispense with most of the point and click UI, reduce the startup noise,
|
|
|
|
;; configure smooth scolling and a nice theme that's easy on the eyes (zenburn).
|
|
|
|
|
|
|
|
;;; 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:
|
|
|
|
|
2011-11-27 13:47:34 +02:00
|
|
|
;; the toolbar is just a waste of valuable screen estate
|
|
|
|
;; in a tty tool-bar-mode does not properly auto-load, and is
|
|
|
|
;; already disabled anyway
|
|
|
|
(when (fboundp 'tool-bar-mode)
|
2011-11-23 12:13:32 +02:00
|
|
|
(tool-bar-mode -1))
|
2011-11-27 13:47:34 +02:00
|
|
|
;; the menu bar is mostly useless as well
|
|
|
|
;; but removing it under OS X doesn't make much sense
|
2012-02-15 19:02:51 +02:00
|
|
|
(defun prelude-frame-config (frame)
|
|
|
|
"Custom behaviours for new frames."
|
2012-02-19 01:25:45 +02:00
|
|
|
(if (eq system-type 'darwin)
|
|
|
|
(with-selected-frame frame
|
|
|
|
(if (display-graphic-p)
|
|
|
|
(modify-frame-parameters frame '((menu-bar-lines . 1)))
|
|
|
|
(modify-frame-parameters frame '((menu-bar-lines . 0)))))
|
|
|
|
(menu-bar-mode -1)))
|
|
|
|
|
2012-02-15 19:02:51 +02:00
|
|
|
;; run now
|
|
|
|
(prelude-frame-config (selected-frame))
|
|
|
|
;; and later
|
|
|
|
(add-hook 'after-make-frame-functions 'prelude-frame-config)
|
|
|
|
|
2011-11-27 13:47:34 +02:00
|
|
|
;; the blinking cursor is nothing, but an annoyance
|
|
|
|
(blink-cursor-mode -1)
|
|
|
|
|
|
|
|
;; disable startup screen
|
|
|
|
(setq inhibit-startup-screen t)
|
|
|
|
|
|
|
|
;; nice scrolling
|
|
|
|
(setq scroll-margin 0
|
|
|
|
scroll-conservatively 100000
|
|
|
|
scroll-preserve-screen-position 1)
|
|
|
|
|
|
|
|
;; mode line settings
|
|
|
|
(line-number-mode t)
|
|
|
|
(column-number-mode t)
|
|
|
|
(size-indication-mode t)
|
2011-10-08 23:05:06 +03:00
|
|
|
|
2012-02-16 18:01:48 +02:00
|
|
|
;; make the fringe (gutter) smaller
|
|
|
|
;; the argument is a width in pixels (the default is 8)
|
2012-02-26 20:58:56 +02:00
|
|
|
(if (fboundp 'fringe-mode)
|
|
|
|
(fringe-mode 4))
|
2012-02-16 18:01:48 +02:00
|
|
|
|
2011-10-08 23:05:06 +03:00
|
|
|
;; enable y/n answers
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|
|
|
|
|
2012-03-13 17:16:01 +02:00
|
|
|
;; more useful frame title, that show either a file or a
|
|
|
|
;; buffer name (if the buffer isn't visiting a file)
|
|
|
|
(setq frame-title-format
|
|
|
|
'("" invocation-name " Prelude - " (:eval (if (buffer-file-name)
|
|
|
|
(abbreviate-file-name (buffer-file-name))
|
|
|
|
"%b"))))
|
|
|
|
|
2011-11-27 13:47:34 +02:00
|
|
|
;; use zenburn as the default theme
|
|
|
|
(load-theme 'zenburn t)
|
2011-10-08 23:05:06 +03:00
|
|
|
|
|
|
|
(provide 'prelude-ui)
|
|
|
|
;;; prelude-ui.el ends here
|