GNU bug report logs - #32420
26.1.50; Ibuffer: Detect correctly the buffers running a process

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Sat, 11 Aug 2018 16:49:02 UTC

Severity: normal

Found in version 26.1.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32420 in the body.
You can then email your comments to 32420 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32420; Package emacs. (Sat, 11 Aug 2018 16:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 11 Aug 2018 16:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1.50; Ibuffer: Detect correctly the buffers running a process
Date: Sun, 12 Aug 2018 01:48:22 +0900
emacs -Q
M-x info RET
m Emacs RET
M-x ibuffer RET
;; Ibuffer wrongly reports *info* buffer as running a process.
--8<-----------------------------cut here---------------start------------->8---
commit db8f778c98bd6eb8db7b16239f6fddab012e5314
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date:   Sun Aug 12 01:38:03 2018 +0900

    Ibuffer: Detect correctly the buffers running a process
    
    * lisp/ibuffer.el (filename-and-process): Store the process buffer
    as a text property; check for such property to detect a buffer
    with a process (Bug#32420).

diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 0a7bfe00a9..03018d08a5 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1912,11 +1912,9 @@ filename-and-process
      (let ((procs 0)
 	   (files 0))
        (dolist (string strings)
-	 (if (string-match "\\(?:\\`([[:ascii:]]+)\\)" string)
-	     (progn (setq procs (1+ procs))
-		    (if (< (match-end 0) (length string))
-			(setq files (1+ files))))
-	   (setq files (1+ files))))
+         (when (get-text-property 1 'ibuffer-process string)
+           (setq procs (1+ procs)))
+	 (setq files (1+ files)))
        (concat (cond ((zerop files) "No files")
 		     ((= 1 files) "1 file")
 		     (t (format "%d files" files)))
@@ -1928,7 +1926,8 @@ filename-and-process
 	(filename (ibuffer-make-column-filename buffer mark)))
     (if proc
 	(concat (propertize (format "(%s %s)" proc (process-status proc))
-			    'font-lock-face 'italic)
+			    'font-lock-face 'italic
+                            'ibuffer-process proc)
 		(if (> (length filename) 0)
 		    (format " %s" filename)
 		  ""))
--8<-----------------------------cut here---------------end--------------->8---

In GNU Emacs 26.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2018-08-11
Repository revision: ec6f588940e51013435408a456c10d33ddf98fb2
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:	Debian GNU/Linux 9.5 (stretch)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32420; Package emacs. (Sat, 11 Aug 2018 16:58:02 GMT) Full text and rfc822 format available.

Message #8 received at 32420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 32420 <at> debbugs.gnu.org
Subject: Re: bug#32420: 26.1.50;
 Ibuffer: Detect correctly the buffers running a process
Date: Sat, 11 Aug 2018 19:57:19 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Sun, 12 Aug 2018 01:48:22 +0900
> 
> 
> emacs -Q
> M-x info RET
> m Emacs RET
> M-x ibuffer RET
> ;; Ibuffer wrongly reports *info* buffer as running a process.

How do you see it reporting a process?  What I see is that it reports
a pseudo-file for it.  Am I missing something?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32420; Package emacs. (Sat, 11 Aug 2018 17:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 32420 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32420 <at> debbugs.gnu.org
Subject: Re: bug#32420: 26.1.50; Ibuffer: Detect correctly the buffers running
 a process
Date: Sun, 12 Aug 2018 02:13:20 +0900 (JST)
[Message part 1 (text/plain, inline)]

On Sat, 11 Aug 2018, Eli Zaretskii wrote:

>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Sun, 12 Aug 2018 01:48:22 +0900
>>
>>
>> emacs -Q
>> M-x info RET
>> m Emacs RET
>> M-x ibuffer RET
>> ;; Ibuffer wrongly reports *info* buffer as running a process.
>
> How do you see it reporting a process?  What I see is that it reports
> a pseudo-file for it.  Am I missing something?
Attached 1 picture.
It shows at the bottom the line:
3 buffers            2515909                  1 file, 1 process

If you delete buffer *info*, then you see:
2 buffers                574                  No files, no processes
[screnshot_bug#32420.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32420; Package emacs. (Sat, 11 Aug 2018 17:38:01 GMT) Full text and rfc822 format available.

Message #14 received at 32420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 32420 <at> debbugs.gnu.org
Subject: Re: bug#32420: 26.1.50; Ibuffer: Detect correctly the buffers running
 a process
Date: Sat, 11 Aug 2018 20:37:12 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Sun, 12 Aug 2018 02:13:20 +0900 (JST)
> cc: 32420 <at> debbugs.gnu.org
> 
> >> emacs -Q
> >> M-x info RET
> >> m Emacs RET
> >> M-x ibuffer RET
> >> ;; Ibuffer wrongly reports *info* buffer as running a process.
> >
> > How do you see it reporting a process?  What I see is that it reports
> > a pseudo-file for it.  Am I missing something?
> Attached 1 picture.
> It shows at the bottom the line:
> 3 buffers            2515909                  1 file, 1 process

Ah, okay.  So, to fix this, isn't it better to see if the current
buffer is a process-buffer of some process in process-list?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32420; Package emacs. (Sun, 12 Aug 2018 08:22:01 GMT) Full text and rfc822 format available.

Message #17 received at 32420 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32420 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#32420: 26.1.50; Ibuffer: Detect correctly the buffers running
 a process
Date: Sun, 12 Aug 2018 17:21:36 +0900 (JST)

>>> How do you see it reporting a process?  What I see is that it reports
>>> a pseudo-file for it.  Am I missing something?
>> Attached 1 picture.
>> It shows at the bottom the line:
>> 3 buffers            2515909                  1 file, 1 process
>
> Ah, okay.  So, to fix this, isn't it better to see if the current
> buffer is a process-buffer of some process in process-list?
It's a bit tricky code.
When such thing run, the summarizer, I believe the current buffer
is *Ibuffer*; you receive 'strings': they are the rows in
column 'Filename/Process'.

There is no direct way to connect each string with its buffer.  The 
original code make the assumption that if 'string' matches something like
(foobar)
then it corresponds to a buffer running a process.
That assumption is wrong, for instance, in several info buffers.

Because you first create all columns, and the summarizer runs at the end,
I thought is simple to add the process as a text property for those
buffers having a process.  Then you don't need any assumption on 'string': 
you just check whether if 'string' has a property 'ibuffer-process' or 
not.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32420; Package emacs. (Sun, 12 Aug 2018 18:47:01 GMT) Full text and rfc822 format available.

Message #20 received at 32420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 32420 <at> debbugs.gnu.org
Subject: Re: bug#32420: 26.1.50; Ibuffer: Detect correctly the buffers running
 a process
Date: Sun, 12 Aug 2018 21:46:50 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Sun, 12 Aug 2018 17:21:36 +0900 (JST)
> cc: Tino Calancha <tino.calancha <at> gmail.com>, 32420 <at> debbugs.gnu.org
> 
> > Ah, okay.  So, to fix this, isn't it better to see if the current
> > buffer is a process-buffer of some process in process-list?
> It's a bit tricky code.

Then maybe it's high time to redesign it ;-)

But don't let that hold your fix.




Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Mon, 13 Aug 2018 10:31:01 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Mon, 13 Aug 2018 10:31:02 GMT) Full text and rfc822 format available.

Message #25 received at 32420-done <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 32420-done <at> debbugs.gnu.org
Subject: Re: bug#32420: 26.1.50;
 Ibuffer: Detect correctly the buffers running a process
Date: Mon, 13 Aug 2018 19:30:30 +0900
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Sun, 12 Aug 2018 17:21:36 +0900 (JST)
>> cc: Tino Calancha <tino.calancha <at> gmail.com>, 32420 <at> debbugs.gnu.org
>> 
>> > Ah, okay.  So, to fix this, isn't it better to see if the current
>> > buffer is a process-buffer of some process in process-list?
>> It's a bit tricky code.
>
> Then maybe it's high time to redesign it ;-)
I need to talk with my manager: she organize my agenda with that stuff.
> But don't let that hold your fix.
Fixed in emacs-26 branch as commit
'Ibuffer: Detect correctly the buffers running a process'
(12f7116714cf0cc3566ea2a5b1184c99cbfe7b90)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Sep 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 343 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.