Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Perspectives lazy loading #2845

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
20949bd
Pimp perspectives layer (using persp-mode)
CestDiego Sep 30, 2015
1104810
Remove spaceline configuration
TheBB Nov 2, 2015
ad10503
Merge pull request #7 from TheBB/perspectives-fix
CestDiego Nov 2, 2015
33a19b4
Fix LaTeX flyspell hook
TheBB Nov 2, 2015
212389b
Fix doc publishing code
TheBB Nov 2, 2015
ac14e3f
Document auto-dictionary limitations
StreakyCobra Nov 2, 2015
302ae03
Move the dictionary selection code into adict hook
StreakyCobra Nov 2, 2015
eafec19
spell-checking: replace lambda by named function
syl20bnr Nov 3, 2015
02fb2bd
Disable automatic call to flyspell-buffer
StreakyCobra Nov 2, 2015
c2ae7ce
Move recentf initialization to :init section
duerrp Nov 3, 2015
fb36140
Increase number of stored recent files to 1000
duerrp Nov 3, 2015
25c9d12
Refactor spacemacs-base/init-recentf
syl20bnr Nov 3, 2015
b19e6f1
Add SPC hdF describe-face binding
TheBB Nov 2, 2015
6b2da3c
Add doc for describe-face binding
syl20bnr Nov 3, 2015
4dc3b12
force haskell loading in cabal files
d12frosted Nov 2, 2015
bb80e94
haskell: replace lambda with a named function
syl20bnr Nov 3, 2015
5f7c3d0
Add the lorem-ipsum package
StreakyCobra Nov 2, 2015
34ce7a0
Move lorem ipsum to `SPC x i l` and declare prefixes
syl20bnr Nov 3, 2015
612c3df
Introduce 'relative for global-line-numbers
StreakyCobra Nov 2, 2015
b405752
Remove global infix in dotspacemacs-global-line-numbers
syl20bnr Nov 3, 2015
f3b99d6
Make OCaml-generated files invisible to completion
StreakyCobra Nov 2, 2015
02542d6
scala: Fix bindings for Ensime test commands
Nov 2, 2015
946fd8c
Fix vinegar keybindings
fbergroth Nov 2, 2015
1a7bc42
scala: Enable Ensime’s Expand Region integration
Nov 2, 2015
e29125e
Use q to exit macrostep
punassuming Nov 1, 2015
44109c3
Add ace-jump-helm-line for quick helm navigation.
punassuming Nov 1, 2015
df003f2
Defer ace-jump-helm-line and move it to C-q
syl20bnr Nov 3, 2015
500c22e
Helm locate automatically sets the locate command
punassuming Nov 1, 2015
b7fff9e
Actually disable flyspell buffer in flyspell hook
TheBB Nov 3, 2015
0567f5c
Fix spacemacs/kill-other-buffers
TheBB Nov 3, 2015
9ef2bf3
Pimp perspectives layer (using persp-mode)
CestDiego Sep 30, 2015
5b2c747
Merge branch 'perspectives-fix' of github.com:CestDiego/spacemacs int…
CestDiego Nov 3, 2015
9bd87da
Prefix `persp-curr-name`
CestDiego Nov 3, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
auto-save-list/
elpa/
doc/export/
export/
ac-comphist.dat
eproject.lst
.smex-items
Expand Down
10 changes: 5 additions & 5 deletions core/core-documentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(dolist (l layers)
(let ((layer-name (file-name-nondirectory l))
(target-path (concat (file-relative-name
l (concat user-emcas-directory "layers"))
l (concat user-emacs-directory "layers"))
"/README.org")))
(insert (format "- [[file:%s][%s]]\n" target-path layer-name))))
(dolist (c categories)
Expand All @@ -46,7 +46,7 @@
(message "%S" category-name)
(unless (string= "distribution" category-name)
(insert (format "\n%s %s\n" level pretty-name))
(spacemacs/generate-layers-from-path c (concat level "*"))
(spacemacs//generate-layers-from-path c (concat level "*"))
)))))

