Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to have *helm mu* buffer with truncated lines by default? #46

Open
prosoitos opened this issue Mar 24, 2019 · 11 comments
Open

How to have *helm mu* buffer with truncated lines by default? #46

prosoitos opened this issue Mar 24, 2019 · 11 comments

Comments

@prosoitos
Copy link

My Helm buffers all have truncated lines (which is what I want), but the *helm mu* buffer does not and I have to call helm-toggle-truncate-line each time.

Adding to my init file the line below did not help:

(add-hook 'helm-mode-hook (lambda () (setq truncate-lines t)))
@prosoitos prosoitos changed the title How to have *helm mu* buffer with truncated lines by default How to have *helm mu* buffer with truncated lines by default? Mar 24, 2019
@prosoitos
Copy link
Author

prosoitos commented Mar 25, 2019

Actually, *helm kill ring* also is not truncated by default and I would like to be able to set that too. Some of the Helm functionalities have a variable to set this (e.g. helm-buffers-truncate-lines, helm-moccur-truncate-lines), but others don't. Would it be possible to request this as a feature (or, more simply--and that would totally work for me--to have a global setting for all Helm buffers)?

Thanks!

I can try to look into the code in the coming days/weeks too as time allows. My Emacs Lisp skills are still very basic, but this might not be too crazy to do.

@tmalsburg
Copy link
Member

Helm-mu truncates lines by default in my setup. If it doesn't in your setup that's either due to a bug or due to something in your configuration. Could you please send a screenshot? Thank you!

@prosoitos
Copy link
Author

prosoitos commented Mar 25, 2019

Oh, interesting...

When I first run helm-mu, it doesn't show that it is not truncated since I am displaying it as a single window. But when I C-j onto an item to see it, the *helm mu* buffer now occupies half the screen and and it shows that it is not truncated.

Another thing that is not great (but that is could be my mu4e settings and the fact that, since I use EXWM, I cannot have messages in a new frame) is that in the window that pops up, I don't just have the message window: I have what I normally have when I open a message in mu4e: the message buffer and a bit of the header view buffer (in mu4e, the whole thing looks good because it occupies the full width, not half of it).

So as you can see, not really good... If I run helm-toggle-truncate-line (which I rebinded to an easy key for this), things are better since the *helm mu* buffer now has truncated lines. But it is still not great since I still have that header view buffer in the popup window.

Note: out of respect for the privacy of the people whose names are visible on those screenshots, I will delete them once you have had a look at them (even if they remain in the edits).

@prosoitos
Copy link
Author

prosoitos commented Mar 25, 2019

Probably unrelated, but out of curiosity: does your *helm kill ring* buffer have truncated lines by default as well? (mine is the only other Helm buffer that does not. But it could be something in my settings that interferes with the normal Helm defaults too).

@prosoitos
Copy link
Author

prosoitos commented Mar 25, 2019

And FWIW, the *helm mu contacts* buffer is truncated and using it looks great, without any of the above issues (and this functionality is really great: thank you so much for it! 🙂 )

@tmalsburg
Copy link
Member

Thanks for the explanation and screenshots (feel free to delete them). I'm not really using persistent actions (C-j), so that's why I haven't yet encountered this issue. (My workflow is: select message, press enter, resume helm session to view more messages.) Two things: 1. Yes, if we can set truncation of lines by default that would be good. I'll have to figure out how to do this. 2. The undesired headers view in your screenshot if probably caused by your setting of mu4e-split-view. Try setting it to 'single-window or nil.

My *helm kill ring* is not truncated.

@tmalsburg
Copy link
Member

Interestingly, my helm-mu-contacts is not truncated. No idea why this is different on your system.

@prosoitos
Copy link
Author

prosoitos commented Mar 25, 2019

I'm not really using persistent actions (C-j), so that's why I haven't yet encountered this issue.

Does this mean that if you use C-j your buffer is not truncated either? If that is the case, that is good news for me: others using C-j may also want the buffer to be truncated. And it means that I don't have to trouble shoot all my packages and settings to see what does conflict 🙂 Ouf! 😄

(My workflow is: select message, press enter, resume helm session to view more messages.)

Yes, that's what I am doing now due to this issue. But this leaves all the mu4e buffers open and, while it might be appropriate when wanting to send emails, etc., trying to refresh one's memory about some info lost in some email using C-j is kind of neat: it allows to have a peek at many messages to find the right info, then press C-g and get out of the whole mu4e thing without leaving any open buffer.

The undesired headers view in your screenshot if probably caused by your setting of mu4e-split-view. Try setting it to 'single-window or nil.

I think so too. But changing this affects my mu4e experience (obviously) and it actually breaks Helm-mu. This is probably due to EXWM. Finding a fix for this would be quite challenging I think. But if I could set some options for the *helm mu* buffer when C-j is called (for instance a much smaller width and truncated lines), it wouldn't be nearly as bad.

Interestingly, my helm-mu-contacts is not truncated. No idea why this is different on your system.

This might be because my function (add-hook 'helm-mode-hook (lambda () (setq truncate-lines t))) in my init file is actually doing something in one of the Helm buffers?? If you are really curious to know, I could restart Emacs without it and see what I have for my *helm mu contacts* buffer.

I honestly would like it if all Helm buffers were always with truncated lines or if there was a global Helm option to force that onto all of them (thanks for confirming that your *helm kill ring* is not truncated either by the way. Here again, I am glad it isn't some of my settings that are messing things up). I find the non-truncated Helm buffers a nightmare to read.

Anyhow, thank you for your very quick replies!

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Mar 26, 2019 via email

@prosoitos
Copy link
Author

prosoitos commented Mar 28, 2019

Now you can set helm-truncate-lines to set the truncate-lines value in
all helm buffers at startup.

Great!!! 🙂

The new variable works like a charm 🙂 I now have all my Helm buffers (including Helm kill ring and Helm mu) truncated. Being able to toggle with a key is really cool indeed, but I am really happy to be able to have it in what I find much more readable by default.

Thank you Thierry for doing this and doing it so quickly!!! 🙂 All your work is much appreciated!!

I guess I will close this issue now.

@tmalsburg tmalsburg reopened this Apr 1, 2019
@tmalsburg
Copy link
Member

I'll reopen because I think it makes sense to have truncation by default with this helm source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants