From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: limit length of xref file header line Date: Fri, 24 May 2019 14:38:14 -0800 Message-ID: <86o93rv5pl.fsf@stephe-leake.org> References: <86sgtawcmk.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="177989"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 25 01:02:41 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 1hUJCy-000k9D-DF for ged-emacs-devel@m.gmane.org; Sat, 25 May 2019 01:02:40 +0200 Original-Received: from localhost ([127.0.0.1]:32918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUJCx-0004H9-Bv for ged-emacs-devel@m.gmane.org; Fri, 24 May 2019 19:02:39 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUJCm-0004Gs-Js for emacs-devel@gnu.org; Fri, 24 May 2019 19:02:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUJCl-0008VN-Ln for emacs-devel@gnu.org; Fri, 24 May 2019 19:02:28 -0400 Original-Received: from gproxy8-pub.mail.unifiedlayer.com ([67.222.33.93]:49296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hUJCk-0008UA-Kb for emacs-devel@gnu.org; Fri, 24 May 2019 19:02:27 -0400 Original-Received: from cmgw14.unifiedlayer.com (unknown [10.9.0.14]) by gproxy8.mail.unifiedlayer.com (Postfix) with ESMTP id 782B11AB7C2 for ; Fri, 24 May 2019 16:38:24 -0600 (MDT) Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmsmtp with ESMTP id UIpThZ1W6XFO5UIpTh63Mw; Fri, 24 May 2019 16:38:24 -0600 X-Authority-Reason: nr=8 Original-Received: from [76.77.182.20] (port=55600 helo=Takver4) by host114.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hUIpT-002dNI-EG for emacs-devel@gnu.org; Fri, 24 May 2019 16:38:23 -0600 In-Reply-To: (Dmitry Gutov's message of "Tue, 21 May 2019 04:16:20 +0300") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host114.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1hUIpT-002dNI-EG X-Source-Sender: (Takver4) [76.77.182.20]:55600 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 1 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDExNC5ob3N0bW9uc3Rlci5jb20= X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.33.93 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:236972 Archived-At: Dmitry Gutov writes: >> So I'd like to shorten the filename line (called the "group" in xref). > > This is not exactly right. The group attribute can contain the > filename, but it doesn't have to. Or else we'd have called in > differently. > > BTW, check out the three definitions of > > (cl-defmethod xref-location-group ... > > for the built-in classes. Right; I did not look hard enough. >> The patch below adds a new user option 'xref-display-filename' to >> control this. > > ... the appropriate place to change > the "display" would instead be in > > (cl-defmethod xref-location-group ((l xref-file-location)) > (oref l file)) So: (cl-defmethod xref-location-group ((l xref-file-location)) (cl-ecase xref-file-name-display (abs (oref l file)) (nondirectory (file-name-nondirectory (oref l file))))) -- -- Stephe