dbordak / telephone-line Goto Github PK
View Code? Open in Web Editor NEWA new implementation of Powerline for Emacs
License: GNU General Public License v3.0
A new implementation of Powerline for Emacs
License: GNU General Public License v3.0
Is the telephone-line-nil
using to create vertical flat separator, i.e. | *segment* |
? If so, there's a problem with telephone-line-height
, because it grows horizontally instead of vertically.
Without custom height:
With the following:
(setq telephone-line-height 20)
Other separators work fine with telephone-line-height.
I have no idea if this is in the scope of this library, but I had in vim some library (can't remember which, maybe it was built into powerline?) which would remove sections of the mode line when a window got smaller. This way if you partitioned up a frame too much the mode line would still look good instead of just pushing important sections off of the screen. As far as I know current powerline implementations on emacs don't have this, and in my opinion it would be an awesome addition.
My mode-line looks skinny, lol. I tried changing the face and adding a box around text
, however, it doesn't look good with this mode-line turned on.
Maybe a workaround for this is not trying anything far-fetched and just modify the theme of my telephone-line to use the same colors and to banish the separators (I don't know exactly how to do that, hope the documentation is enough for me)
How do change the default modal colors of evil telephone line faces?
From reading the source code, it seems that telephone-line-modal-face
is responsible for this returning the right face on modal changes.
I'm not sure whether I need to overwrite the telephone-line-modal-face
function to return the faces I want for mode or if I should overwrite the faces (telephone-line-evil-insert
, telephone-line-evil-normal
, etc.).
I did look at the examples provided but I couldn't figure out a clear way to do this.
I switched from xah-fly-keys to ryo modal mode. I like telephone line very much, would it be much work to make it compatible with ryo modal mode?
Regards
Thorsten
Emacs supports using multiple color themes at a time, I could make some examples that go with popular themes. Gotta figure out what the best targets are. Last I checked, everyone was using Solarized and Zenburn, dunno if that's changed by now.
Telephone-line don't work on message buffer.What should I do?
Firstly it isn't directly a feature request, because I just want to discuss how to best integrate my Emacs theme and the telephone-line configuration at this moment. Well, at least I don't plan to include tl configuration into my theme in the near future.
For example, some non-default Emacs mode-lines such as powerline and smart-mode-line support theme settings via set a variable or through a function call, but there's no way related to telephone-line.
Of course, at any time I can just exclude telephone-line config from emacs.d and provide this as a optional part of my theme, but I want to easily switch between my own telephone line configuration, maybe some other user configs and tl defaults for testing purposes.
hey there. I'm just starting out with customizing my modeline and having to restart emacs every time. I've heard that's bad. Is there a way I can try out different configurations of telephone-line without restarting the whole editor?
Now that there's support for this, might as well think about what else could be implemented through this.
If any of these sound like something that someone would use, please reply to this issue and I'll prioritize it.
Can you please post the configs for telephone-line of the screenshots, they look so cool :-)
As the author of nyan mode writes it doesn't work with powerline, but he is open to suggestions to fix it. Do you see a chance to get it working in telephone-line?
Memoization occurs per separator instance; that is, it includes both the image and the foreground/background. This means each one consumes memory per every combination of segment intersections. This isn't really a big optimization, but it could be improved.
Is it possible to use it with xah-fly-keys?
http://ergoemacs.org/misc/ergoemacs_vi_mode.html
Xah-fly-keys basically uses two modes
xah-fly-command-mode-activate
xah-fly-insert-mode-activate
very simple. I would be nice if
telephone-line-evil-tag-segment
could work with it.
Thorsten
I tried using telephone-line, including requiring the package and applying the example theme, but I still don't see the current git branch. Could I be missing a package?
As it stands, the final LHS segment needs to have the same colorsym as the first RHS segment. If they don't match, the color abruptly changes.
Options:
This is something that other people could probably figure out without intimate knowledge of the codebase.
Hello guys, after update telephone-line I started to get the Not enough arguments for format string
error, but I'm not sure if this was caused by the update or because of my customizations. I have a lot of customizations that use telephone-line-defsegment
's macro but the only one that is raising the error is the that:
(telephone-line-defsegment* squiter/telephone-line-projectile-project-name
`(""
,(telephone-line-raw (ignore-errors (format "📁 %s" (projectile-project-name))))))
I already run the body of the macro alone and it doesn't raise error.
Can you help me to find the error?
Since this is built the same way it is in the default mode-line, it has internal left padding (in the regular mode-line, "segments" are expected to provide their own padding). This is added to the interpolated padding from telephone-line.
I'm trying to use the default evil config for telephone-line and I'm receiving this error
Error during redisplay: (eval (telephone-line-separator-render telephone-line-abs-right (telephone-line-face-map (quote evil)) (telephone-line-face-map (quote accent)))) signaled (void-function alist-get)
Error during redisplay: (eval (telephone-line-add-subseparators (quote (telephone-line-airline-position-segment)) telephone-line-abs-hollow-right (quote evil))) signaled (void-function alist-get)
The relevant part of my init.el
is
(use-package telephone-line
:ensure t
:config
(telephone-line-evil-config))
Not sure if this is serious, but I get to see this error message several times in my messages buffer.
Error during redisplay: (eval (telephone-line-add-subseparators (quote (misc-info-segment telephone-line-major-mode-segment)) (function telephone-line-abs-hollow-right) (quote nil))) signaled (void-
function misc-info-segment) [56 times]
When the cursor position changes, the size of the coordinates (x, y
can change and cause the section they are in to resize. It would be nice if, given there is enough mode-line space, to pad this information so that all other sections aren't shifted over. There is already an option to increase the extra padding for separators, maybe the space from this extra padding could be used so that all separators remain in the same position.
Telephone-line seems to be rendering my separator colors incorrectly.
Here's all of my config that's related to telephone-line:
(use-package telephone-line
:ensure t
:config
(setq
telephone-line-height 24
telephone-line-primary-left-separator 'telephone-line-cubed-left
telephone-line-primary-right-separator 'telephone-line-cubed-right
telephone-line-secondary-left-separator 'telephone-line-cubed-hollow-left
telephone-line-secondary-right-separator'telephone-line-cubed-hollow-right)
(require 'telephone-line-config)
(telephone-line-evil-config))
And here's a screenshot of the result:
This seems to occur regardless of the theme I use. I'm pretty new to emacs though, so there is a pretty high chance that I made a mistake somewhere.
Given that I attempt to define:
(telephone-line-defsegment my-test "test")
returns:
"Invalid lambda variable (face)"
So, I have these two custom fragments that show the branch and the flycheck status on the mode-line (duh!) and they flicker/banish under certain circumstances.
As you can see, the fragments takes few seconds to appear after a file from a project is visited, also, both banish if flycheck reports an issue and when editing they both flicker; this issue had not happened at org-mode or any other major-mode that have no flycheck checker available/enabled. I'm not sure how to debug this issue, there is the relevant source code:
(telephone-line-defsegment* shackra-vc-info
(when vc-mode
(cond ((string-match "Git[:-]" vc-mode)
(let ((branch (mapconcat 'concat (cdr (split-string vc-mode "[:-]")) "-")))
(concat
(propertize (format " %s" (all-the-icons-alltheicon "git")) 'face `(:foreground "orange" :height 1.3) 'display '(raise -0.1))
" · "
(propertize (format "%s" (all-the-icons-octicon "git-branch"))
'face `(:foreground "yellow" :height 1.3 :family ,(all-the-icons-octicon-family))
'display '(raise -0.1))
(propertize (format " %s" branch) 'face `(:foreground "yellow" :height 0.9)))))
((string-match "SVN-" vc-mode)
(let ((revision (cadr (split-string vc-mode "-"))))
(concat
(propertize (format " %s" (all-the-icons-faicon "cloud")) 'face `(:height 1.3) 'display '(raise -0.1))
(propertize (format " · %s" revision) 'face `(:height 0.9)))))
(t (format "%s" vc-mode)))))
(telephone-line-defsegment* shackra-flycheck-status
(let* ((text (pcase flycheck-last-status-change
(`finished (if flycheck-current-errors
(let ((count (let-alist (flycheck-count-errors flycheck-current-errors)
(+ (or .warning 0) (or .error 0)))))
(propertize (format " ✖ %s problema%s" count (unless (eq 1 count) "s"))) 'face `(:foreground "orange"))
(propertize " ✔ Sin problemas" 'face `(:foreground "dark grey"))))
(`running (propertize " ⟲ En ejecución") 'face `(:foreground "deep sky blue"))
(`no-checker (propertize " ⚠ No existe revisor" 'face `(:foreground "dim grey")))
(`not-checked (propertize " ✖ Sin revisar" 'face `(:foreground "dim grey")))
(`errored (propertize " ⚠ Error" 'face `(:foreground "tomato")))
(`interrupted (propertize " ⛔ Interrumpido" 'face `(:foreground "tomato")))
(`suspicious ""))))
(propertize text
'help-echo "Muestra errores detectados por Flycheck"
'local-map (make-mode-line-mouse-map
'mouse-1 (lambda () (interactive) (flycheck-list-errors))))))
(setf telephone-line-lhs
'((accent . (shackra-line-buffer-segment shackra-buffer-vc-modified-segment))
(nil . (shackra-vc-info shackra-flycheck-status))))
As it is, there are three color symbols -- nil, accent, and evil. This is ok for a typical setup, but more exotic displays might want more. There should either be a way of adding new color syms, or the syms should be replaced with something else.
I'm currently using spaceline
. I made a function to insert icons from https://materialdesignicons.com/. The issue is that most of the icons are wider than regular characters and so when used on the right end of the mode-line, the segments following the icon are shifted by a little and the mode-line is truncated by as much.
I was wondering if there was a way to counterfeit this with telephone-line
.
It might be useful to allow for more section types to be added, even if they only differ in color. In addition, these might need to be non-symmetric, ie only only the left or right side.
Here is my init file chunk of config
I took code from this example
(use-package telephone-line
:config
(defface my-custom-face
'((t (:background "white" :foreground "blue"))) "")
(setq telephone-line-faces
'((custom-color . (my-custom-face . my-custom-face ))
(nil . (mode-line . mode-line-inactive))
(accent . (telephone-line-accent-active . telephone-line-accent-inactive))))
(setq telephone-line-lhs
'((custom-color . (telephone-line-buffer-segment))
(nil . (telephone-line-vc-segment))
(accent . (telephone-line-major-mode-segment))))
(telephone-line-mode 1))
Here is actual bevahior
As it stands, the center segment has to be nil since the fill function just tosses the face arg out.
Both position segments have paradox specialcased since it overrides front-space with position info. If I reimplement their handling (rather than just shelling out to it and trimming the result), it could be used for other modes based on tabulated-list.
As far as I know, there's telephone-line-selected-window-active
for a custom segment, but it's kinda hard to use this function with the built-in telephone-line segments.
I mean add something like:
(setq telephone-line-rhs
'((nil . (telephone-line-vc-segment :active))
There should be less of a choice; it should be more automatic
For some reason I cannot use a custom face for my segment, I'm getting this error when I make something that sets a value in the variable venv-current-name
:
Error during redisplay: (eval (telephone-line-add-subseparators (quote ((lambda (face) (telephone-line-raw venv-current-name)))) telephone-line-cubed-hollow-right (quote orange))) signaled (wrong-type-argument listp shackra-orange)
Error during redisplay: (eval (telephone-line-separator-render telephone-line-cubed-right (telephone-line-face-map (quote accent)) (telephone-line-face-map (quote orange)))) signaled (wrong-type-argument listp shackra-orange)
Error during redisplay: (eval (telephone-line-separator-render telephone-line-cubed-right (telephone-line-face-map (quote orange)) (telephone-line-face-map (quote nil)))) signaled (wrong-type-argument listp shackra-orange)
Here is my configuration:
(use-package telephone-line
:preface (defun shackra/vc-state ()
(if vc-mode
(vc-state (buffer-file-name (current-buffer)))
nil))
:init
;; define una nueva cara
(defface shackra-orange '((t (:foreground "white" :background "orange"))) "")
;; Informa a telephine-line sobre la existencia de la nueva cara, llamada `orange'
;; Cambia el estilo de los separadores
(setq telephone-line-primary-left-separator 'telephone-line-cubed-left
telephone-line-secondary-left-separator 'telephone-line-cubed-hollow-left
telephone-line-primary-right-separator 'telephone-line-cubed-right
telephone-line-secondary-right-separator 'telephone-line-cubed-hollow-right)
(setf telephone-line-height 40)
(custom-set-faces
'(mode-line ((t (:box nil))))
'(mode-line-inactive ((t (:box nil))))
'(mode-line-highlight ((t (:box nil)))))
:config
(add-to-list 'telephone-line-faces '(orange . shackra-orange))
(telephone-line-defsegment* shackra-buffer-vc-modified-segment ()
(list (cond ((buffer-modified-p)
(propertize (format " %s" (all-the-icons-faicon "pencil")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
'display '(raise -0.1) 'help-echo "Buffer modificado."))
((eq (shackra/vc-state) 'edited)
(propertize (format " %s?" (all-the-icons-faicon "cloud-upload")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
'display '(raise -0.1) 'help-echo "Cambios sin registrar.")))
(cond ((eq (shackra/vc-state) 'missing)
(propertize (format " %s " (all-the-icons-faicon "trash")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
'display '(raise -0.1) 'help-echo "Archivo sólo existe en VCS, no en el disco duro."))
((eq (shackra/vc-state) 'ignored)
(propertize (format " %s " (all-the-icons-faicon "ban")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
'display '(raise -0.1) 'help-echo "Archivo ignorado"))
((eq (shackra/vc-state) 'added)
(propertize (format " %s " (all-the-icons-faicon "plus")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
'display '(raise -0.1) 'help-echo "Archivo será registrado en VCS en el siguiente commit."))
((eq (shackra/vc-state) 'unregistered)
(propertize (format " %s " (all-the-icons-faicon "question")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
'display '(raise -0.1) 'help-echo "Archivo sin registrar al VCS.")))))
(telephone-line-defsegment shackra-virtualenv-name () venv-current-name)
(telephone-line-defsegment shackra-line-buffer-segment ()
(telephone-line-raw mode-line-buffer-identification t))
(telephone-line-defsegment* shackra-vc-info ()
(when vc-mode
(cond ((string-match "Git[:-]" vc-mode)
(let ((branch (mapconcat 'concat (cdr (split-string vc-mode "[:-]")) "-")))
(concat
(propertize (format " %s" (all-the-icons-faicon "git-square" :v-adjust -0.1)) 'face `(:foreground "orange" :height 1.3 :family ,(all-the-icons-octicon-family)))
(propertize (format "%s" branch) 'face `(:foreground "orange")))))
(t (format "%s" vc-mode)))))
(telephone-line-defsegment* shackra-flycheck-status ()
(let* ((text (pcase flycheck-last-status-change
(`finished (if flycheck-current-errors
(let ((count (let-alist (flycheck-count-errors flycheck-current-errors)
(+ (or .warning 0) (or .error 0)))))
(propertize (format " ✖ %s problema%s" count (if (> count 1) "s" "")) 'face `(:foreground "orange")))
(propertize " ✔ Sin problemas" 'face `(:foreground "dark grey"))))
(`running (propertize " ⟲ En ejecución" 'face `(:foreground "deep sky blue")))
(`no-checker (propertize " ⚠ No existe revisor" 'face `(:foreground "dim grey")))
(`not-checked (propertize " ✖ Sin revisar" 'face `(:foreground "dim grey")))
(`errored (propertize " ⚠ Error" 'face `(:foreground "tomato")))
(`interrupted (propertize " ⛔ Interrumpido" 'face `(:foreground "tomato")))
(`suspicious ""))))
(propertize text
'help-echo "Muestra errores detectados por Flycheck"
'local-map (make-mode-line-mouse-map
'mouse-1 (lambda () (interactive) (flycheck-list-errors))))))
(setf telephone-line-lhs
'((accent . (shackra-line-buffer-segment shackra-buffer-vc-modified-segment))
(nil . (shackra-vc-info shackra-flycheck-status))))
(setf telephone-line-rhs '((nil . (telephone-line-misc-info-segment telephone-line-major-mode-segment))
(orange . (shackra-virtualenv-name))
(accent . (telephone-line-position-segment))))
(telephone-line-mode 1))
Thank you for this great and well designed package! :)
So, the "issue" is that for some seperators where alt-char
is used, the background/foreground is inverted from the desired result.
Without any configuration except:
(setq telephone-line-evil-use-short-tag t)
(telephone-line-evil-config)
Of course, the gui uses the graphic, not the alt-char.
One workaround is using the left-pointing chars on both sides:
Even though I said I wouldn't, the readme is currently mostly copy-pasted from the reddit post. The style is a bit off for a readme, I think, so it should at least be partially rewritten
I made the separators PBMs to more easily allow for arbitrary color, as used for antialiasing. However, XPM is a more compact and readable format. It would be more difficult to handle this since there needs to be a color map (an alist pairing the hex to a symbol), but it can be done with no visual difference.
Besides the inefficiencies it admits, memoize also has another issue I've only just noticed: it's not available on MELPA stable.
I'm not sure what to replace this functionality with at this time, but it's something that should be done in the future.
I like the way of polybar in this regard: it provides modules-[left, center, right]
variables to place there your modules(segments in terms of telephone-line) and this frees the user from unnecessary fuss. Besides telephone line has only telephone-line-lhs
and telephone-line-rhs
. Is it even possible to center some segment without tweaking the package from your side?
Would you add an extra center/middle variable?
I have been trying out various packages for using workgroups in Emacs and have settled down with workgroups2. However, I could not get workgroups information to be displayed on the telephone-line. I even asked a question on emacs.stackexchange.com.
One thing I noticed about telephone-line, is that it is way too easy to configure and customize, thanks to you 👍 . With a little bit of reading, I could figure it all out by myself and answer my own question there. I created a new segment and have it integrated in my dotfiles.
I was thinking, if you wouldn't mind me sending you a merge-request with my implementation of the new segment for workgroups2.
Add them. Probably write them first, or else there's nothing to add.
Things can get kinda screwy if you have both a GUI and a Terminal emacs running on the same server.
I initially just copied... something from vim, airline I guess? But the INSERT green is kinda grating and bright. Need to improve contrast.
As it is, you need to run (telephone-line-mode t)
after customizing, and even then it only applies to new buffers.
I use theme-changer to make Emacs switch the theme depending of the hour of the day, when the theme is changed from a light theme to a darker theme, some colors remains in the separators of telephone-line (as can be seen in the screenshot)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.