Commit Graph

68 Commits

Author SHA1 Message Date
duianto 61ff12cbfc [base] Show a winum required message
problem:
key bindings that use the winum package,
don't work in the spacemacs-base distribution.

for example in the buffer transient state: SPC b .
{number}, C-{number} or M-{number}

shows messages like these:
Wrong type argument: commandp, winum-select-window-1
Symbol’s function definition is void: winum-get-window-by-number

cause:
the winum package is loaded in the spacemacs-navigation layer,
but the layer isn't used in the spacemacs-base distribution.

solution:
show the message:
This command requires the winum package,
winum is part of the spacemacs-navigation layer.
2021-01-09 08:40:32 +01:00
duianto 8128774090 Handle buffer move/select/swap to last win nr +1 in all frames 2020-11-19 12:36:07 +01:00
Keith Pinson 61fc17c6ee [core] clear search highlights on narrow to indirect buffer
This avoids more problems found by @duianto.

Also:
* Use more descriptive variable names
* Print message explaining lack of narrowing in visual block mode
2020-10-31 09:15:12 +01:00
Keith Pinson 82974b454e [core] fix visual modes for narrow to indirect buffer
* Apply @duianto's fix to only activate visual selection it if it was active
  previous to the creation of the indirect buffer
* Block use of visual block mode because of continuing problems in that mode,
  and its questionable usefulness in this case
* Extract commonalities out of the narrowing functions
* Make the new keybindings into a list in the changelog for readability, per
  @duianto
2020-10-31 08:57:46 +01:00
Keith Pinson 5b4b6af8d3 [core] fix narrow to indirect buffer from visual mode 2020-10-31 08:57:46 +01:00
Keith Pinson 603d7fbe0b [core] provide keybindings for using narrow with an indirect buffer
This is useful if you want multiple narrowing in the same base buffer.

Fixes #12550 with proposed bindings by @duianto.
2020-10-31 08:57:46 +01:00
Ray Wang 905d4392c5
Add `spacemacs-scratch-mode-hook`
Also run-hooks in spacemacs/switch-to-scratch-buffer

