From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel Newsgroups: gmane.emacs.bugs Subject: bug#47306: 28.0.50; [PATCH] Add optional FORMAT argument to 'emacs-init-time' Date: Sun, 21 Mar 2021 21:46:33 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25288"; mail-complaints-to="usenet@ciao.gmane.io" To: 47306@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 22 01:47:28 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 1lO8j9-0006RK-Pb for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 01:47:27 +0100 Original-Received: from localhost ([::1]:42140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lO8j8-0006tK-PA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Mar 2021 20:47:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lO8il-0006t7-VI for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 20:47:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lO8ij-0007aV-U2 for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 20:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lO8ij-00074E-Rn for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 20:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Mar 2021 00:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47306 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161637400827144 (code B ref -1); Mon, 22 Mar 2021 00:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Mar 2021 00:46:48 +0000 Original-Received: from localhost ([127.0.0.1]:55728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO8iW-00073j-DH for submit@debbugs.gnu.org; Sun, 21 Mar 2021 20:46:48 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO8iQ-00073V-KX for submit@debbugs.gnu.org; Sun, 21 Mar 2021 20:46:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lO8iQ-0006s0-2s for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 20:46:42 -0400 Original-Received: from mail-dm6nam11olkn2097.outbound.protection.outlook.com ([40.92.19.97]:27833 helo=NAM11-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lO8iO-0007YB-10 for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 20:46:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTpwdEpcKgVM7rmW3Lq+jGM8vN1H80tgG+OSvktZyCJN94EPUNOo6JnipLp3bNH6UNVUDC3gZ8hnFS1MNZTGqqC1df/K18N17S1o9I7DzMXZ64xb+7dJm0jlAUOJ9TaVUMtECKWfHfgSLcRO+zoaSaoK0r72GHg4GO4HvLlPFgjoOCYmMFdes3fuLLjr6J68KASJYiatxJO+fzbj/o0lc39RYADgIibNpeo0HFiN1ATkWICPhsl4XoRVr3AyFeJii7hOX674hXjgvtC7NV/iAkziYynNCycedL+Aw1HCmrToVLsZcYsmgD5Cf6GgSrAiK4fiZKbdpLsuePLp8zel8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A4+uT4G71zZc0WfZ2SakmZeiucLOAV9OtdGppLB89g8=; b=IQKuTzbPtxnSV/GDmhvm5SYqSwwkHqMP1sh7f4kz5MUKPtZ/KGTGvWxLydV5RSjItSfKdOUvgXJjno1Bu2P3bw3CL10fYW6UZTvh6QXCzG3UHDp32d7/RQzdvhVUvpZTd0jM8dHYaezxc+alyUm00uUSX5hvC4XualIumm6K1RSnuPAHq2G1qpIUL0Nu9Lm7G0osG+WvaIPXrv08BlSGGKz8/JeNNI/QGuTrnODFY7UycKyegPLuH6POIhIx8iUhoVnO4iPurgD3N0waooGQ27weV63e+C1gNR1j6xq1q9QAggEAX2G4uCeQWmwyD5XSaLheZIKnnpo/rqx3/JnXFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A4+uT4G71zZc0WfZ2SakmZeiucLOAV9OtdGppLB89g8=; b=nd8mn5GjWZGefuHUVzyqvTIU9g7S9P5pdcCHVGdOvVGQ9VdUsYrn0gBUpvGdpQ6dn1A1SOvz/fgTKpaFCbIvHdeSBDEHceBmapnrDMk+CmNn1GCB0+p0PsK8tJ7badGVjzk/UrRO6Wyi9eh2GfnZC8H7kTJrlH0wU6Jyz1PVHuGyLmKwCQnQ9IcbQo2Oh2ss8w8fE4KABL0ADP4p/4KCmVcnXm1iD+o7122vUMcwYh4xANVrTJ9/pDBpJbHnFYVdzUWtkfDkoc0lExh1QBToRzCYMiAul6jbvdzv27sbCF064S/QXBDiU14jNDoVlY3AniwJN6ArB8bsTO2RdRA3kQ== Original-Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::52) by DM6NAM11HT105.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Mon, 22 Mar 2021 00:46:38 +0000 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:fc4d::4e) by DM6NAM11FT053.mail.protection.outlook.com (2a01:111:e400:fc4d::330) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Mon, 22 Mar 2021 00:46:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:878F38C3E7FACE97CDEB3D810BEBD4378EB50FCFBEDC076B6245E1F39300C957; UpperCasedChecksum:BD00DABA57D73D6BD0DA7B69681F8615FC71428B8030481CFBA97E647AC962A9; SizeAsReceived:7259; Count:42 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::592f:9a58:d8cd:d9c9]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::592f:9a58:d8cd:d9c9%7]) with mapi id 15.20.3955.025; Mon, 22 Mar 2021 00:46:38 +0000 X-TMN: [4DXF0hcx8isvqYEDSweCbi7j/sdq1BTy9YEj7CzHqnDyPAjRm3lzOrb5Al1hTRjr] X-ClientProxiedBy: CP2PR80CA0234.lamprd80.prod.outlook.com (2603:10d6:102:17::28) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <87y2egrp5i.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from precision5540 (2804:431:c7f3:ee67:60a0:ed63:b5e6:b5cb) by CP2PR80CA0234.lamprd80.prod.outlook.com (2603:10d6:102:17::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Mon, 22 Mar 2021 00:46:37 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 42 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: bc14adbf-6a69-4d36-faee-08d8eccbf331 X-MS-TrafficTypeDiagnostic: DM6NAM11HT105: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mZeTD3RsDfQ5o2llR/BPLq9Hda9Bqhje8zYpD3Olz5LhihaqzXcc8o24JTKMID4BdzON4vdd3wBcMBG7iGPc67jgoIewOd4m9zR6UKfeLk48aPruAdcoGJWjSZ+THAq9sjvVvgDPflxD9Ig1YueIQYqjw7TldtG1OqdmiFKMGyf3wQBRRh+anc+G7XoACF3OigRa6kuiLhF3PQmxgXka7S0P9VtL2vC1ehciznV7PEnNAmQXrfcWi1ryhC/p7drSU9blXx/PzFKpNsSzFL0NdY5eQxD3lgWIWzCzIHo50Xh+ljb3wqzUejkzt67kRlIbE96obXBnR0X7rKFQDR6KCD7bnsmicwdVUhe0POiNq6tfb7cFy4X15hQOkf9UCorC4myFP8npS0brb2kj590vIg== X-MS-Exchange-AntiSpam-MessageData: eSXvyXrbt4CS+cmzuk4picbKrerzoqQ/CHqYqfLFqvWZA3TZF24UyhT2vBT8RdZQLjW9e07bjOy8FvYdPd/MEEb1dPrQZaySDaPprWCWXG3o8S4eZ7gRQ9ITU1O3VZhBkLnST3GTDcFbX8feJlSXi95CHiiXcFTESOaOmnL2VewdHS0bpRwaqySewybSxy31q2DsTQVYgxjFUMB22LjtDw== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc14adbf-6a69-4d36-faee-08d8eccbf331 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2021 00:46:38.1207 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT105 Received-SPF: pass client-ip=40.92.19.97; envelope-from=gabriel376@hotmail.com; helo=NAM11-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:202816 Archived-At: --=-=-= Content-Type: text/plain This patch adds an optional argument FORMAT to 'emacs-init-time', similar to 'emacs-uptime'. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-optional-FORMAT-argument-to-emacs-init-time.patch >From 6dbeded25f78279e43e0a56333e9b2c829241a31 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Sun, 21 Mar 2021 21:39:26 -0300 Subject: [PATCH] Add optional FORMAT argument to 'emacs-init-time' * lisp/time.el (emacs-init-time): Add optional FORMAT argument. --- lisp/time.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/time.el b/lisp/time.el index 1403c4ac00..7e1d9180f6 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -614,13 +614,14 @@ emacs-uptime str)))) ;;;###autoload -(defun emacs-init-time () - "Return a string giving the duration of the Emacs initialization." +(defun emacs-init-time (&optional format) + "Return a string giving the duration of the Emacs initialization. +FORMAT is a string to format the result, using `format'. If nil, +the default format \"%f seconds\" is used." (interactive) - (let ((str - (format "%s seconds" - (float-time - (time-subtract after-init-time before-init-time))))) + (let ((str (format (or format "%f seconds") + (float-time (time-subtract after-init-time + before-init-time))))) (if (called-interactively-p 'interactive) (message "%s" str) str))) -- 2.27.0 --=-=-=--