You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
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
Following shell script demonstrates startup problem on develop branch with
"(void-function evil-define-key)".
#!/bin/sh
# This is my git clone of spacemacs with version 03c83e1 of 'develop' branch,
# i.e., this revision
# develop origin/develop origin/HEAD 03c83e169cb8930d0e0502f2a47faf411f1d8ba2
# Author: Eivind Fonn <[email protected]>
# AuthorDate: Fri Dec 18 11:27:37 2015 +0100
S=/u/me/Public/spacemacs
rm -rf ${S}/elpa
cp -f ${S}/core/templates/.spacemacs.template ~/.spacemacs
# Remove 'projects from dotspacemacs-startup-lists as a work-around to another bug, i.e.,
# https://github.com/syl20bnr/spacemacs/issues/4227
sed -i 's/recents projects/recents/' ~/.spacemacs
# Comment out one line as a work around for
# https://github.com/syl20bnr/spacemacs/issues/4228
cd ${S}
git reset --hard
patch -p1 << 'EOF'
diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el
index 4ae2599..6acf829 100644
--- a/core/core-spacemacs-buffer.el
+++ b/core/core-spacemacs-buffer.el
@@ -49,7 +49,7 @@ version the release note it displayed")
:syntax-table nil
:abbrev-table nil
(setq truncate-lines t)
- (page-break-lines-mode)
+ ;;(page-break-lines-mode)
;; needed to make tab work correctly in terminal
(evil-define-key 'motion spacemacs-buffer-mode-map (kbd "C-i") 'widget-forward)
;; motion state since this is a special mode
# This is my own build of emacs using latest source of emacs-24 git branch.
/u/me/opt/emacs24/bin/emacs -q \
--eval "(setq debug-on-error t)" \
--eval "(setq user-emacs-directory \"${S}/\")" \
--eval "(load-file \"${S}/init.el\")" \
Debugger entered--Lisp error: (void-function evil-define-key)
(evil-define-key (quote motion) spacemacs-buffer-mode-map (kbd "C-i") (quote widget-forward))
(let ((delay-mode-hooks t)) (special-mode) (setq major-mode (quote spacemacs-buffer-mode)) (setq mode-name "Spacemacs buffer") (progn (if (get (quote special-mode) (quote mode-class)) (put (quote spacemacs-buffer-mode) (quote mode-class) (get (quote special-mode) (quote mode-class)))) (if (keymap-parent spacemacs-buffer-mode-map) nil (set-keymap-parent spacemacs-buffer-mode-map (current-local-map))) nil nil) (use-local-map spacemacs-buffer-mode-map) nil nil (setq truncate-lines t) (evil-define-key (quote motion) spacemacs-buffer-mode-map (kbd "C-i") (quote widget-forward)) (if (eq dotspacemacs-editing-style (quote emacs)) nil (if (member (quote spacemacs-buffer-mode) evil-motion-state-modes) evil-motion-state-modes (setq evil-motion-state-modes (cons (quote spacemacs-buffer-mode) evil-motion-state-modes)))))
(progn (make-local-variable (quote delay-mode-hooks)) (let ((delay-mode-hooks t)) (special-mode) (setq major-mode (quote spacemacs-buffer-mode)) (setq mode-name "Spacemacs buffer") (progn (if (get (quote special-mode) (quote mode-class)) (put (quote spacemacs-buffer-mode) (quote mode-class) (get (quote special-mode) (quote mode-class)))) (if (keymap-parent spacemacs-buffer-mode-map) nil (set-keymap-parent spacemacs-buffer-mode-map (current-local-map))) nil nil) (use-local-map spacemacs-buffer-mode-map) nil nil (setq truncate-lines t) (evil-define-key (quote motion) spacemacs-buffer-mode-map (kbd "C-i") (quote widget-forward)) (if (eq dotspacemacs-editing-style (quote emacs)) nil (if (member (quote spacemacs-buffer-mode) evil-motion-state-modes) evil-motion-state-modes (setq evil-motion-state-modes (cons (quote spacemacs-buffer-mode) evil-motion-state-modes))))))
spacemacs-buffer-mode()
(progn (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode))
(if after-init-time (progn (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (function (lambda nil (save-current-buffer (set-buffer (get-buffer spacemacs-buffer-name)) (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (if configuration-layer-error-count (spacemacs-buffer/set-mode-line (format ... configuration-layer-error-count)) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line)) (force-mode-line-update) (spacemacs-buffer-mode) (spacemacs-buffer/goto-link-line)))) t))
(save-excursion (spacemacs-buffer/set-mode-line "") (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if after-init-time (progn (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (function (lambda nil (save-current-buffer (set-buffer (get-buffer spacemacs-buffer-name)) (if dotspacemacs-startup-lists (progn ...)) (if configuration-layer-error-count (spacemacs-buffer/set-mode-line ...) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line)) (force-mode-line-update) (spacemacs-buffer-mode) (spacemacs-buffer/goto-link-line)))) t)))
(save-current-buffer (set-buffer (get-buffer-create spacemacs-buffer-name)) (save-excursion (spacemacs-buffer/set-mode-line "") (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if after-init-time (progn (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (function (lambda nil (save-current-buffer (set-buffer ...) (if dotspacemacs-startup-lists ...) (if configuration-layer-error-count ... ...) (force-mode-line-update) (spacemacs-buffer-mode) (spacemacs-buffer/goto-link-line)))) t))))
(if (buffer-live-p (get-buffer spacemacs-buffer-name)) nil (save-current-buffer (set-buffer (get-buffer-create spacemacs-buffer-name)) (save-excursion (spacemacs-buffer/set-mode-line "") (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if after-init-time (progn (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (function (lambda nil (save-current-buffer ... ... ... ... ... ...))) t)))))
spacemacs-buffer/goto-buffer()
spacemacs/init()
(if (not (version<= spacemacs-emacs-min-version emacs-version)) (message (concat "Your version of Emacs (%s) is too old. " "Spacemacs requires Emacs version %d or above.") emacs-version spacemacs-emacs-min-version) (load-file (concat user-emacs-directory "core/core-load-paths.el")) (if init-file-debug (progn (require (quote core-debug)))) (require (quote core-spacemacs)) (spacemacs/init) (spacemacs/maybe-install-dotfile) (configuration-layer/sync) (spacemacs/setup-startup-hook) (require (quote server)) (if (server-running-p) nil (server-start)))
eval-buffer(#<buffer *load*> nil "/u/me/Public/spacemacs/init.el" nil t) ; Reading at buffer position 1165
load-with-code-conversion("/u/me/Public/spacemacs/init.el" "/u/me/Public/spacemacs/init.el" nil nil)
load("/u/me/Public/spacemacs/init.el" nil nil t)
load-file("/u/me/Public/spacemacs/init.el")
eval((load-file "/u/me/Public/spacemacs/init.el"))
command-line-1(("--eval" "(setq debug-on-error t)" "--eval" "(setq user-emacs-directory \"/u/me/Public/spacemacs/\")" "--eval" "(load-file \"/u/me/Public/spacemacs/init.el\")"))
command-line()
normal-top-level()
Following is the work-around to this problem that I'm currently using.
diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el
index 4ae2599..6acf829 100644
--- a/core/core-spacemacs-buffer.el
+++ b/core/core-spacemacs-buffer.el
@@ -591,7 +591,8 @@ already exist, and switch to it."
(spacemacs-buffer/insert-startupify-lists))
(spacemacs-buffer/set-mode-line spacemacs--default-mode-line)
(force-mode-line-update)
- (spacemacs-buffer-mode))
+ ;;(spacemacs-buffer-mode)
+ )
(add-hook 'emacs-startup-hook
(lambda ()
(with-current-buffer (get-buffer spacemacs-buffer-name)
@emacs18
It appears that you are trying to load spacemacs from a directory that is not the default emacs directory. I assume that's because you already have something in the default directory (
~/.emacs.d/
). This is not the suggested setup in the README, and may have unintended side effects like the one you are having here.
evil-define-key
being unbound suggests that emacs can't find evil but that shouldn't be a problem. I'm guessing that you don't have evil installed normally and emacs is looking in your old elpa folder for it.
Why do you assume that just setting
user-emacs-directory
is sufficient to make this work? There are other important variables that are set during load like
package-user-dir
.
FYI this is how I've been using spacemacs for months. It has worked for both master and develop branches.
As far as I'm concerned that's purely by accident, since this way of loading spacemacs has never explicitly been supported. In other words, it's not a bug like
@robbyoconnor
says.
@justbur
Thanks for the explanation.
I understand that the documentation says to use ~/.emacs.d. However that is
simply not acceptible for me and many others I know.
Long time emacs users like me already have emacs setup apart from spacemacs.
Hence it is important for me to be able to launch emacs where I can choose to
enable or disable spacemacs as well as enable or disable my other configs.
Another problem with using ~/.emacs.d is that using emacs 24.x and 25.x becomes
problematic due to incompatible byte compile formats.
You mentioned package-user-dir. This along with most other emacs variables are
keyed off of user-emacs-directory. That is why setting user-emacs-directory
alone changes the default value of many other emacs variables. That I think was
the intent of user-emacs-directory. There are very very few built-in or
even third party elisp packages that use ~/.emacs.d directly without going
through user-emacs-directory variable.
If it doesn't take that much work to support users who do not use ~/.emacs.d,
shouldn't spacemacs do that to widen the pool of users willing to test drive
spacemacs? If spacemacs insisted on using ~/.emacs.d, I may not even have tried
it in the first place.
@emacs18
as far as I know, there aren't any contributors that test spacemacs that way, so this is not a bug related to the current intended use of spacemacs.
It's easy enough to flip symlinks for .emacs.d if you'd like to test spacemacs. There's no reason you have to delete your old .emacs.d.
If
@syl20bnr
wants to support a method like this of loading spacemacs then we will. v25 is not supported either, but pull requests are encouraged. If you want to submit a pull request for this issue, please do. I'm simply saying that you're loading spacemacs in an unsupported way and you can't expect someone to fix it at the moment.
By the way, as far as I know loading emacs from a directory outside of .emacs.d is not even supported by basic emacs itself.
@justbur
I am willing to provide patches to allow spacemacs to not rely on ~/.emacs.d.
However that may mean undoing some of the recent changes that were made.
Let me work on submitting a pull request then.
I have been using emacs for 30 years. I have never used ~/.emacs.d. I have nothing in it.
I sometimes do "rm -rf ~/.emacs.d" or even "chmod 0 ~/.emacs.d" to make sure that emacs
does not use anything in it. Hence emacs has
always
supported using config directory
that is not ~/.emacs.d.
@emacs18
If emacs has always supported it, then why is there no mention of it in the manual?
https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html
I think I found the issue anyway. According to
this
, loading emacs this way screws with the init hooks and the order in which buffers are created, which might explain the problem here.
emacs -q
is not officially supported by Spacemacs and this is due to the way Emacs works.
More info here:
#520
Also:
#2441
Consider using symbolic links instead.
The two primary documentation of emacs is emacs manual
and
elisp manual as I'm sure you already know. Many things are documented in elisp manual rather than emacs manual.
user-emacs-directory is one of those, e.g., see
(Info-goto-node "(elisp)Standard File Names")
as well as
(Info-goto-node "(elisp)Init File")
The latter section has the following among other things
-- Variable: user-emacs-directory
This variable holds the name of the ‘.emacs.d’ directory. It is
‘~/.emacs.d’ on all platforms but MS-DOS.
(Info-goto-node "(elisp)Startup Summary")
gives the gory detail of how emacs starts up.
As detailed there you need to be aware of few differences in how things start up
if you choose not to use the standard init file by using "emacs -q".
@syl20bnr
I've been using spacemacs for several months for emacs 24 and emacs 25 without relying
on ~/.emacs.d. I would like to continue to use it that way. It appears that one problem is reliance
on after-init-hook. Are there other issues you are aware of? I'll read up on the links you provided, and see if there is a way to come up with a patch that is acceptable to you. Otherwise I can continue to maintain a separate patch that I maintain.
FYI the following patch is what I apply to the develop branch of spacemacs. As I have reported in 3 or 4 github issues, some of the changes were to deal with recent changes checked into the develop branch.
diff --git a/core/core-configuration-layer.el b/core/core-configuration-layer.el
index 76c287d..276831a 100644
--- a/core/core-configuration-layer.el
+++ b/core/core-configuration-layer.el
@@ -112,9 +112,8 @@
"If non-nil this package is excluded from all layers.")))
(defvar configuration-layer--elpa-archives
- '(("melpa" . "melpa.org/packages/")
- ("org" . "orgmode.org/elpa/")
- ("gnu" . "elpa.gnu.org/packages/"))
+ '(("kimr-elpa" . "http://localhost/~kimr/elpa/elpa/")
+ ("kimr-org" . "http://localhost/~kimr/elpa/orgmode/"))
"List of ELPA archives required by Spacemacs.")
(defvar configuration-layer--package-archives-refreshed nil
@@ -181,21 +180,7 @@ of all reachable ones.
If the address of an archive already contains the protocol then this address is
left untouched.
The returned list has a `package-archives' compliant format."
- (mapcar
- (lambda (x)
- (cons (car x)
- (if (string-match-p "http" (cdr x))
- (cdr x)
- (concat (if (and dotspacemacs-elpa-https
- ;; for now org ELPA repository does
- ;; not support HTTPS
- ;; TODO when org ELPA repo support
- ;; HTTPS remove the check
- ;; `(not (equal "org" (car x)))'
- (not (equal "org" (car x))))
- "https://"
- "http://") (cdr x)))))
- archives))
+ archives)
(defun configuration-layer/retrieve-package-archives (&optional quiet force)
"Retrieve all archives declared in current `package-archives'.
diff --git a/core/core-dotspacemacs.el b/core/core-dotspacemacs.el
index 76a4158..2c489b1 100644
--- a/core/core-dotspacemacs.el
+++ b/core/core-dotspacemacs.el
@@ -252,7 +252,7 @@ declared in a layer which is not a member of
"List of search tool executable names. Spacemacs uses the first installed
tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.")
-(defvar dotspacemacs-default-package-repository 'melpa-stable
+(defvar dotspacemacs-default-package-repository 'kimr-elpa
"The default package repository used if no explicit repository has been
specified with an installed package.
NOT USED FOR NOW :-)")
diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el
index 4ae2599..6acf829 100644
--- a/core/core-spacemacs-buffer.el
+++ b/core/core-spacemacs-buffer.el
@@ -49,7 +49,7 @@ version the release note it displayed")
:syntax-table nil
:abbrev-table nil
(setq truncate-lines t)
- (page-break-lines-mode)
+ ;;(page-break-lines-mode)
;; needed to make tab work correctly in terminal
(evil-define-key 'motion spacemacs-buffer-mode-map (kbd "C-i") 'widget-forward)
;; motion state since this is a special mode
@@ -591,7 +591,8 @@ already exist, and switch to it."
(spacemacs-buffer/insert-startupify-lists))
(spacemacs-buffer/set-mode-line spacemacs--default-mode-line)
(force-mode-line-update)
- (spacemacs-buffer-mode))
+ ;;(spacemacs-buffer-mode)
+ )
(add-hook 'emacs-startup-hook
(lambda ()
(with-current-buffer (get-buffer spacemacs-buffer-name)
diff --git a/layers/+irc/erc/packages.el b/layers/+irc/erc/packages.el
index 361cbe5..96d6ee0 100644
--- a/layers/+irc/erc/packages.el
+++ b/layers/+irc/erc/packages.el
@@ -16,10 +16,11 @@
company-emoji
emoji-cheat-sheet-plus
- (erc-gitter :location (recipe
- :fetcher github
- :repo "jleechpe/erc-gitter")
- :excluded t)
+ ;; Commented erc-gitter to prevent internet access on startup. -rk 12/21/2015
+ ;;(erc-gitter :location (recipe
+ ;; :fetcher github
+ ;; :repo "jleechpe/erc-gitter")
+ ;; :excluded t)
erc-hl-nicks
erc-image
erc-social-graph
diff --git a/layers/+lang/php/packages.el b/layers/+lang/php/packages.el
index 031d026..7f5d8e5 100644
--- a/layers/+lang/php/packages.el
+++ b/layers/+lang/php/packages.el
@@ -19,7 +19,8 @@
ggtags
helm-gtags
php-auto-yasnippets
- (php-extras :location (recipe :fetcher github :repo "arnested/php-extras"))
+ ;; Comment out to prevent internet access. -rk 12/21/2015
+ ;; (php-extras :location (recipe :fetcher github :repo "arnested/php-extras"))
php-mode
phpcbf
phpunit
diff --git a/layers/+tools/command-log/packages.el b/layers/+tools/command-log/packages.el
index cbae828..2607bbf 100644
--- a/layers/+tools/command-log/packages.el
+++ b/layers/+tools/command-log/packages.el
@@ -15,9 +15,11 @@
;; is an open PR to merge the fork into the original repo.
;; TODO when the PR is merged upstream, change to use the original package
;; from MELPA (IOW remove :location argument)
- '((command-log-mode :location (recipe :fetcher github
- :repo "bmag/command-log-mode"
- :branch "color"))))
+ ;;'((command-log-mode :location (recipe :fetcher github
+ ;; :repo "bmag/command-log-mode"
+ ;; :branch "color"))))
+ ;; Commented out above to prevent internet access on startup. -rk 12/21/2015
+ '(command-log-mode))
(setq command-log-excluded-packages '())
diff --git a/layers/+window-management/spacemacs-layouts/packages.el b/layers/+window-management/spacemacs-layouts/packages.el
index 867113a..a63647d 100644
--- a/layers/+window-management/spacemacs-layouts/packages.el
+++ b/layers/+window-management/spacemacs-layouts/packages.el
@@ -12,9 +12,11 @@
(setq spacemacs-layouts-packages
'(;; temporary switch on a fork to fix
;; https://github.com/syl20bnr/spacemacs/issues/4120
- (persp-mode :location (recipe :fetcher github
- :repo "syl20bnr/persp-mode.el"
- :branch "fix-emacsclient-crash"))
+ ;;(persp-mode :location (recipe :fetcher github
+ ;; :repo "syl20bnr/persp-mode.el"
+ ;; :branch "fix-emacsclient-crash"))
+ ;; Above commented out to prevent internet access on startup. -rk 12/21/2015
+ persp-mode
spaceline
eyebrowse))
I came up with a solution that works for me which does not require any change
in spacemacs. This was done by modifying my python wrapper script not to use
--eval emacs command flag to load spacemacs' init.el file. Instead the script
temporarily sets the HOME shell variable to point to spacemacs root directory,
so that init.el would be loaded as the init file. Doing so loaded init.el
prior
to 'after-init-hook' being called. Few other things were also done such
as creating .emacs.d symlink in the spacemacs root directory pointing to ".",
Once emacs starts up the HOME variable is reset via expression such as
'(setenv "HOME" original-value)' passed to emacs via --eval flag.
Now I can have either emacs 24 or 25 running with or without spacemacs all at
the same time. All this without using docker containers.
My goal is to provide a wrapper script which anyone in my company could use to
launch emacs 24 or 25 and optionally enable spacemacs. Of course spacemacs
clashes with almost any non-trivial ~/.emacs one would have used without
spacemacs. I had to refactor my ~/.emacs so that my personal customizations are
the same whether or not I enable spacemacs.
Now the only issue I have with recent changes in spacemacs is the inability to
specify a local directory path in package-archives. I would rather not use http
if I can help it!
ln -s init.el .emacs
#
Launch emacs with temporarily value for HOME which is reset after init.el is loaded
H=
$HOME
HOME=
`
pwd
`
emacs --eval
"
(setenv
\"
HOME
\"
\"
${H}
\"
)
"
Actually the problem was easy to fix as detailed at
#4295
If this one line change is checked in, then I can go back to starting emacs the way I have been doing for months which is to launch emacs via