Comments (11)
- Foreground color?
- Truncation -- limit segment to N characters. Could even replace use-short-tag.
- Padding for x/y on position segment(s)
+1
Would be nice to have a feature to specify in telephone-line segment either list of ignored major mode or list of Emacs modes, which will display a segment.
For example, I have the modified-status
segment, but I don't want to see the segment in some major modes such as Warnings
, Messages
, etc. So I wanna get the ability to write list of modes like the following:
(my-modified-status-segment :ignore ("Warnings" "Messages" ...))
;; vice versa
(telephone-line-vc-segment :modes ("Emacs-lisp" "Fundamental"))
from telephone-line.
I've started on this stuff. In order to add segment-specific modifiers, however, I needed to make segments able to have arguments. As such, latest update breaks backwards compatability for defsegments -- you now need an arglist after the segment name, as with defun, etc.
from telephone-line.
Another huge commit, redid the defsegments again (sorry!). Now they throw face into scope (kinda messy, but better than what I had), and defsegment* is for when you want to do trimming, or for segments that will always be displayed (e.g. evil-tag, buffer, etc)
from telephone-line.
Just to clarify a bit more -- the new defsegment is basically the old defsegment*, and the new defsegment* does even less; it doesn't trim nor check for empty strings. To get the old defsegment behavior, you should use defsegment* and manaully call telephone-line-raw.
I did this because it's not likely users will need to do trimming; it's mostly something that would be done in the preset segments. Also because fixed segments (again, like evil-tag) are now slightly more efficient.
The defsegment* -> defsegment change, on the other hand, is because 90% of the time you want that functionality (that is, the current defsegment and old defsegment*), so it didn't make sense to have an asterisk on it -- that should be for the less used, more advanced one.
from telephone-line.
That last comment probably just confused things more by comparing old behavior and new, so I'll just describe the current behavior now:
defsegment ensures the segment will not render if it's an empty string. It does not do trimming. This is what you want in most cases, unless you're wrapping built in mode-line features.
defsegment* does not make any guarantees. It should be used if you want to do your own trimming, or if you know your segment will never be empty. Builtin segments under the latter case include evil-tag, major-mode, and airline-position (normal position doesn't count because it requires trimming).
from telephone-line.
Any changes? Related to #53, now I wanna get padding options to align my center segments.
from telephone-line.
This is definitely the next thing on my list, it's just that I need to rewrite parts of it to allow for you to use more than one modifier at a time.
from telephone-line.
Alright, latest commit adds :args
, :truncate
, and you can now use more than one modifier on a single segment. However, API change -- each segment with modifiers needs to be a proper plist. As an example, here's the config I was testing with:
(setq telephone-line-lhs
'((evil . ((telephone-line-evil-tag-segment
:truncate 2)))
(accent . (telephone-line-vc-segment
telephone-line-erc-modified-channels-segment
telephone-line-process-segment))
(nil . (telephone-line-buffer-segment))))
(setq telephone-line-rhs
'((nil . (telephone-line-misc-info-segment))
(accent . (telephone-line-major-mode-segment))
(evil . ((telephone-line-airline-position-segment
:args (5 5)
:active t)))))
from telephone-line.
Also I should point out that truncate is inefficient at this level since it needs to collapse the segment to a string; using :args
you can implement a more efficient truncation within the segment definition itself.
from telephone-line.
What does :args
actually do? Is it add extra spaces around a segment or not?
from telephone-line.
It passes arguments to segments that were defined with them. Look at the definition of telephone-line-airline-position-segment
in telephone-line-segments.el
-- it takes arguments for padding the lines/columns.
I have not added a generic padding keyword, yet.
from telephone-line.
Related Issues (20)
- Separator not rendering correctly when window is inactive. HOT 2
- Org-clock segment possible? HOT 1
- Rendering errors HOT 1
- Gap after airline segment HOT 3
- Optionally don't render segments if they are empty? HOT 1
- The mode line cannot display color
- hud segment rendering errors in terminal Emacs HOT 1
- Add support for project.el ? HOT 5
- Looking to apply airline-theme colors using telephone-line
- How can suppress the smiley face (`: )`) on the right corner?
- I'm too dumb: passing arguments to segments? HOT 3
- Some `mode-line` elements do not respect `telephone-line-accent-active`
- Error during redisplay: (eval (telephone-line-separator-render telephone-line-gradient
- Support for colors when using meow
- Right margin incorrect for proportional-width fonts
- Telephone line is slow to update HOT 1
- `(fn FACE)"]) telephone-line-tan-hollow-right 'evil)) signaled (wrong-type-argument number-or-marker-p nil)`
- [bug] `airline-position-segment` not displaying `mode-line-position`, important for some major modes HOT 6
- Issue with face for telephone-line-major-mode-segment in elisp major mode HOT 2
- Just installed it in ubuntu emacs 29, and i ged a log of warnings?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telephone-line.