Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jiaxing Liu
spacemacs
Commits
f66b8c26
Commit
f66b8c26
authored
10 years ago
by
syl20bnr
Browse files
Options
Download
Plain Diff
Merge branch 'develop' (v0.51.0)
parents
a1d05d6b
b022c390
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
80 additions
and
34 deletions
+80
-34
core/core-configuration-layer.el
core/core-configuration-layer.el
+6
-6
core/core-dotspacemacs.el
core/core-dotspacemacs.el
+6
-2
core/core-fonts-support.el
core/core-fonts-support.el
+24
-7
core/core-spacemacs-mode.el
core/core-spacemacs-mode.el
+1
-1
core/templates/.spacemacs.template
core/templates/.spacemacs.template
+6
-2
init.el
init.el
+1
-1
spacemacs/extensions.el
spacemacs/extensions.el
+7
-5
spacemacs/extensions/evil-escape/evil-escape.el
spacemacs/extensions/evil-escape/evil-escape.el
+11
-8
spacemacs/packages.el
spacemacs/packages.el
+18
-2
No files found.
core/core-configuration-layer.el
View file @
f66b8c26
...
...
@@ -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
)))
...
...
@@ -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
...
...
@@ -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
))))))
...
...
This diff is collapsed.
Click to expand it.
core/core-dotspacemacs.el
View file @
f66b8c26
...
...
@@ -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"
)
...
...
@@ -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."
)
...
...
This diff is collapsed.
Click to expand it.
core/core-fonts-support.el
View file @
f66b8c26
...
...
@@ -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
...
...
@@ -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
)
...
...
@@ -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. "
...
...
This diff is collapsed.
Click to expand it.
core/core-spacemacs-mode.el
View file @
f66b8c26
...
...
@@ -57,7 +57,7 @@
(
defvar
spacemacs-loading-dots-chunk-threshold
0
)
(
defvar
spacemacs-solarized-dark-createdp
nil
)
(
define-derived-mode
spacemacs-mode
special-mode
"
s
pacemacs
-mode
"
(
define-derived-mode
spacemacs-mode
special-mode
"
S
pacemacs"
"Spacemacs major mode for startup screen."
:syntax-table
nil
:abbrev-table
nil
...
...
This diff is collapsed.
Click to expand it.
core/templates/.spacemacs.template
View file @
f66b8c26
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
init.el
View file @
f66b8c26
...
...
@@ -9,7 +9,7 @@
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(
defconst
spacemacs-version
"0.5
0.3
"
"Spacemacs version."
)
(
defconst
spacemacs-version
"0.5
1.0
"
"Spacemacs version."
)
(
defconst
spacemacs-min-version
"24.3"
"Minimal required version of Emacs."
)
(
defun
spacemacs/emacs-version-ok
()
...
...
This diff is collapsed.
Click to expand it.
spacemacs/extensions.el
View file @
f66b8c26
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
spacemacs/extensions/evil-escape/evil-escape.el
View file @
f66b8c26
...
...
@@ -5,7 +5,7 @@
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; Keywords: convenience editing evil
;; Created: 22 Oct 2014
;; Version: 2.0
7
;; Version: 2.0
8
;; Package-Requires: ((emacs "24") (evil "1.0.9"))
;; URL: https://github.com/syl20bnr/evil-escape
...
...
@@ -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
))
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
spacemacs/packages.el
View file @
f66b8c26
...
...
@@ -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
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment