From unknown Thu Aug 21 22:56:36 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#1432 <1432@debbugs.gnu.org> To: bug#1432 <1432@debbugs.gnu.org> Subject: Status: Sorting buffers with ibuffer Reply-To: bug#1432 <1432@debbugs.gnu.org> Date: Fri, 22 Aug 2025 05:56:36 +0000 retitle 1432 Sorting buffers with ibuffer reassign 1432 emacs submitter 1432 "Juanma Barranquero" severity 1432 minor thanks From lekktu@gmail.com Wed Nov 26 02:28:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.4 required=4.0 tests=AWL,BAYES_00,GMAIL, HAS_PACKAGE,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at quiet) by emacsbugs.donarmstrong.com; 26 Nov 2008 10:28:43 +0000 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAQASeTN017137 for ; Wed, 26 Nov 2008 02:28:41 -0800 Received: by yx-out-2324.google.com with SMTP id 8so196251yxg.31 for ; Wed, 26 Nov 2008 02:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=wojRoekgpgq6PX7x43C0Is9Piyj9Viu3reGEWFMlOWo=; b=UzADARILz8LN2c+JB5RHAT4NZuH9x5mrJCWRp9rIqnuKiKVG8ixQrOQ+rV1asQKIUH 4i6ck5MTDm1zxostxTQbQdxAF6sGV3RnTEf4JEBVfyfVtq+neNcVw3FOOgrh5qllixmJ 9i+6Mj8oG3AG5fGiD0hgzbw+ZfZH53zciZmT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=tWOjE7hSzZhBYmKBot/dk6cqMkTYh9v0meESNZqFUj30Xh9xeGa2S99rsFJd5dJemE hwrjYdzRYS2m+6CEScj5ejDPvYjmGMBcmR1JDprBYrlX8E5RPpKGGE/tDgeGq74zSaJB 2irA+HtdBd78z8pCrWTBw+OORAdzMOpxUgr8c= Received: by 10.100.216.12 with SMTP id o12mr2926483ang.92.1227695319614; Wed, 26 Nov 2008 02:28:39 -0800 (PST) Received: by 10.100.13.13 with HTTP; Wed, 26 Nov 2008 02:28:39 -0800 (PST) Message-ID: Date: Wed, 26 Nov 2008 11:28:39 +0100 From: "Juanma Barranquero" To: z0d Subject: Re: Sorting buffers with ibuffer Cc: help-gnu-emacs@gnu.org, quiet@debbugs.gnu.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <868f7753-ea47-4f70-9152-ae1a4ee62a6a@r40g2000yqj.googlegroups.com> <80823b7e-19ca-4522-a20a-de9db9cbc3c8@j38g2000yqa.googlegroups.com> Package: emacs Severity: minor X-Debbugs-CC: jpw@gnu.org On Wed, Nov 26, 2008 at 04:29, z0d wrote: > shell: emacs -q .emacs .ssh/config .Emacs-lisp/init-lisp.el > > M-: (setq-default ibuffer-default-sorting-mode 'major-mode) > M-x ibuffer > > produces: > > MR Name Size Mode Filename/Process > -- ---- ---- ---- ---------------- > [ Default ] > asdf-skeleton.el 1052 Emacs-Lisp ~/.Emacs-Lisp/asdf- > skeleton.el > config 488 Conf[Space] ~/.ssh/config > .emacs 13170 Emacs-Lisp ~/.emacs > *scratch* 191 Lisp Interaction > * *Messages* 142 Fundamental > % *GNU Emacs* 744 Fundamental > > 6 buffers 15787 3 files, no > processes You're right. What's happening is that, in fact, ibuffer is not sorting at all, because there's a variable ibuffer-sorting-functions-alist that is null at that point. That variable is initialized by code in ibuf-ext.el; defaulting to 'recency works because that sorting order is special-cased in ibuffer.el. You can workaround the issue by making sure ibuf-ext is loaded, for example: emacs -q -l ibuf-ext .emacs .ssh/config .Emacs-lisp/init-lisp.el but I think ibuffer should take care that the sorting functions' alist is properly stuffed. John, I've considered the attached patch, which checks in ibuffer-sort-bufferlist. The alternative I see is to require 'ibuf-ext in `ibuffer-mode' if the user modified `ibuffer-default-sorting-mode', like (set (make-local-variable 'ibuffer-sorting-mode) ibuffer-default-sorting-mode) (unless (eq ibuffer-sorting-mode 'recency) (require 'ibuf-ext)) Are you OK with one of these changes? Juanma Index: lisp/ibuffer.el =================================================================== RCS file: /sources/emacs/emacs/lisp/ibuffer.el,v retrieving revision 1.110 diff -u -2 -r1.110 ibuffer.el --- lisp/ibuffer.el 8 Oct 2008 05:02:09 -0000 1.110 +++ lisp/ibuffer.el 26 Nov 2008 09:56:30 -0000 @@ -2192,4 +2192,6 @@ (defun ibuffer-sort-bufferlist (bmarklist) + (unless ibuffer-sorting-functions-alist + (require 'ibuf-ext)) (let* ((sortdat (assq ibuffer-sorting-mode ibuffer-sorting-functions-alist)) From lekktu@gmail.com Thu Dec 4 16:03:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,BAYES_00,MISSING_SUBJECT, NOSUBJECT,TVD_SPACE_RATIO autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1432-done) by emacsbugs.donarmstrong.com; 5 Dec 2008 00:03:11 +0000 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB5037Gx011188 for <1432-done@emacsbugs.donarmstrong.com>; Thu, 4 Dec 2008 16:03:09 -0800 Received: by yx-out-2324.google.com with SMTP id 8so1903159yxg.31 for <1432-done@emacsbugs.donarmstrong.com>; Thu, 04 Dec 2008 16:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=0w3gKgfqKPi8QafkKGICBhGvdmhTwVrH+J4gviJaM58=; b=M1YK/AxzUi9GUepNRaSoBboEOeOWdjamth0Q6qU+c2fChoHFhQlMQ0IFp8nOU6d0lx cBhzm2Ntc/+P9bcSrRsy5wQSBSXkpilGGDlr84QJW3qxfYIfkjc3u5oh3p7hYwfo0WH2 8YQF17ZMnj5Hs56tU852Ha3T2O/mL7wcJz68U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=wUrIJtsj2kyO1pQ4M+MttoT/yu45VgfQUI1o+ddp5dD1GvGo+YMYXpgBmtoZT1re7E iDV+tLIXv7LSDvD/szt+540RcFk4lRiHIz+vet4nSL34ADPuXK0D3SyrxH8rm9GYg2eK P3PuWvgBncMm+JUtaEQbv4ZIzs/BwQPAkCX6M= Received: by 10.90.94.3 with SMTP id r3mr8365399agb.54.1228435387316; Thu, 04 Dec 2008 16:03:07 -0800 (PST) Received: by 10.100.13.13 with HTTP; Thu, 4 Dec 2008 16:03:07 -0800 (PST) Message-ID: Date: Fri, 5 Dec 2008 01:03:07 +0100 From: "Juanma Barranquero" To: 1432-done@debbugs.gnu.org Subject: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Fixed. http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ibuffer.el?cvsroot=emacs&r1=1.110&r2=1.111 From unknown Thu Aug 21 22:56:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Fri, 02 Jan 2009 15:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator