{"action":"opened","issue":{"url":"https://api.github.com/repos/hlissner/.emacs.d/issues/170","repository_url":"https://api.github.com/repos/hlissner/.emacs.d","labels_url":"https://api.github.com/repos/hlissner/.emacs.d/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/hlissner/.emacs.d/issues/170/comments","events_url":"https://api.github.com/repos/hlissner/.emacs.d/issues/170/events","html_url":"https://github.com/hlissner/.emacs.d/issues/170","id":248486390,"number":170,"title":"Modeline left hand-side doesn't appear in terminal mode","user":{"login":"amoriello","id":733189,"avatar_url":"https://avatars0.githubusercontent.com/u/733189?v=4","gravatar_id":"","url":"https://api.github.com/users/amoriello","html_url":"https://github.com/amoriello","followers_url":"https://api.github.com/users/amoriello/followers","following_url":"https://api.github.com/users/amoriello/following{/other_user}","gists_url":"https://api.github.com/users/amoriello/gists{/gist_id}","starred_url":"https://api.github.com/users/amoriello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amoriello/subscriptions","organizations_url":"https://api.github.com/users/amoriello/orgs","repos_url":"https://api.github.com/users/amoriello/repos","events_url":"https://api.github.com/users/amoriello/events{/privacy}","received_events_url":"https://api.github.com/users/amoriello/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-07T18:00:58Z","updated_at":"2017-08-07T18:00:58Z","closed_at":null,"body":"Hi\r\n\r\nthe left hand-side of modeline doesn't appear in terminal mode.\r\n\r\nFrom what I see,\r\n\r\n***\r\n**modules/ui/doom-modeline/config.el**\r\n```lisp\r\n\r\n;; The bar regulates the height of the mode-line in GUI Emacs.\r\n(def-modeline-segment! bar\r\n  (when (display-graphic-p)\r\n    (+doom-modeline--make-xpm\r\n     (face-background (if (active)\r\n                          'doom-modeline-bar\r\n                        'doom-modeline-inactive-bar)\r\n                      nil t)\r\n     +doom-modeline-height\r\n     +doom-modeline-bar-width)))\r\n\r\n\r\n...\r\n\r\n\r\n\r\n(def-modeline! main\r\n  (bar matches \" \" buffer-info \"  %l:%c %p  \" selection-info)\r\n  (buffer-encoding major-mode vcs flycheck))\r\n```\r\n\r\n❗️   bar returns nil when in terminal mode\r\n\r\n***\r\n\r\n**core/core-ui.el**\r\n```lisp\r\n(defsubst doom--prepare-modeline-segments (segments)\r\n  (cl-loop for seg in segments\r\n           if (stringp seg)\r\n            collect seg\r\n           else\r\n            collect (list (intern (format \"doom-modeline-segment--%s\" (symbol-name seg))))))\r\n\r\n(defmacro def-modeline! (name lhs &optional rhs)\r\n  \"Defines a modeline format and byte-compiles it. NAME is a symbol to identify\r\nit (used by `doom-modeline' for retrieval). LHS and RHS are lists of symbols of\r\nmodeline segments defined with `def-modeline-segment!'.\r\n\r\nExample:\r\n  (def-modeline! minimal\r\n    (bar matches \\\" \\\" buffer-info)\r\n    (media-info major-mode))\r\n  (doom-set-modeline 'minimal t)\"\r\n  (let ((sym (intern (format \"doom-modeline-format--%s\" name)))\r\n        (lhs-forms (doom--prepare-modeline-segments lhs))\r\n        (rhs-forms (doom--prepare-modeline-segments rhs)))\r\n...\r\n```\r\n***\r\n\r\n❗️ when `def-modline!` process the `lhs` part of the modeline, `doom--prepare-modeline-segments` doesn't expect any of the segments `seg` to be `nil`.\r\n\r\n***\r\n\r\nMaking `def-modeline-segment! bar` return an empty string `\"\"` instead of `nil` when not in GUI mode fixes the issue, but I'm pretty sure this isn't the right fix 😜 (thus, not proposing any PR, since I'm not fluent enough in lisp - working on it - ).\r\n\r\nYou're doing great stuff here, this project actually pushes me to learn lisp.\r\n\r\nHope this helps.\r\n\r\nThanks!\r\n"}}
{"actor":{"display_login":"amoriello"}}