GithubHelp home page GithubHelp logo

nano-modeline's Introduction

N Λ N O Modeline

Nano modeline is a an alterntive to the GNU/Emacs modeline. It can be displayed at the bottom (mode-line) or at the top (header-line). It is roughly organized as:

[ status | name (primary) secondary ]

There are several modelines that can be installed on a per-mode basis or be made the default one. Currently, only the prog and text mode are generic enough to be made the default. You can also design your own modeline using the various elements composing a modeline. See sources for several example.

Installation

Install with M-: (package-install 'nano-modeline)

Usage example:

(add-hook 'prog-mode-hook            #'nano-modeline-prog-mode)
(add-hook 'text-mode-hook            #'nano-modeline-text-mode)
(add-hook 'org-mode-hook             #'nano-modeline-org-mode)
(add-hook 'pdf-view-mode-hook        #'nano-modeline-pdf-mode)
(add-hook 'mu4e-headers-mode-hook    #'nano-modeline-mu4e-headers-mode)
(add-hook 'mu4e-view-mode-hook       #'nano-modeline-mu4e-message-mode)
(add-hook 'elfeed-show-mode-hook     #'nano-modeline-elfeed-entry-mode)
(add-hook 'elfeed-search-mode-hook   #'nano-modeline-elfeed-search-mode)
(add-hook 'term-mode-hook            #'nano-modeline-term-mode)
(add-hook 'xwidget-webkit-mode-hook  #'nano-modeline-xwidget-mode)
(add-hook 'messages-buffer-mode-hook #'nano-modeline-message-mode)
(add-hook 'org-capture-mode-hook     #'nano-modeline-org-capture-mode)
(add-hook 'org-agenda-mode-hook      #'nano-modeline-org-agenda-mode)

To make a specific mode the default one, you can type:

(nano-modeline-text-mode t)

Currently, only the prog and text mode are generic enough to be made the default.

Screenshots (using N Λ N O theme):

nano-modeline's People

Contributors

aaronjensen avatar damiencassou avatar hans-d avatar macownersclub avatar marlinstrub avatar plattfot avatar rougier avatar seblemaguer avatar tonijarjour avatar vllur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nano-modeline's Issues

How to make buttons?

I see that it's possible to make buttons from both your reddit post and your commit history. How does one actually achieve this though?

When minibuffer window is active, background modeline in (previously) active window is off

I'm not sure what controls the look of the modeline in the active window when the minibuffer window is active, but something seems off. I think the issue is that the right fringe background color is not modified, unlike the background color of the rest of the modeline:

image

(This is using the built-in dichromancy theme, with fringe-mode set to default.)

It's even more noticeable if you increase the right fringe (here I set the right fringe to 80):

image

I can reproduce in vanilla emacs after installing nano-modeline (by calling package-install) and evaluating the following buffer:

(fringe-mode '(4 . 80))
(setq nano-modeline-position 'bottom)
(nano-modeline-mode)

image

(For clarity, the screenshot is taken after splitting the frame in two and calling switch-to-buffer.)

Bottom position not shown

Hello,

I tried your very nice modeline but the bottom position is not shown while top default works fine. I set the nano-modeline-position to 'bottom with an empty init file however the bottom mode-line is empty (full grey).

Thanks for your help.

Be more explicit with (potential) breaking changes

Eg, with the status section now changed it impacted my current small customisation of the nano-modeline- faces.

Also, the switch from status to prefix is quite hefty. A 'deprecation' notice would have been nice.

PS: the main readme still mentions status, while the code is referring to status.

nano-modeline-mu4e-message-mode blocking opening mu4e message

It seems message cannot be opened up correctly when missing :name in the TO or FROM field.

error in process filter: nano-modeline-mu4e-message-to: Wrong type argument: char-or-string-p, nil
error in process filter: Wrong type argument: char-or-string-p, nil

I tried to add some safety check for capitalize and downcase function, namely for:

  • to-names in nano-modeline-mu4e-message-to
  • from-name in nano-modeline-mu4e-message-from

And with that, I could see the modeline correctly handled, and opening up the message. It may also be worth making it safe for when (mu4e-personal-addresses) returns nil.

Expandability

I would like to use nano-modeline as the basis for my mode-line.

nano-modeline seems simple enough and seems to work well.

However it is not that expandabnle as you have to copy all of the function nano-modeline and change that to alter the modelines for particular modes.

Could it be changed do that the let and eval section is put into a separate function so that users can just provide a new version of that function to expand nano.

Showing obvious/boring information

I'm wondering if nano-modeline should show what I would consider obvious/boring information or if it should display nothing. Examples of what I would consider obvious/boring:

  • "RW" (for read-write status): when in a file-visiting buffer, chances are very high that the buffer can be written.
  • "RO" (for read-only status): when in a non-file-visiting buffer, this is always the case that the buffer is read-only.

Information I would really appreciate seeing: "RO" in a file-visiting buffer that is read-only. This is rare and important information. The other cases are obvious and don't deserve my attention.

Dependency on Magnars/s

Hi,

I was trying to give your (quite beautiful!) package a spin but couldn't get it to work with the following configuration

(use-package nano-theme
  :straight (nano-theme :type git
                        :host github
                        :repo "rougier/nano-theme")
  :demand t
  :config
  (nano-dark))

(use-package nano-modeline
  :straight (nano-modeline :type git
                           :host github
                           :repo "rougier/nano-modeline")
  :demand t
  :config
  (nano-modeline))

I would constantly get the error

Error (use-package): nano-modeline/:catch: Cannot open load file: No such file or directory, s Disable showing Disable logging

File is missing: Cannot open load file, No such file or directory, s

It took me a while to realize this, but it was complaining about missing Magnars' string manipulation package, and indeed you swapped out subr-x for s in 3bfc046.

Now this is easily fixed by requiring the s package, but:

  • It would be nice if this would be included in the installation instructions
  • But it would probably be better to remove the dependency on Magnars' package entirely, as the only functions that is used is s-truncate I think, and it's only used twice. (It's possible I'm missing a few instances here, I skimmed through it rather quickly)

What do you think is the best approach?

Incompatible with eldoc in mode-line

When nano-modeline is at the top, eldoc stops showing eldoc messages.

How to reproduce:

  1. Start Emacs with emacs -Q
  2. type M-: (string-trim
  3. the mode-line contains the signature of the string-trim function
  4. load nano-modeline and enable it
  5. do step 2 again

expected: the signature of the string-trim function appears somewhere
actual: no signature appears

This is because eldoc-minibuffer-message changes mode-line-format but nano-modeline (when nano-modeline-position is top) only displays the header-line.

Possible solutions:

  1. temporarily displaying the mode-line in this scenario and letting eldoc shows its stuff in it
  2. copying the value that eldoc writes in the mode-line to the header-line

I can investigate a PR if you tell me what solution you have in mind.

Multibyte characters align error in modeline

When the date string contains multibyte characters such as CJK character, the modeline is wrongly aligned.

image

I found the function nano-modeline--make uses length to calculate align position:

https://github.com/rougier/nano-modeline/blob/2b0f03205c5c818a3a0622fd39779bec43dd5869/nano-modeline.el#L308C55-L308C73

It's ok for singlebyte characters, but for multibyte characters, length only calculated the number of characters.

image

If the string contains multibyte characters, this is not necessarily
the number of bytes in the string; it is the number of characters.
To get the number of bytes, use ‘string-bytes’.

After I replace length with string-bytes in the nano-modeline.el, the time string shows correctly:

image

Error with modeline when using svg-lib

Hello,

Emacs : 29.3
svg-lib : 0.3
nano-modeline : 1.1.0
nano-theme : 0.3.4

I use "nano-theme" and "nano-modeline" and instead of seeing icons in modeline I see text [bootstrap:XXX], I see this for exmple when I am in "capture" in orgmode (org roam dailies capture today).

Looking at the sources I see that svg-lib is required, so I add it via a :
(use-package svg-lib) in my conf and when I restart my emacs my modeline disappears and I get this kind of error :

Error during redisplay: (eval (let* ((nano-modeline-base-face (nano-modeline--base-face 'header)) (left (mapconcat (lambda (element) (if (stringp element) (propertize element 'face nano-modeline-base-face) (apply (car element) (cdr element)))) '((nano-modeline-buffer-status "󰕮") " " (nano-modeline-buffer-name "Dashboard")))) (right (mapconcat (lambda (element) (if (stringp element) (propertize element 'face nano-modeline-base-face) (apply (car element) (cdr element)))) '((nano-modeline-buttons (("[Journal]" org-roam-dailies-capture-today . "Journal") ("[TAB]" tab-new . "New Tab") ("[DIRED]" ziok-dired . "Dired") ("[Toolbar]" tool-bar-mode . "Toolbar") ("[Menu]" menu-bar-mode . "Menu")) t) " " (nano-modeline-window-dedicated)))) (width (window-width)) (outside fringes-outside-margins) (left-fringe (if outside -1.0 0.0)) (left-margin (if outside 0.0 1.0)) (right-fringe (if outside -1.0 0.0)) (right-margin (if outside -1.0 0.0)) (left-max-size (- width (length right) 2)) (left (if (> (length left) left-max-size) (concat (truncate-string-to-width left left-max-size) (propertize "…" 'face `(:inherit ,nano-modeline-base-face))) left))) (concat (propertize " " 'display `(space :align-to (+ left-margin (,left-fringe . left-fringe) (,left-margin . left-margin)))) (propertize " " 'face 'fringe 'display '(space :width (nano-modeline-left-fringe-width))) left (propertize " " 'face `(:inherit ,nano-modeline-base-face) 'display `(space :align-to (- right-margin (,right-fringe . right-fringe) (,right-margin . right-margin) (nano-modeline-right-fringe-width) ,(length right)))) right (propertize " " 'face 'fringe 'display '(space :width (nano-modeline-right-fringe-width)))))) signaled (wrong-type-argument listp nano-modeline-button-active-face) [25 times]

Here my conf for nano-modeline :

(use-package svg-lib)

(set-face-attribute 'default nil
                    :family "Roboto Mono"
                    :weight 'light
                    :height 140)

(set-face-attribute 'bold nil
                    :family "Roboto Mono"
                    :weight 'regular)

(set-face-attribute 'italic nil
                    :family "Victor Mono"
                    :weight 'semilight
                    :slant 'italic)

(set-fontset-font t 'unicode
                    (font-spec :name "Inconsolata Light"
                               :size 16) nil)

(set-fontset-font t '(#xe000 . #xffdd)
                     (font-spec :name "RobotoMono Nerd Font"
                                :size 16) nil)

(use-package nano-theme
  :config
  (load-theme 'nano t)
)

;;(use-package nano-agenda)


(use-package nano-modeline)
(nano-modeline-text-mode t)
(add-hook 'prog-mode-hook            #'nano-modeline-prog-mode)
(add-hook 'text-mode-hook            #'nano-modeline-text-mode)
(add-hook 'org-mode-hook             #'nano-modeline-org-mode)
(add-hook 'pdf-view-mode-hook        #'nano-modeline-pdf-mode)
;;(add-hook 'mu4e-headers-mode-hook    #'nano-modeline-mu4e-headers-mode)
;;(add-hook 'mu4e-view-mode-hook       #'nano-modeline-mu4e-message-mode)
;;(add-hook 'elfeed-show-mode-hook     #'nano-modeline-elfeed-entry-mode)
;;(add-hook 'elfeed-search-mode-hook   #'nano-modeline-elfeed-search-mode)
(add-hook 'term-mode-hook            #'nano-modeline-term-mode)
;;(add-hook 'xwidget-webkit-mode-hook  #'nano-modeline-xwidget-mode)
(add-hook 'messages-buffer-mode-hook #'nano-modeline-message-mode)
;;(add-hook 'org-capture-mode-hook     #'nano-modeline-org-capture-mode)
(add-hook 'org-agenda-mode-hook      #'nano-modeline-org-agenda-mode)

;; pour tester 
(defun ziok-nano-modeline-org-capture-filename ()
    (buffer-file-name (org-base-buffer (current-buffer))))

(defun ziok-nano-modeline-org-capture-mode ()
  "Nano line for org capture mode"  

  (let* ((filename (ziok-nano-modeline-org-capture-filename))
         (save (format "Save entry to %s" filename))
         (buttons `(("SAVE" . (org-capture-finalize . ,save))
                    ("CANCEL" . (org-capture-kill . "Delete entry"))
                    ("[bootstrap:arrows-expand]" . (delete-other-windows . "expand"))
                    )))
    (funcall nano-modeline-position
             `((nano-modeline-buffer-status "ORG") " "
               (nano-modeline-buffer-name "Capture") " "
               (nano-modeline-org-capture-description))
             `((nano-modeline-buttons ,buttons t) " "
               (nano-modeline-window-dedicated)))))

