Commit graph

446 commits

Author SHA1 Message Date
Miciah Masters 31f4c2a005 Advise rename-buffer when persp-mode activated
Before this commit, spacemacs-layouts/init-eyebrowse advised rename-buffer
with spacemacs//fixup-window-config.  However, this advice causes problems
if persp-mode is not activated when a function tries to rename a buffer.

In particular, Spacemacs's CI uses Emacs's batch mode to run
spacemacs/publish-doc, which uses rename-buffer.  In batch mode, persp-mode
is not activated, and consequently spacemacs/publish-doc was failing:

    Publishing file /home/travis/.emacs.d/news/news01.org using ‘org-html-publish-to-html’
    Skipping check for new version (reason: dotfile)
    Wrong type argument: hash-table-p, nil
    Warning (emacs): recentf mode: Wrong type argument: hash-table-p, nil
    spacemacs/publish-doc failed

In order to avoid problems, this commit moves the advising of rename-buffer
from spacemacs-layouts/init-eyebrowse to spacemacs//activate-persp-mode.

* layers/+spacemacs/spacemacs-layouts/packages.el
(spacemacs-layouts/init-eyebrowse): Move advice from here...
* layers/+spacemacs/spacemacs-layouts/funcs.el
(spacemacs//activate-persp-mode): ...to here.
2018-08-23 10:29:37 +01:00
Miciah 4972855231 Fix updating buffer names in window configurations
Eyebrowse stores window configurations for workspaces in frame properties.
These window configurations reference buffers by name, which means that
these references must be updated when a buffer is renamed.  To this end,
eyebrowse advises rename-buffer.

Spacemacs integrates eyebrowse with persp-mode by saving the eyebrowse
workspaces for a perspective as a parameter for that perspective so that
Spacemacs can restore a perspective's workspaces when switching to that
perspective.  However, eyebrowse's advice for rename-buffer fails to update
inactive workspaces, for which the window configurations are stored in
perspective parameters and not frame properties.

This commit disables eyebrowse's advice and adds perspective-aware advice
to update buffer references in workspace window configurations.

* layers/+spacemacs/spacemacs-layouts/funcs.el
(spacemacs//fixup-window-configs): New.
* layers/+spacemacs/spacemacs-layouts/packages.el
(spacemacs-layouts/init-eyebrowse): Remove eyebrowse-fixup-window-configs
advice for rename-buffer and advise with spacemacs//fixup-window-configs
instead.
2018-08-21 23:27:31 +03:00
Masayuki Takemura c2e377c902 spacemacs-defaults: add a keybind to open a file and replace buffer with it
Define an alias and use it internally so that (1) the name of the command will
be better to understand what it does than the original name and (2) Helm or Ivy
interface is invoked instead of Ido.

These are suggested in PR #11115.
2018-08-21 00:55:37 +03:00
Miciah Masters 6058921a02 layouts: Add free buffers to current layout
This fixes issue #5776.

* layers/+spacemacs/spacemacs-layouts/packages.el
(spacemacs-layouts/init-persp-mode):
Set persp-add-buffer-on-after-change-major-mode to 'free.
2018-08-09 22:43:11 +01:00
Miciah def07cbfa3 Fix smart-closing-parenthesis extra parenthesis
Fix issue #9477: spacemacs/smart-closing-parenthesis sometimes adds an
extra closing parenthesis.

spacemacs/smart-closing-parenthesis may call sp-up-sexp twice: first to
find the position of an existing closing delimiter or the position at which
one would be inserted, and second to insert a delimiter if necessary or
else move point after the existing closing delimiter.

The problem is that each call to sp-up-sexp may insert a delimiter, but
spacemacs/smart-closing-parenthesis is supposed to insert at most one.

The solution is to undo any edit performed by the first call to sp-up-sexp.

* layers/+spacemacs/spacemacs-editing/funcs.el: Undo any edit performed by
the first call to sp-up-sexp.
2018-08-04 10:48:00 -04:00
Miciah Masters 1ecffa9834 Bind SPC f i to spacemacs/insert-file 2018-08-01 22:46:40 -04:00
Miciah Masters 07964b1a2e Work around ido-mode remapping Spacemacs keys
Add aliases for commands that ido-mode remaps that we want to bind to
Spacemacs keys, and use these aliases in the Spacemacs key bindings so that
these bindings invoke the original commands rather than the ido commands.

See <https://github.com/syl20bnr/spacemacs/issues/10237#issuecomment-359861570>.
2018-08-01 22:46:40 -04:00
syl20bnr 1ae5463051 Correctly lazy-load and disable zone 2018-07-29 15:42:32 -04:00
Kechao CAI 115c93050f +spacemacs: fix zone init
Commit 6f15744 causes the zone initialization error. This will fix #11101.
2018-07-29 15:32:31 -04:00
syl20bnr 6f157449c1 Fix zone-out-when-idle and correctly disable it when nil 2018-07-28 18:32:23 -04:00
Jesse Byler 1671f53f93 Add function spacemacs/new-empty-buffer-new-frame with binding
Add new function spacemacs/new-empty-buffer-new-frame, implemented
with a new selector in spacemacs/new-empty-buffer.  Bind it to
<SPC> b N f
2018-07-23 23:52:31 +03:00
bmag 4f70a9abcc Load evil-surround when entering operator state
Only using visual state as entry point for evil-surround doesn't guarantee
surround is available for evil-yank and evil-delete. Fixed by also using
operator state.

Fixes #11019 and #11021
2018-07-12 11:56:20 +03:00
Codruț Constantin Gușoi e2c0250548 Clarifies the zero based column indexing with messages and docs 2018-07-12 09:13:02 +03:00
Miciah 899e6beaac Fix and rename column-indexing toggle
The column-indexing toggle did not have a :status property.  As a result,
the toggle command would enable the toggle but would not disable it.  In
addition, the absence of :status prevented -off and -on commands from being
defined.

This commit adds a :status property so that the toggle works properly and
-off and -on commands are defined.

This commit also renames the toggle to "zero-based-column-indexing" in order to
make its purpose clearer.

* layers/+spacemacs/spacemacs-defaults/keybindings.el (column-indexing):
Add :status and rename to "zero-based-column-indexing".
2018-07-10 18:17:57 -04:00
FieryCod 41e9671a4d Fix the projectile layer 2018-07-09 23:17:08 +02:00
syl20bnr 4dbd5e6110 Disable evil-ediff for now 2018-07-04 02:36:59 -04:00
Codruț Constantin Gușoi 31264ffc84 Fixes errors when restoring a perspective
The function ends up being called with an argument due to the before advice.
2018-07-04 01:17:28 +03:00
syl20bnr a013d86874 core: update environment variables management
* add new dotfile function `dotspacemacs/user-env`
* add ignored env. vars with variable spacemacs-ignored-environment-variables
* ignore env vars: SSH_AUTH_SOCK and DBUS_SESSION_BUS_ADDRESS
* update documentation in DOCUMENTATION.org
* update .spacemacs.template with new function
* rename environment file from spacemacs.env to .spacemacs.env
* move location of .spacemacs.env file to home or dotdirectory
* add a header to the generated .spacemacs.env file to explain what it is
* make SPC f e e fallbacks to the function dotspacemacs/user-env if the user
  manages the env var by themselves
* make SPC f e E call the new function dotspacemacs/user-env
* sort environment variables in .spacemacs.env file
2018-07-03 01:25:28 -04:00
Codruț Constantin Gușoi aba51afe48 Multiple ways to copy a file path 2018-06-29 01:09:54 +03:00
bmag b54ea8ef90 line-nums: don't default to text/prog-mode if disabled by user
When :enabled-for-modes is nil we default it to '(prog-mode text-mode), but if
any of them is in :disabled-for-modes then it shouldn't be enabled by default.
This commit fixes the second part.
2018-06-27 09:13:21 +03:00
simendsjo dc6130a714 Adds *Process List* to popwin:special-display-config
`list-processes` would not focus the newly created window as it was missing from popwin.
2018-06-26 09:11:17 +03:00
syl20bnr 6220ace290 core: rework environment variables and PATH management
See updated DOCUMENTATION.org and FAQ.org for more info.

* add core-env.el
* add library load-env-vars.el
* add bootstrap package dotenv-mode.el
* remove spacemacs-environment from bootstrap layer
* remove dotspacemacs variable dotspacemacs-import-env-vars-from-shell
* remove dotspacemacs variable dotspacemacs-improt-env-vars-shell-file-name
* add new key binding SPC f e e to open spacemacs.env file
* add new key binding SPC f e E to reload environment variable from env file
* add new key binding SPC f e C-e to re-initialize the env file from shell.
2018-06-25 02:55:28 -04:00
Codruț Constantin Gușoi bb013ef993 Remove obsolete purpose-conf argument for good
Now that emacs 25 is the minimum version supported this should not cause any more problems.
2018-06-20 23:56:41 +03:00
bmag 6b4a79d398 spaceline: fix copy-paste error in lazy-load hook name
Commit d7f5b58890 added a lazy-loader for
spaceline but used lazy-load-window-purpose as its name. As result,
window-purpose lazy-loader got overwritten and window-purpose didn't load at
all.
2018-06-20 09:51:45 +03:00
Kalle Lindqvist 378fa687a1 Move helm variable from helm layer to spacemacs-completion layer 2018-06-16 00:02:59 -04:00
syl20bnr 54ace2e998 Fix lazy loading of evil-escape
Add transient hook on window-configuration-change-hook
2018-06-15 03:09:14 -04:00
syl20bnr 5ab0b7918e Lazy load evil-escape 2018-06-14 21:54:39 -04:00
syl20bnr 9d7c1c8adf Lazy load evil-numbers 2018-06-14 21:54:39 -04:00
syl20bnr 8281ed74ae Lazy load evil-lion 2018-06-14 21:54:39 -04:00
syl20bnr 03786aa94a Lazy load evil-surround 2018-06-14 21:54:39 -04:00
syl20bnr fc08a3b9c1 Lazy load evil-exchange 2018-06-14 21:54:39 -04:00
syl20bnr 8425d16c55 Lazy load evil-indent-plus 2018-06-14 21:54:39 -04:00
syl20bnr c50ff88812 Lazy load evil-args 2018-06-14 21:51:31 -04:00
syl20bnr 381584d1cc Lazy load ido-vertical 2018-06-14 21:23:59 -04:00
syl20bnr 3b06108161 Lazy load evil-goggles 2018-06-14 21:23:12 -04:00
syl20bnr ad3ee59158 Smart lazy load of line numbers 2018-06-14 21:23:02 -04:00
syl20bnr 36c5cb0725 Lazy load zone 2018-06-14 21:10:01 -04:00
syl20bnr c1c8dec3ea Lazy load flx-ido 2018-06-14 21:09:40 -04:00
Jason Axelson d01658ec61 Additional documentation for spacemacs/toggle-current-window-dedication 2018-06-14 20:12:16 -04:00
Kalle Lindqvist 2007ce3f1a spacemacs-navigation: remove duplicate code 2018-06-14 20:07:35 -04:00
syl20bnr d7f5b58890 spaceline: find a new way to speed it up without lazy loading it
Remove byte-compilation a startup time and put compilation of the mode line in
a window configuration change hook.
2018-06-14 10:08:38 -04:00
syl20bnr 33c62b7d60 spaceline: define toggles at init time 2018-06-14 09:33:33 -04:00
syl20bnr 8b40cacc5e Load window purpose only when window configuration changes 2018-06-14 02:28:52 -04:00
syl20bnr d19a20beb4 Load window-purpose when window configuration changes 2018-06-14 02:07:02 -04:00
syl20bnr ea0f73ec31 Defer volatile hightlight by 2 seconds
This takes some time to load and it is not a useful package for quick edits
2018-06-14 02:06:19 -04:00
syl20bnr de858b2953 Fix startup buffers without spaceline mode line 2018-06-14 01:10:44 -04:00
syl20bnr 55d18a1a3a Move SPC s c to bootsrap layer 2018-06-14 00:21:56 -04:00
Daniel Molina 55e0506ef0 Fix typos 2018-06-14 00:15:49 -04:00
Benjamin Reynolds 594fdc8f05 Rename spacemacs/mplist-get functions to be more descriptive
* spacemacs/mplist-get -> spacemacs/mplist-get-values
* spacemacs/plist-get -> spacemacs/mplist-get-value
* refactor spacemacs/mplist-get-value to be defined in terms of mplist-get-values

Ref #10803 See [comment]

[comment]: https://github.com/syl20bnr/spacemacs/pull/10803#issuecomment-395292606
2018-06-14 00:15:49 -04:00
Codruț Constantin Gușoi 8ad78ca7d3 Brings back search highlight clear 2018-06-12 22:43:22 +03:00