From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: bug#51852: Gnus: Add User-Defined Spec example Date: Mon, 15 Nov 2021 01:21:14 +0800 Message-ID: <87zgq6k60l.5.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1404"; mail-complaints-to="usenet@ciao.gmane.io" To: 51852@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 14 19:22:16 2021 Return-path: Envelope-to: geb-bug-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 1mmK8t-0000DQ-4A for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 19:22:15 +0100 Original-Received: from localhost ([::1]:40048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmK8s-0002sm-5N for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 13:22:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmK8h-0002rI-OY for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 13:22:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmK8g-0007R2-Es for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 13:22:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmK8g-0001U4-Bh for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 13:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Nov 2021 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51852 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16369140645624 (code B ref -1); Sun, 14 Nov 2021 18:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Nov 2021 18:21:04 +0000 Original-Received: from localhost ([127.0.0.1]:51632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmK7k-0001Se-BB for submit@debbugs.gnu.org; Sun, 14 Nov 2021 13:21:04 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmK7j-0001SM-1O for submit@debbugs.gnu.org; Sun, 14 Nov 2021 13:21:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmK7i-0002Ff-Sh for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 13:21:02 -0500 Original-Received: from beige.elm.relay.mailchannels.net ([23.83.212.16]:32981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmK7g-0007Mm-Qh for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 13:21:02 -0500 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 47E3B541930 for ; Sun, 14 Nov 2021 18:20:59 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a227.dreamhost.com (100-96-39-10.trex.outbound.svc.cluster.local [100.96.39.10]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id D782B541BCB for ; Sun, 14 Nov 2021 18:20:58 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Original-Received: from pdx1-sub0-mail-a227.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.39.10 (trex/6.4.3); Sun, 14 Nov 2021 18:20:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Unite-Madly: 0cdda08f1ab10310_1636914059093_400674981 X-MC-Loop-Signature: 1636914059093:3932268861 X-MC-Ingress-Time: 1636914059093 Original-Received: from jidanni.org (114-41-21-103.dynamic-ip.hinet.net [114.41.21.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a227.dreamhost.com (Postfix) with ESMTPSA id 4HsgcV1RYGz1h for ; Sun, 14 Nov 2021 10:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=jidanni.org; s=jidanni.org; t=1636914058; bh=NkJ0kP4w5Q4NUqKfPWlD47+u+Ps=; h=From:To:Subject:Date:Content-Type:Content-Transfer-Encoding; b=aWoLcJ2U2H2DZrrzN68uDuabLbDzf4m1IOhnE+ah1Hyxu6LxBq63rh820s0FB5eSg OtoAFMY7vm8JXOLQcaYffTq38NXMRiivZD3PpVbtiNgkFbf51hpasmuRsfLX3LZ64M 5S5PfV//S3jO/FXYQZ2fncXODRDH5OLUsm4ivOOo= Received-SPF: pass client-ip=23.83.212.16; envelope-from=jidanni@jidanni.org; helo=beige.elm.relay.mailchannels.net X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_BL_SPAMCOP_NET=1.347, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219996 Archived-At: (info "(gnus) Formatting Basics") says Also Gnus supports some extended format specifications, such as ‘%&user-date;’. OK, please say what user-date is, and list the rest. Wait, on (info "(gnus) User-Defined Specs") we see it is something we create ourselves. So on (info "(gnus) Formatting Basics") the "foo" example should be used, and not "user-date". And mainly, on (info "(gnus) User-Defined Specs") there is no example of how to make a User-Defined Spec. E.g., how to continue the example on (info "(gnus) Advanced Formatting") to finally get 96/08/09 . By the way, that (info "(gnus) Advanced Formatting") example, Let’s take an example. The ‘%o’ spec in the summary mode lines will return a date in compact ISO8601 format—‘19960809T230410’. This is quite a mouthful, so we want to shave off the century number and the time, leaving us with a six-character date. That would be ‘%~(cut-left 2)~(max-right 6)~(pad 6)o’. (Cutting is done before maxing, and we need the padding to ensure that the date is never less than 6 characters to make it look nice in columns.) is bad programming: not Y10K proof.