helm-mu icon indicating copy to clipboard operation
helm-mu copied to clipboard

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

Open prosoitos opened this issue 5 years ago • 11 comments

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 avatar Mar 24 '19 21:03 prosoitos

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.

prosoitos avatar Mar 25 '19 10:03 prosoitos

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!

tmalsburg avatar Mar 25 '19 14:03 tmalsburg

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 avatar Mar 25 '19 19:03 prosoitos

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 avatar Mar 25 '19 19:03 prosoitos

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! :slightly_smiling_face: )

prosoitos avatar Mar 25 '19 19:03 prosoitos

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 avatar Mar 25 '19 21:03 tmalsburg

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

tmalsburg avatar Mar 25 '19 21:03 tmalsburg

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 :slightly_smiling_face: Ouf! :smile:

(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!

prosoitos avatar Mar 25 '19 21:03 prosoitos

Marie-Helene Burle [email protected] writes:

Actually, helm kill ring also is not truncated by default and I would like to be able to set that too.

There is no variable to set this by default because it would defeat C-] which allow showing the whole contents of candidates.

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

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

Note that you can change the value at any time with helm-toggle-truncate-line (C-c >)

Thanks!

I can try to look into the code in the coming days/weeks too as time allows.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.*

-- Thierry

thierryvolpiatto avatar Mar 26 '19 05:03 thierryvolpiatto

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

Great!!! :slightly_smiling_face:

The new variable works like a charm :slightly_smiling_face: 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!!! :slightly_smiling_face: All your work is much appreciated!!

I guess I will close this issue now.

prosoitos avatar Mar 28 '19 00:03 prosoitos

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

tmalsburg avatar Apr 01 '19 13:04 tmalsburg