Skip to content

Commit

Permalink
Merge branch 'develop' (v0.51.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Jan 28, 2015
2 parents a1d05d6 + b022c39 commit f66b8c2
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 34 deletions.
12 changes: 6 additions & 6 deletions core/core-configuration-layer.el
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ If PRE is non nil then `layer-pre-extensions' is read instead of

(defun configuration-layer//activate-package (pkg)
"Activate PKG."
(if (version< emacs-version "24.4")
(if (version< emacs-version "24.3.50")
;; fake version list to always activate the package
(package-activate pkg '(0 0 0 0))
(package-activate pkg)))
Expand Down Expand Up @@ -541,13 +541,13 @@ deleted safely."
"Return the dependencies alist for PACKAGE."
(let ((pkg (assq package package-alist)))
(cond
((version< emacs-version "24.4") (aref (cdr pkg) 1))
((version< emacs-version "24.3.50") (aref (cdr pkg) 1))
(t (package-desc-reqs (cadr pkg))))))

(defun configuration-layer//get-package-dependencies-from-archive (pkg)
"Return the dependencies alist for a PKG from the archive data."
(let* ((arch (assq pkg package-archive-contents))
(reqs (when arch (if (version< emacs-version "24.4")
(reqs (when arch (if (version< emacs-version "24.3.50")
(aref (cdr arch) 1)
(package-desc-reqs (cadr arch))))))
;; recursively get the requirements of reqs
Expand All @@ -562,20 +562,20 @@ deleted safely."
(let ((pkg (or (assq package package-alist)
(assq package package--builtins))))
(cond
((version< emacs-version "24.4") (package-version-join (aref (cdr pkg) 0)))
((version< emacs-version "24.3.50") (package-version-join (aref (cdr pkg) 0)))
(t (package-version-join (package-desc-version (cadr pkg)))))))

(defun configuration-layer//get-latest-package-version (package)
"Return the version string for PACKAGE."
(let ((pkg (assq package package-archive-contents)))
(cond
((version< emacs-version "24.4") (package-version-join (aref (cdr pkg) 0)))
((version< emacs-version "24.3.50") (package-version-join (aref (cdr pkg) 0)))
(t (package-version-join (package-desc-version (cadr pkg)))))))

(defun configuration-layer//package-delete (package)
"Delete the passed PACKAGE."
(cond
((version< emacs-version "24.4")
((version< emacs-version "24.3.50")
(package-delete (symbol-name package)
(configuration-layer//get-package-version package)))
(t (package-delete (cadr (assq package package-alist))))))
Expand Down
8 changes: 6 additions & 2 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ the value is nil then no banner is displayed.")
"list of contribution to load."
)

(defvar dotspacemacs-themes '(solarized-light solarized-dark)
(defvar dotspacemacs-themes '(solarized-light
solarized-dark
leuven
monokai
zenburn)
"List of themes, the first of the list is loaded when spacemacs starts.
Press <SPC> T n to cycle to the next theme in the list (works great
with 2 themes variants, one dark and one light")
Expand All @@ -44,7 +48,7 @@ pressing `<leader> m`")
:size 13
:weight normal
:width normal
:powerline-offset 2)
:powerline-scale 1.1)
"Default font. The powerline-offset allows to quickly tweak the mode-line
size to make separators look not too crappy.")

Expand Down
31 changes: 24 additions & 7 deletions core/core-fonts-support.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
PLIST has the form (\"fontname\" :prop1 val1 :prop2 val2 ...)"
(let* ((font (car plist))
(props (cdr plist))
(powerline-offset (plist-get props :powerline-offset))
(font-props (spacemacs/mplist-remove props :powerline-offset))
(scale (plist-get props :powerline-scale))
(font-props (spacemacs/mplist-remove
(spacemacs/mplist-remove props :powerline-scale)
:powerline-offset))
(fontspec (apply 'font-spec :family font font-props)))
(set-default-font fontspec nil t)
(setq-default powerline-height (+ powerline-offset (frame-char-height)))
(setq-default powerline-scale scale)
(setq-default powerline-height (spacemacs/compute-powerline-height))
;; fallback font for unicode characters used in spacemacs
(pcase system-type
(`gnu/linux
Expand All @@ -38,10 +41,18 @@ PLIST has the form (\"fontname\" :prop1 val1 :prop2 val2 ...)"
(setq fallback-font-name nil)
(setq fallback-font-name2 nil)))
(when (and fallback-font-name fallback-font-name2)
(let ((fallback-spec (apply 'font-spec
:family fallback-font-name font-props))
(fallback-spec2 (apply 'font-spec
:family fallback-font-name2 font-props)))
;; remove any size or height properties in order to be able to
;; scale the fallback fonts with the default one (for zoom-in/out
;; for instance)
(let* ((fallback-props (spacemacs/mplist-remove
(spacemacs/mplist-remove font-props :size)
:height))
(fallback-spec (apply 'font-spec
:family fallback-font-name
fallback-props))
(fallback-spec2 (apply 'font-spec
:family fallback-font-name2
fallback-props)))
;; window numbers
(set-fontset-font "fontset-default"
'(#x2776 . #x2793) fallback-spec nil 'prepend)
Expand All @@ -56,6 +67,12 @@ PLIST has the form (\"fontname\" :prop1 val1 :prop2 val2 ...)"
'(#x2190 . #x2200) fallback-spec2 nil 'prepend)))
))