(defun spacemacs//generate-layers-file ()
Expand Down Expand Up @@ -75,7 +75,7 @@
src=\"http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js\"></script>
<script type=\"text/javascript\"
src=\"http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js\"></script>")
(publish-target (concat spacemacs-docs-directory "export/"))
(publish-target (concat user-emacs-directory "export/"))
(org-publish-project-alist
`(("spacemacs"
:components ("spacemacs-doc"
Expand All @@ -95,7 +95,7 @@
:recursive t
:publishing-directory ,(concat publish-target "layers/")
:publishing-function org-html-publish-to-html
:preparation-function spacemacs/generate-layers-file
:preparation-function spacemacs//generate-layers-file
:exclude "extensions"
:html-head ,header)
("spacemacs-doc-static"
Expand All @@ -106,7 +106,7 @@
:publishing-function org-publish-attachment)
("layers-doc-static"
:base-directory ,(concat user-emacs-directory "layers/")
:base-extension "png"
:base-extension "jpg\\|png"
:recursive t
:publishing-directory ,(concat publish-target "layers/")
:publishing-function org-publish-attachment))))
Expand Down
5 changes: 3 additions & 2 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ can be toggled through `toggle-transparency'.")
overrides the default behavior of Emacs which recenters the point when
it reaches the top or bottom of the screen.")

(defvar dotspacemacs-global-line-numbers nil
"If non nil line numbers are turned on in all `prog-mode' and `text-mode'.")
(defvar dotspacemacs-line-numbers nil
"If non nil line numbers are turned on in all `prog-mode' and `text-mode'
derivatives. If set to `relative', also turns on relative line numbers.")

(defvar dotspacemacs-persistent-server nil
"If non nil advises quit functions to keep server open when quitting.")
Expand Down
5 changes: 3 additions & 2 deletions core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ values."
;; scrolling overrides the default behavior of Emacs which recenters the
;; point when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t
;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'.
;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'
;; derivatives. If set to `relative', also turns on relative line numbers.
;; (default nil)
dotspacemacs-global-line-numbers nil
dotspacemacs-line-numbers nil
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
;; (default nil)
dotspacemacs-smartparens-strict-mode nil
Expand Down
72 changes: 41 additions & 31 deletions doc/DOCUMENTATION.org
Original file line number Diff line number Diff line change
Expand Up @@ -941,11 +941,17 @@ and ~T~):

**** Global line numbers
Line numbers can be toggled on in all =prog-mode= and =text-mode= buffers by
setting the =dotspacemacs-global-line-numbers= variable in your =~/.spacemacs=
to something different than =nil=:
setting the =dotspacemacs-line-numbers= variable in your =~/.spacemacs=
to something different than =nil=.

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-global-line-numbers t)
(setq-default dotspacemacs-line-numbers t)
#+END_SRC

If it is set to =relative=, line numbers are show in a relative way:

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-line-numbers 'relative)
#+END_SRC

*** Mouse usage
Expand Down Expand Up @@ -1312,6 +1318,7 @@ thusly:
| ~SPC h d b~ | describe bindings in a =helm= buffer |
| ~SPC h d c~ | describe current character under point |
| ~SPC h d f~ | describe a function |
| ~SPC h d F~ | describe a face |
| ~SPC h d k~ | describe a key |
| ~SPC h d m~ | describe current modes |
| ~SPC h d p~ | describe a package |
Expand Down Expand Up @@ -2105,34 +2112,37 @@ adding a major-mode to the variable =spacemacs-indent-sensitive-modes= in your
*** Text manipulation commands
Text related commands (start with ~x~):

