From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: tabulated-list sort icon is reversed Date: Tue, 12 Feb 2019 14:13:59 -0500 Message-ID: References: <83a7qbtc6l.fsf@gnu.org> <83bmaqq735.fsf@gnu.org> <87d0v1lsns.fsf@fastmail.fm> <532F6D74-E21C-45A2-B85B-01133DE1E8A1@scratch.space> <6e662c5b-3d04-2157-6712-aadcb6077f2b@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="93714"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 Cc: Emacs developers To: Philippe Vaucher Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 12 20:18:27 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtdZa-000ODu-9O for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2019 20:18:26 +0100 Original-Received: from localhost ([127.0.0.1]:44689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtdZZ-0002PA-3B for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2019 14:18:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtdZH-0002Kl-VU for emacs-devel@gnu.org; Tue, 12 Feb 2019 14:18:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtdVN-0002wO-LB for emacs-devel@gnu.org; Tue, 12 Feb 2019 14:14:06 -0500 Original-Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:35105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtdVL-0002tk-Qb for emacs-devel@gnu.org; Tue, 12 Feb 2019 14:14:05 -0500 Original-Received: by mail-qt1-x835.google.com with SMTP id p48so4333271qtk.2 for ; Tue, 12 Feb 2019 11:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XW2epvW19O+TdA4i1NY/jQT1NQClP1sUQi8ksoxgQKQ=; b=a6kc1k8nzMOwFdnCDr7OhwmtnjwJn2A7/CuN/r6llSOgqtNDGxnq9PIv8DJinvZuO3 QmM/rnB+r8rEhiuaE85PZHW57Hnf1cz+cTOylqyEigE5bOP3ktdcOe/vpmZyO8BcUpeF Po/0/8049zVjK80ZHEENPpqOnJzRHzGlu8v2/BwPgSjvALJcZWHSZ1p6/Ed7miHKjJzM FER2h9kUnbYVBsuT6jlxtbO+1hfmLDxZ6Y2lw/91QKgwRwk8ZUYeooGB+ljWXl5Vjrzs tga0641csQ9wQX44kDXjgRPvi78xZVeKsLkiWnFc5AsuXDNSDsdA3i1IKco2IUDBCbL+ sZ/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XW2epvW19O+TdA4i1NY/jQT1NQClP1sUQi8ksoxgQKQ=; b=RQrzZ9UB4W3higC5J8m243zSV//0J3tKnDJeTAabvKCT816cJtn0DdhnD1CBv/wDsk 7RxmJlaXTuM4kvvyZwjf3l4RHBktUPi1PyHHeML/QtHIJaiK3Z9/5QEai2M4cTAPyyJb /AT5z7GO9lPg4h9n46ZBdlgLJrxYbY2zYXHAIIOotmen/XcRjddSWnvnJYGblWnu127B YQqxg0VtWqHTounPPcj8ZJcYo8OdXPPTjTsioy/yF1gpJB8+L0Ba52+aEIewdWlSCFO6 lyI8+f89JGLuQIvy4JS0jLvA83DmDRXwQiakD7t2/adtWRIum+fGMA3Tc5szdTZdqYwR 86Uw== X-Gm-Message-State: AHQUAuaiNarV+FqZb9LsytS3DL/kBvug15vkQpV8Z2SinNPRM4pGFk/T K6va0Rx7Nx8P5cWsKDEYT2hHpLrv X-Google-Smtp-Source: AHgI3IZ3zyJnrQdhdn17E8PGFNcY5m69ubi0BDDgrMXvIixAqS80CyOER7xZjPKM0QfLQlFbB5yRgg== X-Received: by 2002:a0c:9a4c:: with SMTP id q12mr3938610qvd.58.1549998842113; Tue, 12 Feb 2019 11:14:02 -0800 (PST) Original-Received: from [128.30.10.190] (30-10-190.wireless.csail.mit.edu. [128.30.10.190]) by smtp.googlemail.com with ESMTPSA id d14sm3143830qkb.88.2019.02.12.11.14.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 11:14:00 -0800 (PST) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::835 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233260 Archived-At: On 10/08/2018 10.11, Philippe Vaucher wrote:> I think that won't work — one of the key parts of that proposal was separating individual lines. > I think we need an image, not a character. > > > Fair enough. To be honest I'm losing a bit of steam here, I now > suspect this patch will never land because the ACSII part is > unsolvable, and because I guess that using an image requires quite a > lot of refactoring (displaying an inline image instead of a character > is likely to be complicated). Displaying inline images instead of characters us rather straightforward, actually; here's what a patch might look like (with your defcustom patch, it would be even simpler: only the defcustom would change). diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 6fdca2c..7249351 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -199,6 +199,19 @@ tabulated-list-line-number-width (line-number-display-width 'columns)) 4)))) +(defvar tabulated-list-sort-asc-icon ; " ▼" + (propertize " " 'display (create-image " + + + +" 'svg t))) +(defvar tabulated-list-sort-desc-icon ; " ▲" + (propertize " " 'display (create-image " + + + +" 'svg t))) + (defun tabulated-list-init-header () "Set up header line for the Tabulated List buffer." ;; FIXME: Should share code with tabulated-list-print-col! @@ -229,8 +242,8 @@ tabulated-list-init-header (concat label (cond ((> (+ 2 (length label)) width) "") - ((cdr tabulated-list-sort-key) " ▲") - (t " ▼"))) + ((cdr tabulated-list-sort-key) tabulated-list-sort-desc-icon) + (t tabulated-list-sort-asc-icon))) 'face 'bold 'tabulated-list-column-name label button-props)) -- 2.7.4 On the other hand, it might be tricky to resize this image properly, especially given bug #34024. Clément.