Coder Social home page Coder Social logo

telephone-line's People

Contributors

anandpiyer avatar bjpbakker avatar dbordak avatar eshrh avatar fdeitylink avatar gagbo avatar jhert0 avatar mikethegreat avatar myterminal avatar ogdenwebb avatar ryanprior avatar sahilkang avatar sebasmonia avatar skangas avatar swflint avatar syohex avatar trev-dev 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

telephone-line's Issues

Vertical flat separator

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:
screenshot-2017-06-11_16-45-41
With the following:

  (setq telephone-line-height 20)

screenshot-2017-06-11_16-46-25

Other separators work fine with telephone-line-height.

Responsive Modeline

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.

Box around text: make the mode-line look good (if possible)

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.

screenshot

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)

changing evil state colors

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.

ryo modal mode

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

Add example theming

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.

Theme/configuration support for telephone-line

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.

reloading

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?

Segment Modifier Ideas

Now that there's support for this, might as well think about what else could be implemented through this.

  • Truncation -- limit segment to N characters. Could even replace use-short-tag.
  • Foreground color?
  • Text transformations -- uppercase, etc. Could then make evil tags titlecase.
  • Segment-specific parameters.
    • Padding for x/y on position segment(s)
    • Whether to enable the paradox support?

If any of these sound like something that someone would use, please reply to this issue and I'll prioritize it.

Nyan mode - any chance?

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?

Slight memory issue

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.

Can't see git branch

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?

Support mismatched center colorsyms

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:

  • Leave as is and document it (might be desired behavior?)
  • Add separator
  • Throw error (or just warning?)
  • Special handling? (add separator equidistant from both sides?)

Trig separators

This is something that other people could probably figure out without intimate knowledge of the codebase.

Error using `telefphone-line-defsegment*` macro

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?

Minor mode segment has too much left padding

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.

Rendering Error

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))

Telephone line logs error message

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]

telephone-line-flat causes error in terminal emacs

Hi!
I use emacs for notetaking on android, using termux and your statusline is great on small displays!
However, I would like the option of disabling seperators to save even more space.

the telephone-line-flat separator does exactly this in gui mode:
image

However for the terminal, this happens:
image

Pad cursor position to prevent resizing

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.

Weird color behaviour

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:

screen shot 2017-11-11 at 01 57 21

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.

Two custom fragments are flickering/banishing under certain circumstances

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.

issue

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))))

Customizable colors

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.

Non fixed-width character set

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.

Weird custom face rendering

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

image

Fill face

As it stands, the center segment has to be nil since the fill function just tosses the face arg out.

Allow utf-8 glyphs regardless of gui/terminal mode

As mentioned in this issue: #45, It would be great to have the ability to have utf-8 glyphs used, EVEN when drawing is available. Like "forcing" using the alt-char. There are many great symbols (example) to use as separators.

Would this be possible?

Cannot use custom face

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))

Powerline in -nw mode doesn't invert forground/brackground on right-hand-side for alt-char

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)                                                                                                                                                                                                           

GTK:
image

Terminal:
image

Of course, the gui uses the graphic, not the alt-char.
One workaround is using the left-pointing chars on both sides:
image

Enhance Readme

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

Switch from PBM to XPM

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.

Remove Memoize

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.

Centering segments in telephone-line mode

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?

Displaying workgroups2 information on telephone-line

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.

Tests

Add them. Probably write them first, or else there's nothing to add.

Improve default colorscheme

I initially just copied... something from vim, airline I guess? But the INSERT green is kinda grating and bright. Need to improve contrast.

Problems with theme-changer

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)

captura_27-10-2015-171119

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.