Skip to content

Commit b000bb4

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into the-big-pull
2 parents b9d0869 + 35b314f commit b000bb4

File tree

218 files changed

+2687
-1862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+2687
-1862
lines changed

CHANGELOG.next

+2-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This file containes the change log for the next major version of Spacemacs.
110110
location in the line)
111111
- ~SPC j $~ to go to the end of line (and set a mark at the previous location
112112
in the line)
113-
- ~SPC j b~ to jump to a bookmark
113+
- ~SPC j b~ to undo a jump (go back to previous location)
114114
- ~SPC j d~ to jump to a listing of the current directory
115115
- ~SPC j D~ to jump to a listing of the current directory (other window)
116116
- ~SPC j f~ to jump to the definition of the function around point
@@ -123,8 +123,7 @@ This file containes the change log for the next major version of Spacemacs.
123123
- ~SPC j n~ to split the current line at point, insert a new line and auto-indent
124124
- ~SPC j s~ to split a quoted string or s-expression in place
125125
- ~SPC j S~ to split a quoted string or s-expression, insert a new line and auto-indent
126-
- ~SPC j u~ to undo a jump (go back to previous location)
127-
- ~SPC j U~ to jump to a URL in the current buffer
126+
- ~SPC j u~ to jump to a URL in the current buffer
128127
- ~SPC j v~ to jump to the definition/declaration of the variable around point
129128
- ~SPC j w~ to jump to a word in the current buffer (works as an evil motion)
130129
(thanks to justbur)

CONTRIBUTING.org

+4
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ Contributed configuration layers are stored in the =layers/= folder. The
154154
=layers/= folder also contains categories prefixed with =+= to put your layers
155155
in. For example a layer for a language would go in the =layers/+lang/= folder.
156156

157+
Layer with no associated configuration will be rejected. For instance a layer
158+
with just a package and a hook can be easily replace by the usage of the
159+
variable =dotspacemacs-additional-packages=.
160+
157161
*** File header
158162
The file header for =elisp= files should look like the following template:
159163

README.md

+18-20
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
***
44
<p align="center"><img src="/doc/img/title2.png" alt="Spacemacs"/></p>
55
<p align="center">
6-
<b><a href="doc/DOCUMENTATION.org#core-pillars">philosophy</a></b>
6+
<b><a href="http://spacemacs.org/doc/DOCUMENTATION#orgheadline5">philosophy</a></b>
77
|
8-
<b><a href="doc/DOCUMENTATION.org#goals">goals</a></b>
8+
<b><a href="http://spacemacs.org/doc/DOCUMENTATION#orgheadline8">for whom?</a></b>
99
|
10-
<b><a href="doc/DOCUMENTATION.org#user-content-who-can-benefit-from-this">for whom?</a></b>
10+
<b><a href="http://spacemacs.org/doc/DOCUMENTATION#orgheadline7">screenshots</a></b>
1111
|
12-
<b><a href="doc/DOCUMENTATION.org#screenshots">screenshots</a></b>
13-
|
14-
<b><a href="doc/DOCUMENTATION.org">documentation</a></b>
12+
<b><a href="http://spacemacs.org/doc/DOCUMENTATION">documentation</a></b>
1513
|
1614
<b><a href="CONTRIBUTING.org">contribute</a></b>
1715
|
18-
<b><a href="doc/DOCUMENTATION.org#achievements">achievements</a></b>
16+
<b><a href="http://spacemacs.org/doc/DOCUMENTATION#orgheadline187">achievements</a></b>
1917
|
20-
<b><a href="doc/FAQ.org">FAQ</a></b>
18+
<b><a href="http://spacemacs.org/doc/FAQ">FAQ</a></b>
2119
</p>
2220
***
2321
<p align="center">
@@ -134,8 +132,9 @@ XEmacs is an old fork of Emacs. The X in its name is unrelated to X11.
134132
Both Emacs and XEmacs have graphical support.
135133

