Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

Not be able to enable relative number line by default #2161

Closed
yejianye opened this issue Jul 2, 2015 · 14 comments
Closed

Not be able to enable relative number line by default #2161

yejianye opened this issue Jul 2, 2015 · 14 comments

Comments

@yejianye
Copy link

yejianye commented Jul 2, 2015

Environment:

  • spacemacs version: 0.102.2
  • emacs version: 24.5.1
  • OS: ubuntu 12.04

Steps:
I added

(global-linum-mode)
(linum-relative-toggle)

in dotspacemacs/config. But when I started Emacs, it enables line numbers but not relative numbers.

@duerrp
Copy link
Contributor

duerrp commented Jul 16, 2015

I use this:

  ;; Make linums relative by default
  (with-eval-after-load 'linum
    (linum-relative-toggle))

@yejianye
Copy link
Author

That works, thanks!

On Thursday, July 16, 2015 at 5:26 PM, duerrp wrote:

I use this:
;; Make linums relative by default (with-eval-after-load 'linum (linum-relative-toggle))


Reply to this email directly or view it on GitHub (#2161 (comment)).

@honza
Copy link

honza commented Sep 23, 2015

Works for me, too

@diego-alvarez-hs
Copy link

doesn't work for me.

Am I doing something wrong?

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
 This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
  )

(defun dotspacemacs/config ()
  ;; Make linums relative by default
  (with-eval-after-load 'linum
    (linum-relative-toggle))
  )

@person808
Copy link
Contributor

@diego-alvarez-hs Delete the dotspacemacs/config function and stick the code in the dotspacemacs/user-config function. I think dotspacemacs/config won't be called if dotspacemacs/user-config exists.

@justbur
Copy link
Contributor

justbur commented Oct 1, 2015

That's correct

@diego-alvarez-hs
Copy link

It doesn't work :(
This is my current .emacspace

@diego-alvarez-hs
Copy link

If I start it manually with SPC : linum-mode it works

@d1egoaz
Copy link

d1egoaz commented Oct 2, 2015

💃 This conf worked for me:

 ;; Make linums relative by default
  (global-linum-mode nil)
  (linum-relative-toggle)

@xoltar
Copy link

xoltar commented Oct 15, 2015

Any attempt to use linum-relative (including @d1egoaz 's solution above) now triggers cascades of this for me:
Error (use-package): linum-relative :config: Lisp nesting exceeds `max-lisp-eval-depth'

Though the autoload solution used to work, it doesn't anymore for some reason.

@justbur
Copy link
Contributor

justbur commented Oct 15, 2015

The max-lisp-eval-depth message is usually an infinite recursion error

@d1egoaz
Copy link

d1egoaz commented Oct 15, 2015

@xoltar maybe it's something failing before enabling linum.

Try to move those lines at the beginning of user-config.

@justbur
Copy link
Contributor

justbur commented Oct 15, 2015

Just checked out the init function for this package, and it wasn't set up well. Hopefully #3416 will fix these issues.

syl20bnr pushed a commit that referenced this issue Oct 19, 2015
The toggle is being called after the package is loaded, but the package
is deferred based on a call to the toggle. This means that the first
time toggle is used it's called at least twice. Furthermore, `(setq
linum-format 'linum-relative)` effectively turns on the mode as it is.

Possible fix for #2161
@syl20bnr
Copy link
Owner

@yejianye should be fixed in develop, can you test it when you get a chance ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants