problem
Opening the full release note, leaves the cursor at the
beginning of the second line after the preview.
solution
Leave the cursor at the beginning of the first line after the preview.
problem
The number keys searches for a line starting with a number,
from the beginning to the end of the buffer,
even if they are above or below the window.
solution
Only search for the visible number lines.
problem
It might not be clear how the note can be closed.
solution
Add a button: Close note
to the bottom right of the notes:
Quick Help and Release Notes
This also defines the Spacemacs home buffer key bindings,
in the `emacs-startup-hook`.
Because the keys were being defined to early,
before the new value of: `dotspacemacs-show-startup-list-numbers`
was set in `.spacemacs`.
* Add :timeout for spacemacs|define-transient-state
This add a :timeout keyword for spacemacs|define-transient-state, it
make use of :timeout keyword defhydra according to
https://github.com/abo-abo/hydra/wiki/internals.
"The :timeout key starts a timer for the corresponding amount of seconds that disables the hydra. Calling any head will refresh the timer."
* Add idle for spacemacs|define-transient-state.
According to https://github.com/abo-abo/hydra/wiki/internals:
This key can delay the appearance of the hint.
Add :timeout and :idle in defhydra body to make it effect.
- Conform to standard ELISP file practice.
- Rearranged the top-level forms s.t. Variables and constants are declared at top.
- Added section markers and documentations.
- Use three or more `;` as a section header. They work well with built-in outline-mode. `M-j` and `M-k` is the binding to quickly navigate between them.
- Optionally use `^L` (form-feed) as a divider for the ELISP file. It's rendered as a horizontal divider. And it works with `backward-page` (`C-x [`) and `forward-page` (`C-x ]`)
* core-customization: improved SAFE variable handling
- SAFE can either be a function or t.
- When it's t, use a default validation function
`(lambda (val) (validate-value val TYPE t))`
- When it's a function, use the supplied function.
* Fixed bugs in go and groovy layer
In almost any cases, it's better to supply `t` instead of a function, to
`SAFE` argument of `spacemacs|defc`.
For example,
```elisp
(spacemacs|defc go-use-gocheck-for-testing nil
"If using gocheck for testing when running the tests -check.f will be used instead of -run to specify the test that will be ran. Gocheck is mandatory for testing suites."
'boolean nil #'booleanp)
```
If its value is nil, it evaluate to `nil`, which means that `nil` is not
a safe value for `go-use-gocheck-for-testing` local variable.
But clearly it is.
* core-customization: improved SAFE variable handling
- Added a function `spacemacs-customization//get-variable-validator`.
This function is designed to be used with `safe-local-variable`
property of spacemacs custom variables.
See details in the docstring.
```elisp
(put 'FOO 'safe-local-variable
(apply-partially 'spacemacs-customization//get-variable-validator
'FOO))
```
- This is better than a lambda since `apply-partially` returns a compiled
function. (Though the performace gain may be tiny.)
- This is better than simply calling `validate-value`, because it returns
nil when value is nil. But sometimes nil is a valid value.
Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
spacemacs|define-jump-handlers only defines a variable
`spacemacs-jump-handlers-MODE' to which handlers can be added and sets up key
bindings for mode. MODE must be a major mode,. It won't add function to mode
hook anymore.
`jump-to-definition` will walk through the three lists of handlers in the
following order: spacemacs-jump-handlers, spacemacs-jump-handlers-MODE, and
finally spacemacs-default-jump-handlers.
Dynamic handlers like lsp, tide, ggtags use spacemacs-jump-handlers to register
(add-to-list 'spacemacs-jump-handlers 'jump-hanlder)
Conventional static handlers should use spacemacs-jump-handlers-MODE
After new custom `dotspacemacs-*` variables being introduced in
`core/core-dotspacemacs.el`, if one has an old `.spacemacs` without these
variables set, `SPC f e R` will complain error messages like
```
Variable: "dotspacemacs-emacs-dumper-dump-file" has value: "nil" that doesn't
match its type: "string"...
```
even if these variables have already had initial value.
This is because `dotspacemacs||let-init-test` macro only locally declares these
variables without setting them with their initial value.
This pull request fix this issue by expanding (dotspacemacs/get-variable-list)
into `'((var1 value1) (var2 value2) ...)` list instead of `(var1 var2 ...)`.
problem:
`SPC f e U` checks if packages have updates.
But if the current buffer isn't the Spacemacs home buffer,
then the minibuffer just shows:
>Do you want to update 1 package(s)? (y or n)
There's no information about which packages have updates.
Canceling the prompt with: `n`
and switching to the messages buffer `SPC b m`, does list them.
>(Spacemacs) --> Found 1 package(s) to update:
>
>(Spacemacs) dap-mode
But it doesn't work to switch to the home buffer,
because that information was erased when the home buffer was refreshed.
solution:
Switch to the home buffer before checking for updates.
* [init] Disable GUI elements in early-init as well
Can provide a smoother startup by reducing graphical artifacts.
* [core] Add file for early-init functions
Needed to make the tests to work as early-init.el is not sourced
during tests.
Fixes error:
Symbol’s function definition is void: spacemacs/removes-gui-elements
problem:
Setting dotspacemacs-which-key-delay to an integer, for example: 4
Makes the following message to appear on startup:
(Spacemacs) Error in dotspacemacs/init: Variable: "dotspacemacs-which-key-delay" has value: "4" that doesn’t match its type: "(float)". Validator message: "(user-error Looking for `(float)' in `4' failed because:
not a float)"
cause:
dotspacemacs-which-key-delay expects the type: float
The float type has the description:
The value must be floating point.
solution:
Change the type to: number
The number type has the description:
The value must be a number (floating point or integer).
Source: info (`C-h i`)
In the section: Elisp > Customization Types > Simple Types