| Key Binding | Description |
|-------------+---------------------------------------------------------------|
| ~SPC x o~ | use avy to select a link in the buffer and open it |
| ~SPC x u~ | set the selected text to lower case |
| ~SPC x U~ | set the selected text to upper case |
| ~SPC x a a~ | align region (or guessed section) using default rules |
| ~SPC x a r~ | align region using user-specified regexp |
| ~SPC x a m~ | align region at arithmetic operators (+-*/) |
| ~SPC x a .~ | align region at . (for numeric tables) |
| ~SPC x a ,~ | align region at , |
| ~SPC x a ;~ | align region at ; |
| ~SPC x a =~ | align region at = |
| ~SPC x a &~ | align region at & |
| ~SPC x a ¦~ | align region at ¦ |
| ~SPC x c~ | count the number of chars/words/lines in the selection region |
| ~SPC x d w~ | delete trailing whitespaces |
| ~SPC x g l~ | set languages used by translate commands |
| ~SPC x g t~ | translate current word using Google Translate |
| ~SPC x g T~ | reverse source and target languages |
| ~SPC x J~ | move down a line of text (enter micro-state) |
| ~SPC x K~ | move up a line of text (enter micro-state) |
| ~SPC x l s~ | sort lines |
| ~SPC x l u~ | uniquify lines |
| ~SPC x t c~ | swap (transpose) the current character with the previous one |
| ~SPC x t w~ | swap (transpose) the current word with the previous one |
| ~SPC x t l~ | swap (transpose) the current line with the previous one |
| ~SPC x w c~ | count the number of occurrences per word in the select region |
| ~SPC x w d~ | show dictionary entry of word from wordnik.com |
| Key Binding | Description |
|---------------+---------------------------------------------------------------|
| ~SPC x o~ | use avy to select a link in the buffer and open it |
| ~SPC x u~ | set the selected text to lower case |
| ~SPC x U~ | set the selected text to upper case |
| ~SPC x a a~ | align region (or guessed section) using default rules |
| ~SPC x a r~ | align region using user-specified regexp |
| ~SPC x a m~ | align region at arithmetic operators (+-*/) |
| ~SPC x a .~ | align region at . (for numeric tables) |
| ~SPC x a ,~ | align region at , |
| ~SPC x a ;~ | align region at ; |
| ~SPC x a =~ | align region at = |
| ~SPC x a &~ | align region at & |
| ~SPC x a ¦~ | align region at ¦ |
| ~SPC x c~ | count the number of chars/words/lines in the selection region |
| ~SPC x d w~ | delete trailing whitespaces |
| ~SPC x g l~ | set languages used by translate commands |
| ~SPC x g t~ | translate current word using Google Translate |
| ~SPC x g T~ | reverse source and target languages |
| ~SPC x i l l~ | insert lorem-ipsum list |
| ~SPC x i l p~ | insert lorem-ipsum paragraph |
| ~SPC x i l s~ | insert lorem-ipsum sentence |
| ~SPC x J~ | move down a line of text (enter micro-state) |
| ~SPC x K~ | move up a line of text (enter micro-state) |
| ~SPC x l s~ | sort lines |
| ~SPC x l u~ | uniquify lines |
| ~SPC x t c~ | swap (transpose) the current character with the previous one |
| ~SPC x t w~ | swap (transpose) the current word with the previous one |
| ~SPC x t l~ | swap (transpose) the current line with the previous one |
| ~SPC x w c~ | count the number of occurrences per word in the select region |
| ~SPC x w d~ | show dictionary entry of word from wordnik.com |

