Giter Site home page Giter Site logo

Comments (9)

erikLundstedt avatar erikLundstedt commented on August 19, 2024 3

Hmm... interesting. I tested it with only that in my config.el and it worked for me. Can you provide your configuration in a gist and I'll test more with what you have configured?

reversing the commands actually worked, interesting

my config is on my gitlab
but it actually works now :-)

from crafted-emacs.

jeffbowman avatar jeffbowman commented on August 19, 2024 1

In your rational-config-file you can add (customize-set-variable 'display-line-numbers-type 'relative) to use relative line numbers. For example, you might have something like this:

    (require 'rational-ui)

    (with-eval-after-load "rational-ui"
      (customize-set-variable 'rational-ui-display-line-numbers t)
      (customize-set-variable 'display-line-numbers-type 'relative))

Does this help? If this addresses your issue, would you consider closing this issue? If not, please continue the discussion and we will help as best we can.

from crafted-emacs.

erikLundstedt avatar erikLundstedt commented on August 19, 2024

In your rational-config-file you can add (customize-set-variable 'display-line-numbers-type 'relative) to use relative line numbers. For example, you might have something like this:

    (require 'rational-ui)

    (with-eval-after-load "rational-ui"
      (customize-set-variable 'rational-ui-display-line-numbers t)
      (customize-set-variable 'display-line-numbers-type 'relative))

Does this help? If this addresses your issue, would you consider closing this issue? If not, please continue the discussion and we will help as best we can.

this seems to not have worked

might be an issue with the majormode not being in the "whitelist" but it shouldn`t be as it should be "derived" from prog-mode

from crafted-emacs.

erikLundstedt avatar erikLundstedt commented on August 19, 2024

update

this seems to work but is ugly and might be the wrong way of doing it

 (with-eval-after-load "rational-ui"
   (global-display-line-numbers-mode nil)
   (customize-set-variable 'display-line-numbers-type 'relative)
   (setq display-line-numbers-type 'relative)
   (customize-set-variable 'rational-ui-display-line-numbers t)
   (global-display-line-numbers-mode t)
   )

from crafted-emacs.

erikLundstedt avatar erikLundstedt commented on August 19, 2024

update

this seems to work but is ugly and might be the wrong way of doing it

 (with-eval-after-load "rational-ui"
   (global-display-line-numbers-mode nil)
   (customize-set-variable 'display-line-numbers-type 'relative)
   (setq display-line-numbers-type 'relative)
   (customize-set-variable 'rational-ui-display-line-numbers t)
   (global-display-line-numbers-mode t)
   )

this seems to be the smallest possible fix at the moment,
i personally think that it should be part of the module but i will close the issue as its now fixed for me.
anyone should feel free to (re)open an issue or create a PR if you have a "better"(different/cleaner/smaller) solution that works

 (with-eval-after-load "rational-ui"
   (global-display-line-numbers-mode nil)
   (customize-set-variable 'display-line-numbers-type 'relative)
   (customize-set-variable 'rational-ui-display-line-numbers t)
   (global-display-line-numbers-mode t)
   )

from crafted-emacs.

jeffbowman avatar jeffbowman commented on August 19, 2024

Notice the order I call things in the example I provide. I customize the rational-ui-display-line-numbers variable before customizing the display-line-numbers-type value. In your examples, you invert that. Also, you use global-display-line-numbers-mode which I assume means you prefer to have line numbers displayed regardless of which major mode is being used. In this case, you don't need rational-ui at all (at least for the line-numbers configuration), these lines should do what you want:

    ;; don't need to use line number configuration in rational-ui if you want line numbers always displayed
    (customize-set-variable 'display-line-numbers-type 'relative)
    (global-display-line-numbers-mode)

And just to keep things close together, the original example:

    (require 'rational-ui)

    (with-eval-after-load "rational-ui"
      ;; N.B. line numbers in rational-ui only turn them on for conf-mode and prog-mode (and derivatives)
      ;; line numbers are turned off in org-mode
      ;; order matters here.
      (customize-set-variable 'rational-ui-display-line-numbers t) ; must be set first as it configures modes for line numbers
      (customize-set-variable 'display-line-numbers-type 'relative)) ; configured after the line above to set the type to preference

Hope this helps!

from crafted-emacs.

erikLundstedt avatar erikLundstedt commented on August 19, 2024
      (with-eval-after-load "rational-ui"
      ;; N.B. line numbers in rational-ui only turn them on for conf-mode and prog-mode (and derivatives)
      ;; line numbers are turned off in org-mode
      ;; order matters here.
      (customize-set-variable 'rational-ui-display-line-numbers t) ; must be set first as it configures modes for line numbers
      (customize-set-variable 'display-line-numbers-type 'relative)) ; configured after the line above to set the type to preference

i tried this and it didnt work

from crafted-emacs.

jeffbowman avatar jeffbowman commented on August 19, 2024

Hmm... interesting. I tested it with only that in my config.el and it worked for me. Can you provide your configuration in a gist and I'll test more with what you have configured?

from crafted-emacs.

erikLundstedt avatar erikLundstedt commented on August 19, 2024

nevermind

from crafted-emacs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.