(add-hook 'org-capture-mode-hook     #'ziok-nano-modeline-org-capture-mode)			   

;; pour le bouton DIRED
(defun ziok-dired () 
  (interactive)
  "Dired button function"
  (dired "/home/francois/orgmode/orgroam")
)
;; ajout de bouton sur le dashboard
(defun ziok-nano-modeline-dashboard-mode ()
  "Nano line for Dashboard"
  
  (let ((buttons '( 
	("[Journal]" . (org-roam-dailies-capture-today . "Journal")) 
	("[TAB]" . (tab-new . "New Tab")) 
	("[DIRED]" . (ziok-dired . "Dired")) 
	("[Toolbar]" . (tool-bar-mode . "Toolbar")) 
	("[Menu]" . (menu-bar-mode . "Menu")) 
	)))	
	(funcall nano-modeline-position
             '((nano-modeline-buffer-status "󰕮") " "
               (nano-modeline-buffer-name "Dashboard"))
             `((nano-modeline-buttons ,buttons t) " "
               (nano-modeline-window-dedicated)))))

(add-hook 'dashboard-mode-hook #'ziok-nano-modeline-dashboard-mode)
(add-hook 'post-command-hook #'force-mode-line-update)

On the other hand, "modelines" that don't use button like the default org one work very well.
And without svg-lib everything is OK but button are juste text [bootstrap:XXX]

PS : C'est un plaisir d'utiliser vos créations 👍

Modeline does not utilize global-mode-string

Currently, the modeline does not include global-mode-string. Is this intentional? This causes issues with minor modes that utilize the global-mode-string, such as display-time-mode and display-battery-mode. These modes specifically are useful for those running EXWM.

does `nano-modeline-user-mode` work?

given (funcall ,nano-modeline-user-mode)) , I can't get nano-modeline-user-mode working. My elisp skills are not top notch, so I might be missing something how to properly set the variable to a custom function.
Perhaps an example would help?

Cannot get the simpler nano-modeline to work

Hi,
I am trying to do the following:

(use-package! nano-modeline
  :config
  (nano-modeline-text-mode t))

However, I end up with the following backtrace:

Debugger entered--Lisp error: (wrong-type-argument listp nano-modeline--empty-face)
  face-remap-set-base(header-line nano-modeline--empty-face)
  nano-modeline-header(((nano-modeline-buffer-status) " " (nano-modeline-buffer-name) " " (nano-modeline-git-info)) ((nano-modeline-cursor-position) (nano-modeline-window-dedicated)) t)
  funcall(nano-modeline-header ((nano-modeline-buffer-status) " " (nano-modeline-buffer-name) " " (nano-modeline-git-info)) ((nano-modeline-cursor-position) (nano-modeline-window-dedicated)) t)
  nano-modeline-text-mode(t)

I'm using emacs 28.2, doom emacs.
I've been using nano-modeline and nano-theme for quite a bit, but I cannot get nano-modeline to run with the new API.
Please advise.

Support for transient buffers

Hello!

When using a transient buffer, the modeline shows up. Is there a way to make it not do that?

example (cropped because screen size)
image

Change `when' to `if'

In (when (facep 'nano-faded) 'nano-faded 'default) (line 166) is the when supposed to be if?

Suggestion: less hardcoding, more customisation functionality

With v0.3 the number of hardcoded items has increased significantly (eg names of the modes). It would be friendlier if these sections are more customisable, either via variables or - preferred - functions.

With the added overhead, I might make sense to split the mode specific bits into separate files.

Support for minions.el?

Hello!

I really enjoy how this mode line looks, but I would like to add minions.el so I have an easier menu for managing my minor modes.

Would you consider possibly adding support for it? Here is where they discuss how to make a mode line compatible.

Not hiding original modeline

Hi,

I have updated to the latest version (it's been a while since I've last updated) and the "real" mode line is not disappearing when I set the mode line to the header position.

my config:

(use-package nano-modeline
  :after (nano-theme)
  :hook
  (prog-mode-hook            . nano-modeline-prog-mode)
  (text-mode-hook            . nano-modeline-text-mode)
  (org-mode-hook             . nano-modeline-org-mode)
  (pdf-view-mode-hook        . nano-modeline-pdf-mode)
  (mu4e-headers-mode-hook    . nano-modeline-mu4e-headers-mode)
  (mu4e-view-mode-hook       . nano-modeline-mu4e-message-mode)
  (elfeed-show-mode-hook     . nano-modeline-elfeed-entry-mode)
  (elfeed-search-mode-hook   . nano-modeline-elfeed-search-mode)
  (term-mode-hook            . nano-modeline-term-mode)
  (xwidget-webkit-mode-hook  . nano-modeline-xwidget-mode)
  (messages-buffer-mode-hook . nano-modeline-message-mode)
  (org-capture-mode-hook     . nano-modeline-org-capture-mode)
  (org-agenda-mode-hook      . nano-modeline-org-agenda-mode)
  :init (nano-modeline-text-mode t))

Wrong Number of Arguments

I just installed via Elpa and ran nano-modeline-mode and I get wrong number of arguments: (3 . 4), 2

[Question] How to update modeline when switching themes?

Hi,

I have an issue where the colour of the modeline does not update when switching themes.

Here is a screenshot of the theme I use on start-up, the doom-nord theme.

image

And here is a screenshot after switching to ef-maris-light, where the modeline retains the doom-nord colours.

image

This problem is persistent with all themes. For instance, if I use ef-maris-light on start-up and switch to doom-nord, then doom-nord will have a ef-maris-light-coloured modeline.

I had some issues with lingering borders when switching themes, so in my configuration, I have this code snippet that advices load-theme to always disable the current theme when switching themes. This has resolved the issue for borders and other UI elements, such as source code blocks in Org-documents, but does not seem to affect nano-modeline. Removing this snippet also does not resolve the nano-modeline issue.

(defadvice load-theme
  (before disable-before-load (theme &optional no-confirm no-enable) activate)
  (mapc 'disable-theme custom-enabled-themes))

I would really appreciate any help! My full config is also available https://github.com/SophieBosio/.emacs.d.

Invalid Face Error

When I try to run nano-modeline since the update to the modular version a week or so ago, I get the error 'Invalid Face':

Debugger entered--Lisp error: (error "Invalid face")
  internal-get-lisp-face-attribute(nil :foreground nil)
  face-attribute(nil :foreground nil nil)
  face-foreground(nil)
  (list t ':foreground (face-foreground (if (facep 'nano-faded) (progn 'nano-faded 'default))) ':background (face-background 'header-line nil t) ':family "Roboto Mono" ':box (cons ':line-width (cons 2 (cons ':color (cons (face-foreground 'default) '(:style none))))))
  (list (list t ':foreground (face-foreground (if (facep 'nano-faded) (progn 'nano-faded 'default))) ':background (face-background 'header-line nil t) ':family "Roboto Mono" ':box (cons ':line-width (cons 2 (cons ':color (cons (face-foreground 'default) '(:style none)))))))
  (custom-declare-face 'nano-modeline-button-inactive-face (list (list t ':foreground (face-foreground (if (facep 'nano-faded) (progn 'nano-faded 'default))) ':background (face-background 'header-line nil t) ':family "Roboto Mono" ':box (cons ':line-width (cons 2 (cons ':color (cons (face-foreground ...) '...)))))) "Inactive button face.")
  require(nano-modeline)
  eval-expression((require 'nano-modeline) nil nil 127)
  funcall-interactively(eval-expression (require 'nano-modeline) nil nil 127)
  command-execute(eval-expression)

To reproduce, start emacs with emacs -Q, and then run:

(add-to-list 'load-path "/your/path/to/nano-modeline-1.0.0")
(require 'nano-modeline)

I tried this on emacs 27.2, 29.0.60, 29.0.91, 30.0.50 and they all show this same error message.

nano-modeline-faces vs faces

Hi, now that the simpler branch is merged, I've started to try to rebuild my modeline with the new toolkit. I was curious about the reason for nano-modeline-faces vs having separate named faces for each possible face. As a user who is needing to customize, what I have ended up doing is adding my own faces and using them. I've never had to do that before in any other package, so it's a bit cumbersome. Also, the way that the base face gets inherited in is clever, but also a bit surprising. I personally think the old way was more manageable as a consumer of the library, but I may very well be missing something.

Problem with ispell-buffer

When M-x ispell-buffer is run, nano-modeline obscures the *Choices* buffer:

Screen Shot 2021-10-30 at 08 41 59

Without nano-modeline, this looks like:

Screen Shot 2021-10-30 at 08 50 18

I'd be happy to move the *Choices* buffer elsewhere but that doesn't seem possible (per my understanding of the ispell source code which could easily be incorrect). I use popper and tried to make it a pop-up but that doesn't work either.

Unable to activate Nano Modeline

I installed Nano Modeline via elpa and used the setup in the README, but during launch I get the below messages.

File mode specification error: (void-function nano-modeline-prog-mode)
File mode specification error: (void-function nano-modeline-text-mode)

It also seems that no matter what kind of buffer I open, I don't get the nano modeline. I tried using (nano-modeline-text-mode t) and got the below error. Trying the same command but with other modes says that the function doesn't exist. I checked the version number and it says it's 1.0.

Debugger entered--Lisp error: (void-function nano-modeline-text-mode)
  (nano-modeline-text-mode t)
  eval-expression((nano-modeline-text-mode t) nil nil 127)
  funcall-interactively(eval-expression (nano-modeline-text-mode t) nil nil 127)
  command-execute(eval-expression)

Installing via quelpa seems to be working though I do get very dark text in the modeline.

image

[Question] Extending default modeline

I'm new to emacs lisp and am wondering whether there's a better way to update the default modeline for my purposes

Right now the default one shows a primary and secondary section, usually a buffer name and git branch name

I'm a user of evil-mode and would like to have a representation of the current evil state in the modeline so I re-defined this function for the default mode line and currently have to execute it manually in order to have it show

The result is like this
Screen Shot 2022-06-13 at 1 40 24 PM

The change is this (cond ...) portion at the end

(defun nano-modeline-default-mode (&optional icon)
    (let ((icon (or icon
                    (plist-get (cdr (assoc 'text-mode nano-modeline-mode-formats)) :icon)))
          ;; We take into account the case of narrowed buffers
          (buffer-name (cond
                        ((and (derived-mode-p 'org-mode)
                              (buffer-narrowed-p)
                              (buffer-base-buffer))
                         (format"%s [%s]" (buffer-base-buffer)
                                (org-link-display-format
                                (substring-no-properties (or (org-get-heading 'no-tags)
                                                         "-")))))
                        ((and (buffer-narrowed-p)
                              (buffer-base-buffer))
                         (format"%s [narrow]" (buffer-base-buffer)))
                        (t
                         (format-mode-line "%b"))))

          (mode-name   (nano-modeline-mode-name))
          (branch      (nano-modeline-vc-branch))
          (position    (format-mode-line "%l:%c")))
      (nano-modeline-render icon
                            buffer-name
                            (concat
                             (if branch
                                 (concat "(" branch ")")
                               "")
                             " "
                             (concat
                              "<"
                              (cond
                              (( eq evil-state 'visual) "V")
                              (( eq evil-state 'normal) "N")
                              (( eq evil-state 'insert) "I")
                              (( eq evil-state 'emacs) "E")
                              (t "*"))
                              ">"))
                            position)))

So:

  • I see that I can set this variable by re-setting the custom variable
  • And I see that in the code the user-mode is now deprecated
  • And I know it's sugested to add additional desired modes to the list of mode-formats
  • I like the current default modeline, I just want to add to it
  • Question is: is this the best way to go about doing it?
    • Followup question: Would you be opposed to me opening a PR that introduces this to the default modeline in a cleaner way?

Ability to show header-line in EXWM

Hi, would it be possible to enable nano-modeline to show the header-line when there is an X window open in EXWM mode?

Would this be something I need to configure with EXWM?

With nano-modeline-position 'bottom I'm guessing this sets to mode-line, which works perfectly fine. But I would much prefer header-line

Thanks

Outdated screenshots

The screenshots in the README show mode-specific prefixes but it seems commit d13a112 removed them (without detailing why).

New branch "simpler"

I've fully rewritten the modeline to make it easier to maintain and faster to display. Usage is now (for example):

(add-hook 'prog-mode-hook #'nano-modeline-prog-mode)

This installs the nano-modeline-prog-mode line for prog-mode that has been defined as:

(defun nano-modeline-prog-mode (&optional default)
  "Nano line for prog mode. Can be made DEFAULT mode."
  
  (funcall nano-modeline-position
            '((nano-modeline-buffer-status) " "
              (nano-modeline-buffer-name) " "
              (nano-modeline-git-info))
            '((nano-modeline-cursor-position)
              (nano-modeline-window-dedicated))
            default))

It should now be easier to contribute new dedicated modes. Also the modeline is aligned with left/right margins but includes fringes. This is not an option yet but if people are interested, it can be made an option.

Blank modeline

Hello. I am on debian bookworm stable and emacs 28.2. I installed the package from elpa but the new modeline is blank.
Screenshot from 2023-10-23 20-14-49
The empty gray bar at the top is supposed to be the new modeline. I see the following error in the Messages buffer.
Screenshot from 2023-10-23 20-18-36
It looks related to the modeline issue, so I googled and understood that the error means mapconcat is expecting 2 arguments but it is getting some other number of arguments. Let me know if I'm wrong. I looked at the definition of mapconcat and it has 2 arguments, function and sequence, and 1 optional separator argument. I went to the elisp file and to the section where this sexp in error is.
Screenshot from 2023-10-23 20-58-03
As can be seen in the above image, my cursor is on the sequence argument as the echo area says and lines 257-260 is the function argument. I googled what ",left" means and it says the comma means lisp should evaluate it and replace it with the value, which is what I can see in the error in the Messages buffer, the left is replaced with a constant list. I don't understand elisp enough yet to understand what the lambda function is doing but looks like mapconcat is getting 2 arguments as expected right? What am I missing here?

Latest master branch commits break invalid face box atrributes.

The latest emacs 30.0.5 master branch commits made changes to the validation logic for the :box attribute:

* src/xfaces.c (Finternal_set_lisp_face_attribute): Fix the logic
of validating the :box attribute.  The previous code would always
allow invalid attributes of :box as long as the invalid attribute
was the last in the list.  (Bug#67404)

And:

* src/xfaces.c (Finternal_set_lisp_face_attribute): Fix validation
of the :style attribute of :box.  Previously, nil for :style was not
accepted, which causes 'mode-line-inactive' face to be rejected.
(Bug#67567)

Likely an update is needed how nano-modeline sets some face attributes, so I changed :style none on line 164 and 171 to read :style nil. (none is an invalid attribute)
When I eval/load the package it works as expected, but when loaded in my init, it craps out with no error message. (..)

This was the error I got previously:

Debugger entered--Lisp error: (error "Invalid face box" :line-width 2 :color "black" :style none)
  set-face-attribute(nano-modeline-button-active-face #<frame *scratch* - GNU Emacs at lae 0x55f0d0222328> :foreground "black" :background "white" :family "Roboto Mono" :box (:line-width 2 :color "black" :style none))
  face-spec-set-2(nano-modeline-button-active-face #<frame *scratch* - GNU Emacs at lae 0x55f0d0222328> (:foreground "black" :background "white" :family "Roboto Mono" :box (:line-width 2 :color "black" :style none)))
  face-spec-recalc(nano-modeline-button-active-face #<frame *scratch* - GNU Emacs at lae 0x55f0d0222328>)
  face-spec-set(nano-modeline-button-active-face ((t :foreground "black" :background "white" :family "Roboto Mono" :box (:line-width 2 :color "black" :style none))) face-defface-spec)
  custom-declare-face(nano-modeline-button-active-face ((t :foreground "black" :background "white" :family "Roboto Mono" :box (:line-width 2 :color "black" :style none))) "Active button face")
  require(nano-modeline nil t)

Version 0.3 graphical glitches

Hi,

I installed nano-modeline on version 0.2 and it was working great. Loved the minimal design. Today I changed my package system to straight.el and it pulled 0.3. I noticed some graphical issues and couldn't figure out what it was until I checked versions. I will research more but I thought it was a good idea to open the ticket in case someone updates and see the same issues.

Theme: night-owl-theme
Package system: straight.el (was able to pull 0.2 and it work well again)
Emacs 27.2

Screenshots:

Version 0.3:

image

Setting a default modeline results in different faces being used

Specifically this line does not apply to every buffer:

  (face-remap-set-base 'header-line 'nano-modeline--empty-face)

Because of that, any buffer that does not have an explicit hook to establish a modeline format will use header-line as the basis, rather than default.

Unable to check out repository on Windows

Commit eed2de9 added two files images/nano-modeline-**-focused.png and images/nano-modeline-**-unfocused.png, which contains *, a character Windows does not permit in file names.

Attempting to check out the commit on Windows results in the following:

128 git.exe … "reset" "--hard" "origin/master" "--"
error: invalid path 'images/nano-modeline-**-focused.png'
fatal: Could not reset index file to revision 'origin/master'.

Is it possible to rename these files to some other name?

Weird border and foreground color for inactive modeline when in bottom position

I'm using Emacs 29.0.91 with nano-theme (master branch) and the simpler branch of the nano-modeline (but the same issue can be reproduced with the nano-modeline from the master branch).

This is how the modeline looks when on top:
Screenshot_20230605_174040

This is how it looks when on bottom:
Screenshot_20230605_174205

To reproduce this beheaviour, run this with emacs -Q:

(add-to-list 'load-path <path-to>/nano-theme")
(add-to-list 'load-path "<path-to>/nano-modeline")
(require 'nano-theme)
(require 'nano-modeline)
(load-theme 'nano t)
(setopt nano-modeline-position 'nano-modeline-footer)
(nano-modeline-text-mode t)

Inconsistencies with Magit buffers

Bonjour Nicolas!

I noticed that the mode line has two types of problems with Magit buffers:

  1. Diff and commit log buffers do not have a mode line over them.
  2. The M-x magit-status mode line renders all its contents in a bold weight.

Samples:

Magit windows

Top left is the magit-status, which has a mode line. Below it is a diff, which has no mode line. To the right is a log, again with no mode line.

2021-10-08_09:17:31_1916x1058

Magit status is in bold

Notice how the Dired mode line uses the desired font weights.

2021-10-08_09:14:06_1920x1080

2021-10-08_09:14:14_1920x1080

EDIT: This problem does not occur when (setq nano-modeline-position 'bottom).

Support for lsp mode?

Hi! Sorry for the bother but do you have any suggestions on configuring the modeline to work with lsp-mode? There are two main issues I see:

  • the breadcrumbs push the modeline over
  • the modeline doesn't have any integration with the things lsp wants to do

is there anything I can do to try to fix this on my end?

with v0.3 mode-line still showing when using top position

I'm using anno-modeline with posotion top. On v0.2, the (bottom) mode-line was nicely hidden.

On v0.3 however, the mode-line is still showing.

  • mode-line is set to nil
  • colors used are from mode-line, checked that by modifying face and not seeing that reflected in any other face / did update the modeline colors

So far, not been able to hunt down this in the code changes

nano-modeline causes odd behavior in Info-mode with emacs-28.0.60

Description

Notice some strange behavior when using nano-modeline and navigating in Info-mode. When going back or up from a section next-line would jump two lines and previous-line would go to the previous line but at the start of that line.

Expected behavior

After going back or up from a section that next-line or previous-line would behave as normal and go to the next line or previous line.

Version

Using emacs-pgtk-native-comp-28.0.60-212.69977ea from the flat channel, commit:
e015e7093eb9dff16abb5ae909fee61ba77fc677 with guix

(emacs-version)
"GNU Emacs 28.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)"

Repro

Clone a fresh copy of this repo and checkout the latest commit as of this writing.

(cd /tmp && git clone https://github.com/rougier/nano-modeline.git)
(cd /tmp/nano-modeline && git checkout 2de3884)

Create a file at /tmp/init.el with the content:

(require 'nano-modeline "/tmp/nano-modeline/nano-modeline.el")
(nano-modeline-mode 1)

Run emacs with just nano-modeline enabled

emacs -Q -l /tmp/init.el

Then M-x info, press m (Info-menu) type Emacs and hit enter to go to the Emacs manual. Press u (Info-up) to go back up and press C-n (next-line) and it will skip the manual under Emacs and go to the next. After that the behavior is normal.

Run emacs without nano-modeline

emacs -Q 

And do the same steps as above and it will go the manual under Emacs.

void-function nano-modeline-text-mode

With emacs -Q I simply install the package M-: (package-install 'nano-modeline).
I add a hook (add-hook 'text-mode-hook #'nano-modeline-text-mode).
Enable text-mode and get following error:
(void-function nano-modeline-text-mode)
Any idea?

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.