update CHANGELOG.develop and retrigger workflow
2020-10-23 18:34:25 +02:00
duianto 0f65b000da
Handle buffer move/select/swap to last win nr +1 (#14015)
problem:
The following error messages are shown.

When trying to move, select or swap the current buffer,
to a window nr greater than the total number of open windows.

For example:
With only one window open.
`SPC b 2`
>ad-Advice-select-window: Wrong type argument: window-live-p, nil

In the Buffer Transient State (`SPC b .`):
- `C-2` (`spacemacs/buffer-transient-state/winum-select-window-2`)
>Wrong type argument: window-valid-p, #<window 12>

- `2` (`spacemacs/buffer-transient-state/move-buffer-window-no-follow-2`)
>Wrong type argument: window-live-p, #<window 14>

- `M-2` (`spacemacs/buffer-transient-state/swap-buffer-window-no-follow-2`)
>Wrong type argument: stringp, nil

Solution:
Show a descriptive message, if the target window nr is greater than the number
of open windows. And ignore the LV buffer (hydra).
2020-10-10 22:48:38 +02:00
Maximilian Wolff 8dabfcd6c3
Revise evilification of Custom-mode
Load the respective package only if
vim or hybrid mode is used.

Format the source files and update
copy right header.
2020-09-16 21:26:27 +02:00
Keith Pinson 68debde4a2
[core] evilify Custom-mode if dotspacemacs-editing-style is 'vim
This has been requested many times but never implemented.

Fixes #6699
Fixes #5668
Fixes #7583
Fixes #13309
2020-09-16 21:16:23 +02:00
Maximilian Wolff 0284f80375
Revert "improves find-user-init-file"
This reverts commit c8b3e46ef8.

This change had negative side effects and
was therefore reverted. Please see #13933
for details.
2020-09-14 20:07:05 +02:00
Ag Ibragimov c8b3e46ef8 improves find-user-init-file
<SPC f e i> should work with Emacs profile switcher plexus/chemacs
2020-09-04 22:43:16 +02:00
Ivan Yonchovski 7a107e65d2
Make spacemacs/useful-buffer-p much faster
- `with-current-buffer` triggers a lot of hooks.
2020-07-05 22:28:47 +02:00
Hans Jang 397b21e4f1
Replace close-compilation-window with show-hide-compilation-window 2020-04-16 23:22:24 +02:00
Ivan Yonchovski fb870e84a5 [defaults] Added shortcut to switch to last compilation buffer 2020-04-16 21:54:53 +02:00
Ivan Yonchovski 9f75a65398 [defaults] Add function+shortcut for copy buffer name 2020-04-16 21:32:25 +02:00
bb2020 e5e3617bdd
add `spacemacs/kill-back-to-indentation` 2020-03-08 11:51:18 +01:00
syl20bnr 101c920dbc
Add key bindings to randomize word and lines in region 2020-01-20 11:26:14 -05:00
Ilia Kurenkov 629d8bd126 Fix docstring typo 2019-12-24 10:36:24 +01:00
Nikita Leshenko aaa11a6823 Convert `case' to `cl-case' to fix cl-lib related errors
Broken since PR #13059
2019-12-18 12:08:05 +01:00
duianto b59f8a3117 Update spacemacs/new-empty-buffer docstring
Removed the parentheses around the buffer name number,
because the angle brackets are enough.

Added the frame argument.

Rewrote the accepted SPLIT arguments as a table.
2019-11-25 10:24:01 +01:00
Carlos Ibáñez b5727f7799 Fix sudo-edit on TRAMP
The indentation was changed in the second tramp-make-tramp-file-name for
consistency with the first tramp-make-tramp-file-name.
2019-11-18 15:32:25 +01:00
Seong Yong-ju 777d685c46 Fix spacemacs/kill-other-buffers to kill only buffers in the persp 2019-11-17 18:20:12 +01:00
duianto 7af300a225 Add visual line navigation keys, up and down
up   evil-previous-visual-line
down evil-next-visual-line
2019-11-03 22:44:27 +01:00
duianto 38752beffa Descriptive rename function file variables
problem:
the variable names: `dir`, `name`, and `filename` leads to confusion if they are
the old or new names

solution:
add the prefix `old-` to match `new-`,
use (`old-` `new-`) + `short-name` for just the `file.ext` (the `short-` idea
came from the `spacemacs/rename-file` function that's defined above this one),
and `old-full-path` instead of `old-filename` makes it clear that it's not just
the files name and extension.
2019-11-03 22:05:14 +01:00
duianto 4c728f041a Update file renaming, handle same new and old name
problem:
renaming a file to it's current name, results in the message:
"File 'current-name' successfully renamed to 'current-name'"

solution:
when the new and old names are the same, show a rename failed message, and call
the rename function again
2019-11-03 21:03:10 +01:00
duianto 8fbdd61e1e Update renaming, move and/or rename messages
problem:
the rename command shows the same message:
"File 'old-file-name' successfully renamed to 'new-file-name'"
(without the directory path) for all three file operations:
move, rename and both move & rename

solution:
show messages that fit the rename operation,
and align the from and to path/file names,
to make it easier to see what changed.

And use the same message format when renaming a buffer.
2019-11-03 20:40:56 +01:00
Matt Kramer e4c8cef412 Add toggle visual-line-navigation-globally 2019-10-29 18:19:05 +01:00
Hong Xu 301d867aff tags-table-mode should be in spacemacs-large-file-modes-list
It is light-weight and it is common that tags are large.
2019-10-19 00:20:21 +02:00
Miciah Masters 97ba556142 Various documentation copy-edits
Follow up the changes in the previous commit with some minor improvements
to formatting, grammar, spelling, and wording.

* layers/+distributions/spacemacs-docker/README.org: Replace "+" with
"and".
* layers/+email/mu4e/README.org: Use full sentences in the comments in the
mu4e-alert example.
* layers/+intl/japanese/README.org: Use verbatim markers for names of
files, functions, packages, and variables.  Capitalize "Linux".
* layers/+os/osx/README.org: Capitalize "Emacs", "Vim", and "Evil".
* layers/+os/osx/config.el (osx-command-as, osx-use-dictionary-app):
* layers/+os/osx/keybindings.el (spacemacs/system-is-mac): Improve
docstrings.
* layers/+readers/dash/README.org: Capitalize "API", "Helm", and "Ivy".
* layers/+spacemacs/spacemacs-defaults/config.el
(delete-by-moving-to-trash): Use full sentences in comment.
* layers/+spacemacs/spacemacs-defaults/funcs.el
(spacemacs/toggle-frame-fullscreen-non-native): Improve docstrings.
2019-10-13 12:04:59 +02:00
Miciah Masters 552fd5953c Update references to macOS
Apple renamed "Mac OS X" to "OS X" in 2012 and then to "macOS" in 2016.
Update references to use the current name.
2019-10-13 12:04:40 +02:00
duianto 556433f95c Limit lines to 80 chars
And fix comment indentation. Vertically aligned comments in function
definitions, indents them in the help buffer.
2019-09-17 20:36:30 +02:00
duianto 3521d7a11e Switch recreated messages buffer to evil-normal-state
If the messages buffer is deleted.
When it's recreated, then it opens in evil-evilified-state
where the evil keys `w` and `b` are undefined.
2019-08-19 20:48:41 +02:00
Troy Pracy 3c67ba94f3 Add docstring to align-repeat-x commands
Update 'spacemacs|create-align-repeat-x macro to add a docstring to created
functions. The docstring refers the user to the macro, providing a link to
the source code.
2019-08-19 18:11:29 +02:00
bb2020 8ed7e5e7a1 Add `spacemacs/iwb-region-or-buffer'. 2019-08-11 20:15:40 +02:00
Brandon T. Willard 2cfcf54458 Use return value from advised function in yank-indent-region
Closes #12479.
2019-06-28 12:08:49 +02:00
jcaw d4cca74854 Add support for visual line numbers
Emacs 26 added built-in support for line numbers, relative line numbers, and
visual line numbers. Spacemacs supports only absolute and relative, but there is
no way to access the visual mode. It's hard to get around this, since Spacemacs
abstracts line numbers to a reasonably high degree.

Arguably, `visual` is much more useful than `relative` as a display type. Visual
line numbers are like relative line numbers, but only lines that are actually
showing are counted. This means:

  1. Hidden lines are not counted. If a large amount of text is folded, the line
     numbers won't jump from "10" to "546". This is particularly useful in
     buffers like `magit-status`, where a large amount of information is folded
     by default.

  2. Lines that are wrapped are counted as multiple lines, since they're being
     displayed as multiple lines in the editor. Each visual line will be
     numbered - unlike `relative`, where the entire thing is numbered... Once.

With standard relative line numbers, you can't actually navigate using the line
numbers in the sidebar as soon as folded or wrapped lines are introduced. Since
this is one of the main use cases for relative line numbers, this is a big
problem.

Visual mode fixes that problem. Every line that's being displayed is labelled.
Numbers always correspond to the actual number of lines you'd need to navigate
to reach that line.

This commit extends Spacemacs' line number interface to provide visual line
number support.
2019-06-23 19:16:44 +02:00
duianto de2297b2e1 Fix copied dir not in minibuffer, clipboard disabled
Fixed the minibuffer showing: `nil`
when `select-enable-clipboard` is `nil` and the current files
path/dir/file/line/column/etc. is copied with the keys under
the prefix: `SPC f y`
2019-06-17 09:20:01 +02:00
Juha Jeronen 672e3db625 Customizable major-mode for new empty buffers
New var: dotspacemacs-new-empty-buffer-major-mode

Set to a symbol naming a mode (e.g. 'text-mode) to apply that major mode to any
buffers newly created in Spacemacs by spacemacs/new-empty-buffer.

Fixes #12382.
2019-06-17 08:26:56 +02:00
Alexander Miller 2e14b4a88c Don't use large file check in buffers already in fundamental-mode.
This change will prevent unnecessary requests to literally open files that are
literal already (like elfeed's index file).
2019-06-13 15:05:34 +02:00
Bet4 d4b180a735 Various improvements when indent code 2019-04-28 01:19:14 +02:00
Bet4 44cd57d2e2 Remove the use of 'spacemacs|advise-commands' 2019-04-25 19:30:29 +02:00
Bet4 554ca097f2 Check for universal arg before paste
This commit fixes #4219 and fixes #8897
2019-04-25 19:30:29 +02:00
syl20bnr 95422ae5d5 Second part of review and tweaks of release notes 2019-02-10 12:37:41 -05:00
duianto 438ad905da Update delete file messages
problems:
the delete file prompt doesn't show which file it's about to delete,
and when the deletion request is canceled, then the question remains in the
minibuffer (the text disappears when an action updates the minibuffer, like
moving the cursor, but it might be confusing to still be seeing the question
after it's been answered)

solution:
show the file name in the delete file prompt, and show a canceled message
2018-11-12 22:07:25 +00:00
Ag Ibragimov 27b2fb424a Keeps previous position on toggle-maximize-buffer 2018-11-12 22:01:56 +00:00
Boris Buliga 69a1e056ff
support directories in spacemacs/rename-file
1. Fix `short-name` for directories. Previously it was empty string.
2. Remove redundant check for existing buffer:
   1. `(get-buffer new-name)` always return `nil`, because `new-name` is a path
      to file, not a file name.
   2. `(find-file new-name)` handles this situation.
   3. `dired-rename-file` handles this situation as well.
3. Use `dired-rename-file` to do the dirty stuff.
   1. Renames files and directories.
   2. All associated buffers are updated. If you rename a directory, all buffers
      that were visiting files from that directory now visit files from new
      directory.
4. Properly handle recentf list update for directories - all files from the
   renamed directory are removed from recentf list and the same files but from
   new directory are added back.
2018-10-31 20:56:28 +02:00
duianto 0f1c461a5c
Fix missing newline warning
problem:
`'face 'minibuffer-prompt` and `new-name` are shown with an orange color,
and `describe-char` shows that they have the face: `font-lock-warning-face`

solution:
adding a newline before them removes the orange warning color
2018-10-18 19:34:15 +03:00
syl20bnr 9f8b867af1 Add SPC f y n and SPC f y N to copy the name of a file 2018-09-11 15:04:19 -04:00
Miciah Masters 7852c3b36e Delete compilation finish hook
Before this commit, Spacemacs assigned an anonymous function to the
compilation-finish-function variable.  This variable was deprecated
in Emacs 22.1 and removed in Emacs 27.1 in favor of the
compilation-finish-functions hook.  Consequently, the assignment has
no practical effect in Emacs 27.1.

Although we could add the Spacemacs function to the new
compilation-finish-functions hook, the function serves little purpose; it
prints a generic message when compilation succeeds:

    compilation ok.

and it prints the key binding for spacemacs/next-error when compilation
fails:

    There were errors. Use SPC e n to visit.

However Emacs already prints messages to indicate success or failure,
respectively:

    Compilation finished

or (for example)

    Compilation exited abnormally with code 1

Because the Spacemacs function prints its "There were errors" message
immediately after Emacs prints its "Compilation exited abnormally" message,
the latter was obscured.  Because the exit code in Emacs's message could be
useful and the added value of the Spacemacs function's message is minimal,
we can simply delete the Spacemacs function.

* layers/+spacemacs/spacemacs-defaults/funcs.el
(compilation-finish-function): Delete the assignment and anonymous
function.
2018-09-03 21:29:53 +01:00