-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Change: (helm-buffer--details) Handle non-modified, non-file buffers #1917
Change: (helm-buffer--details) Handle non-modified, non-file buffers #1917
Conversation
Modified, non-file buffers are now shown as modified. This is useful for, e.g. chat clients, whose room buffers are not file-backed, but it's useful to know when they're modified (i.e. have new messages).
0d058d5
to
994f0f3
Compare
Thanks merged. |
However, note that |
Hi Thierry, Thanks for merging.
Are you sure? I've been using Thanks. |
Yes is you use |
In our Matrix client: https://github.com/jgkamat/matrix-client-legacy-el
Hmm, yeah, that's not good. That's disappointing, because having these chat room buffers show up as modified is very helpful. The first thing I tried was setting I feel stumped at the moment. Do you have any general ideas for how this might be fixable? I think other packages could benefit from this, like all the IRC packages. @jgkamat What do you think? Thanks. |
Ok, I think I figured it out: we bind Thanks, Thierry. Sorry for wasting your time with this and having to revert it. |
Well, there is still one small issue: now Helm shows them as file-backed buffers all the time. This trade-off is probably worth it, as it's much more useful to see them highlighted when they contain new messages than it is to see them as non-file-backed buffers the rest of the time. But if there is some way to have both, it would be nice. Ideas appreciated. :) |
What you can do is instead of using diff --git a/helm-buffers.el b/helm-buffers.el
index 180194ff..59ee70a6 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -154,6 +154,9 @@ this source is accessible and properly loaded."
"Face used for non-file buffers in `helm-buffers-list'."
:group 'helm-buffers-faces)
+(defvar helm-buffers-tick-counter nil)
+(make-variable-buffer-local 'helm-buffers-tick-counter)
+
;;; Buffers keymap
;;
@@ -375,6 +378,13 @@ See `ido-make-buffer-list' for more infos."
(helm-buffer--show-details
name name-prefix file-name size mode dir
'helm-buffer-file 'helm-buffer-process nil details 'filebuf))
+ ;; A non-file, modified buffer
+ ((with-current-buffer name
+ (and helm-buffers-tick-counter
+ (/= helm-buffers-tick-counter (buffer-modified-tick))))
+ (helm-buffer--show-details
+ name (and proc name-prefix) dir size mode dir
+ 'helm-buffer-modified 'helm-buffer-process proc details 'nofile-mod))
;; Any non--file buffer.=>italic
(t
(helm-buffer--show-details |
Thanks, that seems to work very well, and it's easy to gate on our end with |
alphapapa <notifications@github.com> writes:
Thanks, that seems to work very well, and it's easy to gate on our end
with (when (featurep 'helm).... Should I send a PR with that patch?
Oh yes, would be great, like that I have just to apply your PR :)
Thanks.
…--
Thierry
|
* helm-buffers.el (helm-buffers-tick-counter): New. (helm-buffer--details): Use it.
Thierry Volpiatto <thievol05@zoho.eu> writes:
alphapapa ***@***.***> writes:
> Thanks, that seems to work very well, and it's easy to gate on our end
> with (when (featurep 'helm).... Should I send a PR with that patch?
Oh yes, would be great, like that I have just to apply your PR :)
I finally made it, I will not have much time later.
Thanks.
…--
Thierry
|
Thanks, Thierry. |
Modified, non-file buffers are now shown as modified. This is useful for, e.g. chat clients, whose room buffers are not file-backed, but it's useful to know when they're modified (i.e. have new messages).
Thanks for your work on Helm!