136134
**Note:** Ubuntu LTS 12.04 and 14.04 repositories have only Emacs 24.3
137-
available. You are advised to [build from source](https://www.gnu.org/software/emacs/manual/html_node/efaq/Installing-Emacs.html) Emacs 24.4 or greater, as most packages require
138-
this version. The same may be true for other distributions as well.
135+
available. You are advised to [build from source][build_source] Emacs 24.4 or
136+
greater, as most packages require this version. The same may be true for other
137+
distributions as well.
139138

140139
### OS X
141140

@@ -227,8 +226,7 @@ For efficient searches we recommend to install `pt` ([the platinum searcher][]).
227226

228227
4. Restart Emacs to complete the installation.
229228

230-
If the mode-line turns red then be sure to visit the
231-
[troubleshooting][troubleshoot] guide and consult the [FAQ][FAQ.org].
229+
If the mode-line turns red then be sure to consult the [FAQ][FAQ.org].
232230

233231
## Installation alongside another configuration
234232

@@ -372,14 +370,13 @@ Thank you!
372370

373371
[Twitter]: http://i.imgur.com/tXSoThF.png
374372
[CONTRIBUTING.org]: CONTRIBUTING.org
375-
[CONVENTIONS.org]: doc/CONVENTIONS.org
376-
[DOCUMENTATION.org]: doc/DOCUMENTATION.org
377-
[QUICK_START.org]: doc/QUICK_START.org
378-
[FAQ.org]: doc/FAQ.org
379-
[VIMUSERS.org]: doc/VIMUSERS.org
380-
[dotfile]: doc/DOCUMENTATION.org#dotfile-configuration
381-
[troubleshoot]: doc/DOCUMENTATION.org#troubleshoot
382-
[osx layer]: layers/osx/README.org
373+
[CONVENTIONS.org]: http://spacemacs.org/doc/CONVENTIONS
374+
[DOCUMENTATION.org]: http://spacemacs.org/doc/DOCUMENTATION
375+
[QUICK_START.org]: http://spacemacs.org/doc/QUICK_START
376+
[FAQ.org]: http://spacemacs.org/doc/FAQ
377+
[VIMUSERS.org]: http://spacemacs.org/doc/VIMUSERS
378+
[dotfile]: http://spacemacs.org/doc/DOCUMENTATION#orgheadline45
379+
[osx layer]: http://spacemacs.org/layers/osx/README
383380
[Gitter Chat]: https://gitter.im/syl20bnr/spacemacs
384381
[Gitter Chat IRC server]: https://irc.gitter.im/
385382
[emacs-mac-port]: https://github.com/railwaycat/homebrew-emacsmacport
@@ -395,4 +392,5 @@ Thank you!
395392
[Stack Exchange]: http://emacs.stackexchange.com/questions/tagged/spacemacs
396393
[Reddit]: https://www.reddit.com/r/spacemacs
397394
[quote01]: https://gitter.im/syl20bnr/spacemacs?at=568e627a0cdaaa62045a7df6
395+
[build_source]: https://www.gnu.org/software/emacs/manual/html_node/efaq/Installing-Emacs.html
398396
[Bountysource]: https://salt.bountysource.com/teams/spacemacs

core/core-configuration-layer.el

+90-59
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
;; This file is not part of GNU Emacs.
99
;;
1010
;;; License: GPLv3
11-
;;
12-
;;; Commentary:
13-
;;
14-
;;; Code:
1511

1612
(require 'cl-lib)
1713
(require 'eieio)
@@ -281,26 +277,40 @@ refreshed during the current session."
281277
(package-read-all-archive-contents)
282278
(unless quiet (spacemacs-buffer/append "\n")))))
283279

