From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.help Subject: Re: Formatting labels used for URL buttons in Gnus articles Date: Thu, 30 Apr 2020 07:38:21 +0200 Message-ID: <871ro5354i.fsf@gnus.org> References: <87eesk2zpq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="13162"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs To: Narendra Joshi Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 30 07:47:57 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jU23A-0003K8-SH for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 07:47:56 +0200 Original-Received: from localhost ([::1]:40300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU239-00062f-VH for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 01:47:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53888) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU1u1-0002dK-2l for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 01:38:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU1tz-000697-EA for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 01:38:28 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:39576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jU1tz-00068r-28 for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 01:38:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Sy/AymH6vD/lcDM9Unt1b0fdDw0YY82PyBMS2c5EGrU=; b=SIUg6DINnjcGZC0+YcngCh4+L6 rmCtSYCYshjbymNkLAHDNdpf53Yc0vKxOnmH4U/sItt8l4wWJShkXBlUNkwcxpFMYwyOIE1j30AzZ 93uSsrfClUgzvhXiIAjsUHmjxtS0LPJabkaxtvRIo3m21QaARcA2RoNPbUY5pBsGX4Wk=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jU1tu-0005p0-HE; Thu, 30 Apr 2020 07:38:25 +0200 In-Reply-To: (Narendra Joshi's message of "Sun, 19 Apr 2020 00:31:13 +0200") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a01:4f9:2b:f0f::2 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122982 Archived-At: Narendra Joshi writes: > A lot of email that I get has very long URLs in the text version. I > use `gnus-treat-buttonize' to convert those to clickable buttons. The > labels are usually very long and I would like to use something like > `gnus-shorten-url' to have a smaller string displayed as the label of > the button. Any pointers to how I can achieve this would be great. There doesn't seem to be any pre-defined functionality for this in Gnus -- gnus-button-alist just specifies regexps to react to and what functions to call when you hit them, and not any way to specify a transform of the text. If you want to do something about that, then gnus-article-add-buttons in gnus-art.el is the function to look at. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no