Added "configuration-layer//system-package?" based on package-delete
(pretty much a direct partial copy-paste) so that
"configuration-layer//package-delete" can check if package is a
system package
No crash on spacemacs boot (with unused system-package present).
Though right now "configuration-layer//package-delete" only ignores system
packages instead of reporting them. Not entierly what @nbraud proposed,
but insufficient err-logging is a significantly smaller issue.
Fixes#11160
The new variable was not following the naming conventions.
The file was not initialised in core-dotspacemacs.el.
The file was not part of the .spacemacs.template.
Spacemacs allows to define layers declaratively like so:
dotspacemacs-configuration-layers
`(,(when (eq system-type 'darwin) 'osx))
The problem - in Linux that would add a nil element into the list, which then
makes it unable to run dotspacemacs/sync-configuration-layers <SPC f e R>, the
tests won't pass.
time-date.el requires cl-lib under Emacs 27 and above. Then the around advice
spacemacs//timed-require and spacemacs//load-timer of require will cause
recursive load under emacs 27 and above. The load sequences is: requiring cl-lib
uses autoload function time-since which loads time-date.el and then time-date.el
requires cl-lib.
The solution to break this recursive load sequence is to load time-date.el
before adding the around advice spacemacs//timed-require and
spacemacs//load-timer to require.
The original idea was to have a warning when
use-package-inject-hooks is set to nil however
having a warning in that macro caused too much
negative side effects and also does not cover
all cases.
Therefore it is to be removed.
In my first commit I did not add the warning message properly.
Basically the macro should emit code to create a warning if
the generated code is run and the predicate is not fulfilled.
However in my last commit it did run the code during macro
expansion which would do the testing there which is not
what I wanted.
spacemacs|use-package-add-hook is generating code which
is dependent on use-package-inject-hooks being non-nil.
If this happens now a big warning is written to the log
informing users of a potential issue or problem caused
by their user-config.
In a terminal, when a modes mode line name is diminished,
to two characters, and the first one is a unicode character,
then the second character overlaps the right side of the first character.
Add doom-gruvbox-light theme to prevent Spacemacs from trying to download a
package with the same name from elpa (and failing because there is no such
package).
doom-gruvbox-theme can now be included in dotspacemacs-themes configuration
without generating an error or trying to download a non-existent package.
To optimise performance of lsp mode in emacs 27 and above
I have introduced a new dotfile variable to define the size
of data read from external processes. The default I have
set to the recommended setting from lsp-mode.
In addition I have introduced a new layer variable for
auto-complete-layer to define the minimum prefix length.
I have also added instructions to auto-complete's readme
how to set these variables to the recommended settings
for lsp-mode.
Changes inspired from #13507
Themes can now contain keywords in addition to just the theme name like
dotspacemacs-themes '((name :location (recipe :fetcher github
:repo "user/repo"))
solarized-light
solarized-dark)
However, for theme cycling, we first try to detect whether the current
theme (spacemacs--cur-theme) is in the list of cycleable themes and go on from
there. Since spacemacs--cur-theme is just a name, this fails when
spacemacs--cur-theme is the name of a theme that's specified with additional
keywords in dotspacemacs-themes.
To fix this, check if spacemacs--cur-theme is in the list of theme names.
This is a squash commit including below commits
Add dotspacemacs--pretty-ignore-subdirs
Within the specified subdirs of `dotspacemacs-start-dir`,
spacemacs/prettify-org-buffer (and hence space-doc-mode) will not be called.
Without this variable, using spacemacs/open-junk-file to create an Org file will
result in prettification, which is not necessarily the desired behavior.
Call make-directory in spacemacs/open-junk-file
This imitates the behavior of open-junk-file.
Prevent spacemacs/open-junk-file from getting confused by Dired
If we're in a dired buffer, counsel-find-file will ignore
current-directory (i.e. junk-dir) and use (dired-current-directory) instead. We
fool Counsel by shadowing major-mode to nil.
Update CHANGELOG.develop re spacemacs/open-junk-file
Theme transient state key-binding `t` is broken if `ivy` completion framework is
used. The binding unconditionally invokes `helm-themes`.
This change adds a new function which takes care of invoking correct
theme-loader function based on completion framework currently in use.
The old binding used `helm-themes` but the new function uses already defined
`spacemacs/helm-themes` which removes the number of candidates limit.
There have been complains about issues with `clean-aindent-mode` from
multiple users. For some of these deactivating the mode in their user-init
did not work as intended. Therefore I have added a setting for it in the
dotfile.
Modus themes are highly accessible themes for GNU Emacs, conforming with the
highest accessibility standard for colour contrast between background and
foreground values (WCAG AAA standard).
Screenshots: https://gitlab.com/protesilaos/modus-themes/-/wikis/Screenshots
If a layer is interactively installed by visiting a file the progress
file is updated without being properly initialized before causing a
division by zero.
Now `spacemacs/update-progress-bar` will ignore the call if
`spacemacs-loading-dots-chunk-threshold` is <= 0.
This commit contains the following original ones:
[dump] don't assume spacemacs start directory when dumping
[dump] dump to a temporary file and atomically rename it
[dump] cleanup after dumping
destructuring-bind is a macro in the deprecated package: cl
SPC-TAB calls: spacemacs/alternate-buffer
In the spacemacs-base distribution, it shows the message:
spacemacs/alternate-buffer: Symbol’s function definition is void: destructuring-bind
Also renamed three instances of destructuring-bind in the rirc layer.
The change was introduced by #13059. mocker.el is a large piece of legacy code
that depends on deprecated functionality in EIEIO and cannot be trivially
converted to use `cl-lib` by search and replace.
Problem:
The variable spacemacs-layouts-restrict-spc-tab is defined in:
~/.emacs.d/layers/+spacemacs/spacemacs-layouts/config.el
But the spacemacs-layouts layer isn't loaded by default in spacemacs-base.
Solution:
Check if the variable is bound.
- Removed the first line deletion.
This required the banners to have an empty first line.
- Removed the empty first line from the banners.
- Made sure that there is a single empty line between:
- The Version and Banner.
- Banner and Buttons ([?] [Homepage] ...).
- Version and Buttons (when the banner is hidden).
- Reordered the backend version insertion function call
to match the frontend Spacemacs buffer order.
- version
- banner
- buttons
Before it added:
- the banner
- then the buffers first line was removed
- then the version was added to the first line
- then the buttons were added at the bottom of the buffer
(there are more things added after the buttons,
but they haven't been changed by this commit).
- Removed the version insertion call in:
core/core-spacemacs-buffer.el
The changes above caused the version to appear twice
in the Spacemacs home buffer on startup.
I'm not sure if it has/had other uses.
This seems to be where it was first added to:
core-configuration-layer.el:
core: restore default mode line in home buffer
77161bd591
It was slightly modified in this commit:
core: defer distro insertion in home buffer
cd50d9c069
Here it was joined with the banner:
Fix version injection in home buffer
Don't inject version if banner is nil
a764eb4eb9
core: condensed versions into one string in left-hand side
spacemacs-version@emacs-version (distribution)
627e934453
- I had not seen that the version was joined with the
banner on purpose until now.
It seemed useful to still be able to see the versions
if one just wanted to hide the banner.
Therefore I opened this PR (it's been cherry-picked):
Uncouple version from banner in spacemacs buffer #11901https://github.com/syl20bnr/spacemacs/pull/11901
If there's a good reason to combine them again,
then the changes can be reverted.
The newly introduced function to compile an elpa package
was very much redundant with the existing recompile-elpa function.
I have adapted recompile-elpa so that it can be used for the helm action too.
In addition I have bound recompile-elpa to `SPC c C-c` to allow users to
easily recompile their entire elpa directory if the need arises.
I have also removed the error handling in the helm action in favor of
standard error reporting via the *Compile-Log* buffer.
How to use: `SCP h p` select package then `F3` or `C-z` and choose `Recompile`
Motivation: Some packages when compiling need other packages to be loaded first.
The pacakage maintainers should make sure of this requirement but sommetimes
they don't. It also doesn't help when Spacemacs is lazy loading and compiles
updated pacakges on startup. So the manual fix for this problem is recompile the
package once Spacemacs has fully loaded. This requires user go to the package
install location to delete elc files and then do a `spacemacs/recompile-elpa`.
This commit will do that chore for them.
This will make fixing the problem with `org-plus-contrib` or `dumb-jump` update
every now and then easier.
Fix several problems with environment variable caching.
First, if a shell printed extra output besides the command output,
spacemacs//init-spacemacs-env included the extra output in .spacemacs.env.
For example, a login shell could print a motd, which would be erroneously
included in .spacemacs.env. To avoid this, spacemacs//init-spacemacs-env
now redirects the command output to a temporary file and then reads the
file.
Second, spacemacs//init-spacemacs-env sorted lines using the entire
"name=value" string for each line whereas the correct behavior is to sort
only on the "name" part. To fix this, spacemacs//init-spacemacs-env now
uses sort-regexp-fields with an appropriate regexp to match the "name" part
and ignore the "value" part.
Third, although load-env-vars-set-env added all PATH settings in
.spacemacs.env to exec-path, it set PATH to the first PATH setting in
.spacemacs.env. Now load-env-vars-set-env sets PATH from exec-path so that
it will reflect that combined value.
Fourth, load-env-vars-set-env set exec-path and PATH without consideration
to the operating system's directory separator. Now load-env-vars-set-env
converts backslashes to forward slashes when adding path entries to
exec-path and converts forward slashes to backslashes when setting PATH on
platforms that use backslashes.
Fifth, load-env-vars-set-env now normalizes exec-path by deleting trailing
slashes from path entries, converting drive letters in path entries to
lower-case, and deleting duplicate path entries.
Sixth, Spacemacs no longer uses exec-path-from-shell, but a changelog entry
said that it did. This commit corrects the changelog entry, deletes
another outdated entry, and merges two entries that covered the same
functionality.
Finally, this commit corrects several typos and tries to improve wording in
several docstrings, messages, and comments.
* CHANGELOG.develop: Delete mention of exec-path-from-shell, which
Spacemacs no longer uses by default. Delete mention of
dotspacemacs-import-env-vars-from-shell and
dotspacemacs-import-env-vars-shell-file-name, which no longer exist.
Merge entries about synchronizing environment variables.
* core/core-env.el (spacemacs-ignored-environment-variables): Fix typos and
mention that the strings are regexps that are matched against the names of
environment variables.
(spacemacs//init-spacemacs-env): Use a temporary file rather than standard
output in order to avoid getting motd and other noise. Sort lines using
only environment variables' names, not their values. Better describe the
behavior with respect to spacemacs-ignored-environment-variables, duplicate
settings, and PATH. Try to make wording clearer.
(spacemacs/edit-env): Fix typos in the docstring.
* core/libs/load-env-vars.el (load-env-vars-set-env): Fix typos in the
docstring. Delete trailing slashes from path entries in exec-path, convert
drive letters to lower-case, delete duplicate path entries, and convert
backslashes to forward slashes when setting exec-path. Set PATH from
exec-path, converting forward slashes to backslashes on platforms that use
backslashes.
Sometimes it is useful to go directly to the last error message in the buffer.
This function recursively calls 'spacemacs/next-error until the last error is
reached.
The binding "SPC e l" is associated with it
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.
The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.
* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
except for distribution layers (we declare layer dependencies right away in
distribution layers)
* modified function configuration-layer//stable-elpa-verify-archive
Add a `fatal-err` variable to handle critical erros that prevent the
verification to be attempted.
Use the function `epg-verify-file` instead of `epg-verify-string` which seems
to give more reliable results.
* modified function configuration-layer//stable-elpa-verify-archive
Gather errors along the verification steps and make a single call to
configuration-layer//stable-elpa-ask-to-continue at the end of the function.
Improve the scope of catched errors so now the users should be prompted when
GPG is not available on the system.
* new function configuration-layer//stable-elpa-disable-repository
* new function configuration-layer//stable-elpa-update-version-file
* new function configuration-layer//stable-elpa-delete-temporary-files
* new function configuration-layer//stable-elpa-ask-to-continue
* new function configuration-layer//stable-elpa-verify-archive
* new function configuration-layer//stable-elpa-disable-repository
* rename function configuration-layer/stable-elpa-download-tarball to
configuration-layer//stable-elpa-download-tarball
* new function configuration-layer/stable-elpa-init
* make the function configuration-layer/stable-elpa-version interactive
configuration-layer/stable-elpa-init is called from init.el.
This function then calls the other new function in more clear fashion than the
previous complicated configuration-layer/stable-elpa-download-tarball
The users are now prompt if they want to install the stable ELPA repository when
the verification of the archive failed.
It is important that the stable elpa download message in the modeline is always
visible to the user as the donwload can take a while depending on the connection
speed.
* new variable configuration-layer-stable-elpa-archive
* add missing sub-directory "packages"
* update .lock file with above changes and bump to archive version 0.400
This reverts commit 5f308b0306.
This message is shown on startup:
spacemacs/startup-hook: Symbol’s value as variable is void: spacemacs-theme-custom-colors
and it broke several things.
Added spacemacs|add-toggle key binding documentation strings:
- To the toggle keys function docstring
- And to it's which-key mouseover minibuffer text
As winner-mode was moved from init.el to dump-init.el winner-mode
was not longer properly started for non-dumped emacs sessions.
Having winner-mode auto activate at startup did fix the issue
for non-dumping users but in turn broke the dumping process.
I have now moved the necessary winner-mode init to
spacemacs/setup-startup-hook which is only called
in the non-dumping case. To allow customizations I activate
winner-mode prior to loading user-init this will allow users
to deactivate winner-mode in the dotfile and fix ediff themselves
if this is wished for.
0ffdb353f9 changed the default config template to use a point size instead of a pixel size. Change the defvar declaration as well.
Commit modified by duianto:
Updated font size in doc/documentation.org
13 and 10.0 are visually the same, because:
- Integer specifies the pixel size.
- Floating-point specifies the point size.
Using a default floating-point size has two benefits:
- It's clear that the font size can be changed by floating-point values.
- There won't be an unpleasant surprise that `13` and `13.0` are different
sizes. For example to make the font slightly larger or smaller than `13`.
Then `10.0` has to be found first by trial and error.
* core/core-funcs.el (spacemacs/alternate-buffer): Instead of using
switch-to-buffer, use set-window-buffer-start-and-point, specifying the
previous window start position and point if known. Replace use of
cl-find-if with cl-find.
* CHANGELOG.develop: Add entry for change to spacemacs/alternate-buffer.
Remove mention of powerline-scale property from the
.spacemacs.template font variable comment.
Update the changelog.develop entry for the mode line
separator scale when the utf-8 separator is used.
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.
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.
The call to `format-spec` at the end of `spacemacs/title-prepare` creates
a temporary buffer which invokes `buffer-list-update-hook`. This in turn is
caught by treemacs' follow-mode and can lead to an action that requires a
recalculation of the frame-title, which again creates a new temp-buffer, and
so on.
The result is that in some situations Emacs will put full load on a CPU
core while it is idle (though the UI does remain responsive). The disabling
of the hook for the calculation of the frame title prevents this feedback
loop from forming.
See also https://debbugs.gnu.org/db/34/34765.htmlFixes#12387
Commit 1c4f685b13 replaced
configuration-layer--layers (a list of cfgl-layer objects) with
configuration-layer--used-layers (a list of symbols). It also changed the
configuration-layer/insert-lazy-install-configuration function to use the
new variable, but it did not change the sort predicate. Consequently, the
function started failing:
Wrong type argument: listp, spacemacs-purpose
In addition, because sort is destructive, the function also deleted values
from configuration-layer--used-layers.
This commit fixes the sort predicate so that the function returns the
correct value, and it copies the list before sorting to avoid modifying
configuration-layer--used-layers.
* core/core-configuration-layer.el
(configuration-layer/insert-lazy-install-configuration): Use string<
as the sort predicate, and give sort a copy of the list.