*** Searching and inserting Unicode characters
You can very easily search for and insert Unicode characters into the
Expand Down
3 changes: 2 additions & 1 deletion layers/+distribution/spacemacs-base/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
("xa" "align")
("xd" "delete")
("xg" "google-translate")
("xi" "insert")
("xl" "lines")
("xm" "move")
("xt" "transpose")
Expand Down Expand Up @@ -172,7 +173,7 @@ It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'."
(setq column-number-mode t)
;; Activate linum-mode in all prog-mode and text-mode buffers if the setting is
;; enabled.
(when dotspacemacs-global-line-numbers
(when dotspacemacs-line-numbers
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode))
;; line number
Expand Down
7 changes: 3 additions & 4 deletions layers/+distribution/spacemacs-base/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,9 @@ argument takes the kindows rotate backwards."
(defun spacemacs/kill-other-buffers ()
"Kill all other buffers."
(interactive)
(let (name (buffer-name))
(when (yes-or-no-p (format "Killing all buffers except \"%s\" ? " buffer-file-name))
(mapc 'kill-buffer (delq (current-buffer) (buffer-list)))
(message "Buffers deleted!"))))
(when (yes-or-no-p (format "Killing all buffers except \"%s\"? " (buffer-name)))
(mapc 'kill-buffer (delq (current-buffer) (buffer-list)))
(message "Buffers deleted!")))

;; from http://dfan.org/blog/2009/02/19/emacs-dedicated-windows/
(defun spacemacs/toggle-current-window-dedication ()
Expand Down
44 changes: 30 additions & 14 deletions layers/+distribution/spacemacs-base/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,6 @@ Removes the automatic guessing of the initial value based on thing at point. "
helm-semantic-fuzzy-match t
helm-buffers-fuzzy-matching t)

;; helm-locate uses es (from everything on windows, which doesnt like fuzzy)
(setq helm-locate-fuzzy-match (executable-find "locate"))

;; Use helm to provide :ls, unless ibuffer is used
(unless (configuration-layer/package-usedp 'ibuffer)
(evil-ex-define-cmd "buffers" 'helm-buffers-list))
Expand Down Expand Up @@ -623,6 +620,15 @@ Removes the automatic guessing of the initial value based on thing at point. "
(switch-to-buffer-other-window "*hgrep*")
(message "No previous search buffer found"))))

(defun spacemacs/helm-faces ()
"Describe face."
(interactive)
(require 'helm-elisp)
(let ((default (thing-at-point 'symbol)))
(helm :sources (list (helm-def-source--emacs-faces default))
:buffer "*helm faces*"
:preselect (and default (concat "\\_<" (regexp-quote default) "\\_>")))))

;; use helm by default for M-x
(unless (configuration-layer/package-usedp 'smex)
(global-set-key (kbd "M-x") 'helm-M-x))
Expand All @@ -636,6 +642,7 @@ Removes the automatic guessing of the initial value based on thing at point. "
"fL" 'helm-locate
"fr" 'helm-recentf
"hb" 'helm-filtered-bookmarks
"hdF" 'spacemacs/helm-faces
"hi" 'helm-info-at-point
"hl" 'helm-resume
"hm" 'helm-man-woman
Expand Down Expand Up @@ -724,6 +731,11 @@ Removes the automatic guessing of the initial value based on thing at point. "
:config
(progn
(helm-mode +1)

;; helm-locate uses es (from everything on windows, which doesnt like fuzzy)
(helm-locate-set-command)
(setq helm-locate-fuzzy-match (string-match "locate" helm-locate-command))

(defun spacemacs//set-dotted-directory ()
"Set the face of diretories for `.' and `..'"
(set-face-attribute 'helm-ff-dotted-directory
Expand Down Expand Up @@ -1246,18 +1258,22 @@ ARG non nil means that the editing style is `vim'."
(use-package recentf
:defer t
:init
;; lazy load recentf
(add-hook 'find-file-hook (lambda () (unless recentf-mode
(recentf-mode)
(recentf-track-opened-file))))
(progn
;; lazy load recentf
(add-hook 'find-file-hook (lambda () (unless recentf-mode
(recentf-mode)
(recentf-track-opened-file))))
(setq recentf-save-file (concat spacemacs-cache-directory "recentf")
recentf-max-saved-items 1000
recentf-auto-cleanup 'never
recentf-auto-save-timer (run-with-idle-timer 600 t
'recentf-save-list)))
:config
(add-to-list 'recentf-exclude (expand-file-name spacemacs-cache-directory))
(add-to-list 'recentf-exclude (expand-file-name package-user-dir))
(add-to-list 'recentf-exclude "COMMIT_EDITMSG\\'")
(setq recentf-save-file (concat spacemacs-cache-directory "recentf"))
(setq recentf-max-saved-items 100)
(setq recentf-auto-cleanup 'never)
(setq recentf-auto-save-timer (run-with-idle-timer 600 t 'recentf-save-list))))
(progn
(add-to-list 'recentf-exclude
(expand-file-name spacemacs-cache-directory))
(add-to-list 'recentf-exclude (expand-file-name package-user-dir))
(add-to-list 'recentf-exclude "COMMIT_EDITMSG\\'"))))

(defun spacemacs-base/init-restart-emacs()
(use-package restart-emacs
Expand Down
29 changes: 27 additions & 2 deletions layers/+distribution/spacemacs/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
(setq spacemacs-packages
'(
;; default
ace-jump-helm-line
ace-link
ace-window
adaptive-wrap
Expand Down Expand Up @@ -68,6 +69,7 @@
open-junk-file
leuven-theme
linum-relative
lorem-ipsum
move-text
neotree
pcre2el
Expand All @@ -91,6 +93,13 @@

;; Initialization of packages

(defun spacemacs/init-ace-jump-helm-line ()
(use-package ace-jump-helm-line
:defer t
:init
(with-eval-after-load 'helm
(define-key helm-map (kbd "C-q") 'ace-jump-helm-line))))

(defun spacemacs/init-ace-link ()
(use-package ace-link
:commands spacemacs/ace-buffer-links
Expand Down Expand Up @@ -1458,13 +1467,29 @@ It will toggle the overlay under point or create an overlay of one character."

(defun spacemacs/init-linum-relative ()
(use-package linum-relative
:commands linum-relative-toggle
:commands (linum-relative-toggle linum-relative-on)
:init
(evil-leader/set-key "tr" 'linum-relative-toggle)
(progn
(when (eq dotspacemacs-line-numbers 'relative)
(linum-relative-on))
(evil-leader/set-key "tr" 'linum-relative-toggle))
:config
(progn
(setq linum-relative-current-symbol ""))))

(defun spacemacs/init-lorem-ipsum ()
(use-package lorem-ipsum
:commands (lorem-ipsum-insert-list
lorem-ipsum-insert-paragraphs
lorem-ipsum-insert-sentences)
:init
(progn
(spacemacs/declare-prefix "xil" "lorem ipsum")
(evil-leader/set-key
"xill" 'lorem-ipsum-insert-list
"xilp" 'lorem-ipsum-insert-paragraphs
"xils" 'lorem-ipsum-insert-sentences))))

(defun spacemacs/init-move-text ()
(use-package move-text
:defer t
Expand Down
1 change: 1 addition & 0 deletions layers/+lang/emacs-lisp/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
:mode ("\\*.el\\'" . emacs-lisp-mode)
:init
(progn
(evil-define-key 'normal macrostep-keymap "q" 'macrostep-collapse-all)
(spacemacs|define-micro-state macrostep
:doc "[e] expand [c] collapse [n/N] next/previous [q] quit"
:disable-evil-leader t
Expand Down
7 changes: 7 additions & 0 deletions layers/+lang/haskell/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
(defun haskell/init-haskell-mode ()
(use-package haskell-mode
:defer t
:init
(progn
(defun spacemacs//force-haskell-mode-loading ()
"Force `haskell-mode' loading when visiting cabal file."
(require 'haskell-mode))
(add-hook 'haskell-cabal-mode-hook
'spacemacs//force-haskell-mode-loading))
:config
(progn
;; Haskell main editing mode key bindings.
Expand Down
2 changes: 1 addition & 1 deletion layers/+lang/latex/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
(spacemacs/add-flycheck-hook 'LaTeX-mode))

(defun latex/post-init-flyspell ()
(add-hook 'LaTeX-mode-hook 'flyspell-mode))
(spell-checking/add-flyspell-hook 'LaTeX-mode))

(defun latex/post-init-smartparens ()
(add-hook 'LaTeX-mode-hook 'smartparens-mode))
Expand Down
5 changes: 4 additions & 1 deletion layers/+lang/ocaml/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@
(spacemacs//init-ocaml-opam)
(evil-leader/set-key-for-mode 'tuareg-mode
"mga" 'tuareg-find-alternate-file
"mcc" 'compile))
"mcc" 'compile)
;; Make OCaml-generated files invisible to filename completion
(dolist (ext '(".cmo" ".cmx" ".cma" ".cmxa" ".cmi" ".cmxs" ".cmt" ".annot"))
(add-to-list 'completion-ignored-extensions ext)))
:config
(when (fboundp 'sp-local-pair)
;; don't auto-close apostrophes (type 'a = foo) and backticks (`Foo)
Expand Down
Loading