284-
(defun configuration-layer/sync ()
285-
"Synchronize declared layers in dotfile with spacemacs."
280+
(defun configuration-layer/sync (&optional no-install)
281+
"Synchronize declared layers in dotfile with spacemacs.
282+
If NO-INSTALL is non nil then install steps are skipped."
286283
(dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...")
287284
(when (spacemacs-buffer//choose-banner)
288285
(spacemacs-buffer//inject-version t))
289286
;; layers
290287
(setq configuration-layer--layers (configuration-layer//declare-layers))
291288
(configuration-layer//configure-layers configuration-layer--layers)
289+
(when dotspacemacs-enable-lazy-installation
290+
(configuration-layer/load-auto-layer-file))
292291
;; packages
293292
(setq configuration-layer--packages (configuration-layer//declare-packages
294293
configuration-layer--layers))
295294
(setq configuration-layer--used-distant-packages
296295
(configuration-layer//get-distant-used-packages
297296
configuration-layer--packages))
298-
(configuration-layer//install-packages
299-
(configuration-layer/filter-objects configuration-layer--used-distant-packages
300-
(lambda (x) (not (oref x :lazy-install)))))
301-
(configuration-layer//configure-packages configuration-layer--packages)
302-
(when dotspacemacs-delete-orphan-packages
303-
(configuration-layer/delete-orphan-packages configuration-layer--packages)))
297+
(unless no-install
298+
(configuration-layer//install-packages
299+
(configuration-layer/filter-objects
300+
configuration-layer--used-distant-packages
301+
(lambda (x)
302+
(not (oref x :lazy-install)))))
303+
(configuration-layer//configure-packages configuration-layer--packages)
304+
(when dotspacemacs-delete-orphan-packages
305+
(configuration-layer/delete-orphan-packages
306+
configuration-layer--packages))))
307+
308+
(defun configuration-layer/load-auto-layer-file ()
309+
"Load `auto-layer.el' file"
310+
(let ((file (concat configuration-layer-directory "auto-layer.el")))
311+
(when (file-exists-p file)
312+
(spacemacs-buffer/message "Loading auto-layer file...")
313+
(load-file file))))
304314

305315
(defun configuration-layer/create-layer ()
306316
"Ask the user for a configuration layer name and the layer
@@ -369,17 +379,18 @@ layer directory."
369379
"Make `cfgl-layer' objects from the passed layer SYMBOLS."
370380
(delq nil (mapcar 'configuration-layer/make-layer symbols)))
371381

372-
(defun configuration-layer/make-package (pkg &optional obj)
382+
(defun configuration-layer/make-package (pkg &optional obj togglep)
373383
"Return a `cfgl-package' object based on PKG.
374384
If OBJ is non nil then copy PKG properties into OBJ, otherwise create
375385
a new object.
376-
Properties that can be copied are `:location', `:step' and `:excluded'."
386+
Properties that can be copied are `:location', `:step' and `:excluded'.
387+
If TOGGLEP is non nil then `:toggle' parameter is ignored."
377388
(let* ((name-sym (if (listp pkg) (car pkg) pkg))
378389
(name-str (symbol-name name-sym))
379390
(location (when (listp pkg) (plist-get (cdr pkg) :location)))
380391
(step (when (listp pkg) (plist-get (cdr pkg) :step)))
381392
(excluded (when (listp pkg) (plist-get (cdr pkg) :excluded)))
382-
(toggle (when (listp pkg) (plist-get (cdr pkg) :toggle)))
393+
(toggle (when (and togglep (listp pkg)) (plist-get (cdr pkg) :toggle)))
383394
(protected (when (listp pkg) (plist-get (cdr pkg) :protected)))
384395
(copyp (not (null obj)))
385396
(obj (if obj obj (cfgl-package name-str :name name-sym))))
@@ -602,23 +613,30 @@ Properties that can be copied are `:location', `:step' and `:excluded'."
602613
name pkg-name)))
603614
(post-init-func (intern (format "%S/post-init-%S"
604615
name pkg-name)))
616+
(ownerp (fboundp init-func))
605617
(obj (object-assoc pkg-name :name result)))
606618
(cl-pushnew pkg-name (oref layer :packages))
607619
(if obj
608-
(setq obj (configuration-layer/make-package pkg obj))
609-
(setq obj (configuration-layer/make-package pkg))
620+
(setq obj (configuration-layer/make-package pkg obj ownerp))
621+
(setq obj (configuration-layer/make-package pkg nil ownerp))
610622
(push obj result))
611623
(oset obj :lazy-install lazy-install)
612-
(when (fboundp init-func)
624+
(when ownerp
613625
;; last owner wins over the previous one,
614626
;; still warn about mutliple owners
615627
(when (oref obj :owner)
616628
(spacemacs-buffer/warning
617629
(format (concat "More than one init function found for "
618630
"package %S. Previous owner was %S, "
619631
"replacing it with layer %S.")
620-
pkg (oref obj :owner) name)))
632+
pkg-name (oref obj :owner) name)))
621633
(oset obj :owner name))
634+
(when (and (not ownerp)
635+
(listp pkg)
636+
(spacemacs/mplist-get pkg :toggle))
637+
(spacemacs-buffer/warning
638+
(format (concat "Ignoring :toggle for package %s because "
639+
"layer %S does not own it.") pkg-name name)))
622640
(when (fboundp pre-init-func)
623641
(push name (oref obj :pre-layers)))
624642
(when (fboundp post-init-func)
@@ -629,8 +647,8 @@ Properties that can be copied are `:location', `:step' and `:excluded'."
629647
(let* ((pkg-name (if (listp pkg) (car pkg) pkg))
630648
(obj (object-assoc pkg-name :name result)))
631649
(if obj
632-
(setq obj (configuration-layer/make-package pkg obj))
633-
(setq obj (configuration-layer/make-package pkg))
650+
(setq obj (configuration-layer/make-package pkg obj t))
651+
(setq obj (configuration-layer/make-package pkg nil t))
634652
(push obj result)
635653
(oset obj :owner 'dotfile))))
636654
(dolist (xpkg dotspacemacs-excluded-packages)
@@ -649,23 +667,24 @@ Properties that can be copied are `:location', `:step' and `:excluded'."
649667
(defun configuration-layer/lazy-install (layer-name &rest props)
650668
"Configure auto-installation of layer with name LAYER-NAME."
651669
(declare (indent 1))
652-
(when dotspacemacs-enable-lazy-installation
653-
(let ((layer (object-assoc layer-name :name configuration-layer--layers))
654-
(extensions (spacemacs/mplist-get props :extensions)))
655-
(oset layer :lazy-install t)
656-
(dolist (x extensions)
657-
(let ((ext (car x))
658-
(mode (cadr x)))
659-
(add-to-list 'configuration-layer--lazy-mode-alist (cons mode ext))
660-
(add-to-list
661-
'auto-mode-alist
662-
`(,ext . (lambda ()
663-
(configuration-layer//auto-mode
664-
',layer-name ',mode)))))))))
670+
(let ((extensions (spacemacs/mplist-get props :extensions)))
671+
(when (configuration-layer/layer-usedp layer-name)
672+
(let ((layer (object-assoc layer-name
673+
:name configuration-layer--layers)))
674+
(oset layer :lazy-install t)))
675+
(dolist (x extensions)
676+
(let ((ext (car x))
677+
(mode (cadr x)))
678+
(add-to-list 'configuration-layer--lazy-mode-alist (cons mode ext))
679+
(add-to-list
680+
'auto-mode-alist
681+
`(,ext . (lambda ()
682+
(configuration-layer//auto-mode
683+
',layer-name ',mode))))))))
665684

666685
(defun configuration-layer//auto-mode (layer-name mode)
667686
"Auto mode support of lazily installed layers."
668-
(when (configuration-layer//lazy-install-packages layer-name)
687+
(when (configuration-layer//lazy-install-packages layer-name mode)
669688
(funcall mode)))
670689

671690
(defun configuration-layer/filter-objects (objects ffunc)
@@ -951,24 +970,32 @@ path."
951970
(format (concat "\nAn error occurred while installing %s "
952971
"(error: %s)\n") pkg-name err)))))))
953972

954-
(defun configuration-layer//lazy-install-packages (layer-name)
955-
"Install packages of a lazily installed layer.
973+
(defun configuration-layer//lazy-install-p (layer-name)
974+
"Return non nil if the layer with LAYER-NAME should be lazy installed."
975+
(or (not (memq layer-name configuration-layer--layers))
976+
(let ((layer (object-assoc layer-name :name configuration-layer--layers)))
977+
(oref layer :lazy-install))))
978+
979+
(defun configuration-layer//lazy-install-packages (layer-name mode)
980+
"Install layer with LAYER-NAME to support MODE.
956981
Returns non-nil if the packages have been installed."
957-
(let* ((layer (object-assoc layer-name :name configuration-layer--layers))
958-
(packages (delq nil (mapcar (lambda (x)
959-
(object-assoc
960-
x :name configuration-layer--packages))
961-
(oref layer :packages))))
962-
(pkg-count (length packages)))
963-
(when (and (oref layer :lazy-install)
964-
(yes-or-no-p (format
965-
(concat "Support for %s requires installation of "
966-
"%s package(s), do you want to install?")
967-
layer-name pkg-count)))
982+
(when (and (configuration-layer//lazy-install-p layer-name)
983+
(yes-or-no-p (format
984+
(concat "Support for %s requires installation of "
985+
"layer %s, do you want to install it?")
986+
mode layer-name)))
987+
(when (dotspacemacs/add-layer layer-name)
988+
(configuration-layer/sync 'no-install))
989+
(let* ((layer (object-assoc layer-name :name configuration-layer--layers))
990+
(packages (delq nil
991+
(mapcar (lambda (x)
992+
(object-assoc
993+
x :name configuration-layer--packages))
994+
(oref layer :packages)))))
968995
(configuration-layer//install-packages packages)
969996
(configuration-layer//configure-packages packages)
970997
(oset layer :lazy-install nil))
971-
(not (oref layer :lazy-install))))
998+
t))
972999

9731000
(defun configuration-layer//install-packages (packages)
9741001
"Install PACKAGES which are not lazy installed."
@@ -1566,28 +1593,32 @@ to select one."
15661593
(when ext (push (cons mode ext) result)))))
15671594
result))
15681595

1569-
(defun configuration-layer//insert-lazy-install-form (mode ext)
1596+
(defun configuration-layer//insert-lazy-install-form (layer-name mode ext)
15701597
"Insert a configuration form for lazy installation of MODE."
15711598
(let ((str (concat "(configuration-layer/lazy-install '"
1572-
(symbol-name mode)
1599+
(symbol-name layer-name)
15731600
" :extensions '("
15741601
(let ((print-quoted t)) (prin1-to-string ext))
1602+
" "
1603+
(symbol-name mode)
15751604
"))\n")))
15761605
(insert str)))
15771606

15781607
(defun configuration-layer/insert-lazy-install-configuration ()
15791608
"Prompt for a layer and insert the forms to configure lazy installation."
15801609
(interactive)
1581-
(let ((layer-sym
1582-
(completing-read
1583-
"Choose a used layer"
1584-
(sort (object-assoc-list :name configuration-layer--layers)
1585-
(lambda (x y)
1586-
(string< (oref (cdr x) :name) (oref (cdr y) :name)))))))
1610+
(let ((layer-name
1611+
(intern (completing-read
1612+
"Choose a used layer"
1613+
(sort (object-assoc-list :name configuration-layer--layers)
1614+
(lambda (x y)
1615+
(string< (oref (cdr x) :name)
1616+
(oref (cdr y) :name))))))))
15871617
(let ((mode-exts (configuration-layer//lazy-install-extensions-for-layer
1588-
(intern layer-sym))))
1618+
layer-name)))
15891619
(dolist (x mode-exts)
1590-
(configuration-layer//insert-lazy-install-form (car x) (cdr x))))))
1620+
(configuration-layer//insert-lazy-install-form
1621+
layer-name (car x) (cdr x))))))
15911622

15921623
(defun configuration-layer//increment-error-count ()
15931624
"Increment the error counter."

core/core-documentation.el

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
(defvar spacemacs--category-names
2121
'(("config-files" . "Configuration files")
2222
("email" . "E-mail")
23-
("irc" . "IRC")
24-
("lang" . "Programming and markup languages"))
23+
("intl" . "International support")
24+
("lang" . "Programming and markup languages")
25+
("os" . "Operating systems")
26+
("spacemacs" . "Spacemacs distribution layers"))
2527
"Special names for categories. Used to generate the layers list.")
2628

2729
(defun spacemacs//generate-layers-from-path (path level)

0 commit comments

Comments
 (0)