(defun spacemacs/compute-powerline-height ()
"Return an adjusted powerline height."
(let ((scale (if (and (boundp 'powerline-scale) powerline-scale)
powerline-scale 1)))
(truncate (* scale (frame-char-height)))))

(defun spacemacs/set-font (&rest args)
"Deprecated function, display a warning message."
(spacemacs/message (concat "Warning: spacemacs/set-font is deprecated. "
Expand Down
2 changes: 1 addition & 1 deletion core/core-spacemacs-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
(defvar spacemacs-loading-dots-chunk-threshold 0)
(defvar spacemacs-solarized-dark-createdp nil)

(define-derived-mode spacemacs-mode special-mode "spacemacs-mode"
(define-derived-mode spacemacs-mode special-mode "Spacemacs"
"Spacemacs major mode for startup screen."
:syntax-table nil
:abbrev-table nil
Expand Down
8 changes: 6 additions & 2 deletions core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(solarized-light solarized-dark)
dotspacemacs-themes '(solarized-light
solarized-dark
leuven
monokai
zenburn)
;; Default font. The powerline-offset allows to quickly tweak the mode-line
;; size to make separators look not too crappy.
dotspacemacs-default-font '("Source Code Pro"
:size 13
:weight normal
:width normal
:powerline-offset 2)
:powerline-scale 1.1)
;; The leader key
dotspacemacs-leader-key "SPC"
;; Major mode leader key is a shortcut key which is the equivalent of
Expand Down
2 changes: 1 addition & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst spacemacs-version "0.50.3" "Spacemacs version.")
(defconst spacemacs-version "0.51.0" "Spacemacs version.")
(defconst spacemacs-min-version "24.3" "Minimal required version of Emacs.")

(defun spacemacs/emacs-version-ok ()
Expand Down
12 changes: 7 additions & 5 deletions spacemacs/extensions.el
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ Press any other key to exit."))
"Zoom the buffer in/out. If DIRECTION is positive or zero the frame text is enlarged,
otherwise it is reduced."
(interactive)
(if (eq direction 0)
(zoom-frm-unzoom)
(if (< direction 0)
(zoom-frm-out)
(zoom-frm-in)))
(cond
((eq direction 0) (zoom-frm-unzoom))
((< direction 0) (zoom-frm-out))
((> direction 0) (zoom-frm-in)))
(when (fboundp 'powerline-reset)
(setq-default powerline-height (spacemacs/compute-powerline-height))
(powerline-reset))
(spacemacs/zoom-frame-overlay-map)
(spacemacs/zoom-frame-micro-state-doc))
(evil-leader/set-key
Expand Down
19 changes: 11 additions & 8 deletions spacemacs/extensions/evil-escape/evil-escape.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; Keywords: convenience editing evil
;; Created: 22 Oct 2014
;; Version: 2.07
;; Version: 2.08
;; Package-Requires: ((emacs "24") (evil "1.0.9"))
;; URL: https://github.com/syl20bnr/evil-escape

Expand Down Expand Up @@ -155,13 +155,9 @@ with a key sequence."
(lookup-key evil-motion-state-map (evil-escape--first-key)))
;; evil states
;; insert state
(let ((insert-func (lambda (key) (interactive)
(cond ((eq 'term-mode major-mode)
(call-interactively 'term-send-raw))
(t (evil-escape--default-insert-func key))))))
(eval `(evil-escape-define-escape "insert-state" evil-insert-state-map evil-normal-state
:insert-func ,insert-func
:delete-func evil-escape--default-delete-func)))
(eval `(evil-escape-define-escape "insert-state" evil-insert-state-map evil-normal-state
:insert-func evil-escape--insert-state-insert-func
:delete-func evil-escape--default-delete-func))
;; emacs state
(let ((exit-func (lambda () (interactive)
(cond ((string-match "magit" (symbol-name major-mode))
Expand Down Expand Up @@ -242,6 +238,13 @@ with a key sequence."
"Insert KEY in current buffer if not read only."
(when (not buffer-read-only) (insert key)))

(defun evil-escape--insert-state-insert-func (key)
"Take care of term-mode."
(interactive)
(cond ((eq 'term-mode major-mode)
(call-interactively 'term-send-raw))
(t (evil-escape--default-insert-func key))))

(defun evil-escape--isearch-insert-func (key)
"Insert KEY in current buffer if not read only."
(isearch-printing-char))
Expand Down
20 changes: 18 additions & 2 deletions spacemacs/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,11 @@ which require an initialization must be listed explicitly in the list.")

(defun spacemacs/init-evil-terminal-cursor-changer ()
(unless (display-graphic-p)
(require 'evil-terminal-cursor-changer)))
(require 'evil-terminal-cursor-changer)
(setq etcc--evil-insert-state-cursor 'bar) ;
(setq etcc--evil-visual-state-cursor 'box) ; _
(setq etcc--evil-emacs-state-cursor 'hbar) ;
))

(defun spacemacs/init-evil-tutor ()
(use-package evil-tutor
Expand Down Expand Up @@ -1802,7 +1806,19 @@ which require an initialization must be listed explicitly in the list.")
(powerline-render rhs))))

(setq-default mode-line-format
'("%e" (:eval (spacemacs/mode-line-prepare)))))))
'("%e" (:eval (spacemacs/mode-line-prepare))))

(defun spacemacs//set-powerline-for-startup-buffers ()
"Set the powerline for buffers created when Emacs starts."
(dolist (buffer '("*Messages*" "*spacemacs*" "*Compile-Log*"))
(when (get-buffer buffer)
(with-current-buffer buffer
(setq-local mode-line-format
'("%e" (:eval (spacemacs/mode-line-prepare))))
(powerline-set-selected-window)
(powerline-reset)))))
(add-hook 'after-init-hook
'spacemacs//set-powerline-for-startup-buffers))))

(defun spacemacs/init-projectile ()
(use-package projectile
Expand Down

0 comments on commit f66b8c2

Please sign in to comment.