GNU bug report logs - #20112
24.4; (emacs-uptime): insert at point when called with prefix

Previous Next

Package: emacs;

Reported by: asjo <at> koldfront.dk (Adam Sjøgren)

Date: Sun, 15 Mar 2015 18:49:02 UTC

Severity: wishlist

Tags: patch

Merged with 40772

Found in versions 24.4, 26.1

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20112 in the body.
You can then email your comments to 20112 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20112; Package emacs. (Sun, 15 Mar 2015 18:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to asjo <at> koldfront.dk (Adam Sjøgren):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 15 Mar 2015 18:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: asjo <at> koldfront.dk (Adam Sjøgren)
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; (emacs-uptime): insert at point when called with prefix
Date: Sun, 15 Mar 2015 19:48:08 +0100
Here is a patch making emacs-uptime insert at point when called with
prefix, similar to what emacs-version does:

2015-02-10  Adam Sjøgren  <asjo <at> koldfront.dk>

	* time.el (emacs-uptime): insert at point when called with
        prefix.


--- time.el.orig	2015-02-10 15:42:48.472482974 +0100
+++ time.el	2015-02-10 15:45:27.743592919 +0100
@@ -571,18 +571,22 @@
             (cancel-timer elt)))))))
 
 ;;;###autoload
-(defun emacs-uptime (&optional format)
+(defun emacs-uptime (&optional format here)
   "Return a string giving the uptime of this instance of Emacs.
 FORMAT is a string to format the result, using `format-seconds'.
-For example, the Unix uptime command format is \"%D, %z%2h:%.2m\"."
-  (interactive)
+For example, the Unix uptime command format is \"%D, %z%2h:%.2m\".
+If the optional argument HERE is non-nil, insert string at
+point."
+  (interactive "i\nP")
   (let ((str
          (format-seconds (or format "%Y, %D, %H, %M, %z%S")
                          (float-time
                           (time-subtract (current-time) before-init-time)))))
-    (if (called-interactively-p 'interactive)
-        (message "%s" str)
-      str)))
+    (if here
+        (insert str)
+      (if (called-interactively-p 'interactive)
+          (message "%s" str)
+        str))))
 
 ;;;###autoload
 (defun emacs-init-time ()

In GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
 of 2015-03-07 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11604000
System Description:	Debian GNU/Linux 8.0 (jessie)

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-z,relro'

-- 
 "Och jag vet att allt är falskt och bedrageri                Adam Sjøgren
  Men det struntar jag i                                 asjo <at> koldfront.dk
  För vi dansar och du har så mjuka läppar"




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20112; Package emacs. (Sun, 15 Mar 2015 19:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 20112 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: asjo <at> koldfront.dk (Adam Sjøgren)
Cc: 20112 <at> debbugs.gnu.org
Subject: Re: bug#20112: 24.4;
 (emacs-uptime): insert at point when called with prefix
Date: Sun, 15 Mar 2015 15:12:53 -0400
Adam Sjøgren wrote:

> Here is a patch making emacs-uptime insert at point when called with
> prefix, similar to what emacs-version does:

Thanks. As I've said before, personally I do not see the point of either.
Should every function that returns a string provide the option to insert
it? If not, what's special about this one?

http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00932.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20112; Package emacs. (Sun, 15 Mar 2015 19:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 20112 <at> debbugs.gnu.org (full text, mbox):

From: asjo <at> koldfront.dk (Adam Sjøgren)
To: Glenn Morris <rgm <at> gnu.org>
Cc: 20112 <at> debbugs.gnu.org
Subject: Re: bug#20112: 24.4;
 (emacs-uptime): insert at point when called with prefix
Date: Sun, 15 Mar 2015 20:41:38 +0100
Glenn writes:

> Adam Sjøgren wrote:

>> Here is a patch making emacs-uptime insert at point when called with
>> prefix, similar to what emacs-version does:
>
> Thanks. As I've said before, personally I do not see the point of either.
> Should every function that returns a string provide the option to insert
> it? If not, what's special about this one?

emacs-version and gnus-version are strings you sometimes want to
communicate to people, via email or news article ("I'm using C-u M-x
emacs-version").

The first thing I tried when I learned that emacs-uptime existed was to
use it in the same way: "Hey, look at me, my Emacs has an uptime of C-u
M-x emacs-uptime!"

Every function that reports a string of information you sometimes want
to communicate, and does nothing but that, I don't see why it should not
support inserting the string. What is the point of not providing that
option?

If you have a good idea for a general solution that avoids these
functions having a HERE argument, I would be interested to hear it.




Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 21 Aug 2019 00:09:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20112; Package emacs. (Wed, 15 Jan 2020 05:29:01 GMT) Full text and rfc822 format available.

Message #16 received at 20112 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Adam Sjøgren <asjo <at> koldfront.dk>, 20112 <at> debbugs.gnu.org
Subject: Re: bug#20112: 24.4; (emacs-uptime): insert at point when called
 with prefix
Date: Wed, 15 Jan 2020 06:28:36 +0100
Glenn Morris <rgm <at> gnu.org> writes:

> Adam Sjøgren wrote:
>
>> Here is a patch making emacs-uptime insert at point when called with
>> prefix, similar to what emacs-version does:
>
> Thanks. As I've said before, personally I do not see the point of either.
> Should every function that returns a string provide the option to insert
> it? If not, what's special about this one?
>
> http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00932.html

I don't see that it would be very useful to have emacs-uptime insert
at point with a prefix argument.  Is there an actual use case for
it?

Otherwise, I would suggest to close this as wontfix.

Best regards,
Stefan Kangas




Added tag(s) wontfix. Request was from Adam Sjøgren <asjo <at> koldfront.dk> to control <at> debbugs.gnu.org. (Wed, 15 Jan 2020 06:38:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 20112 <at> debbugs.gnu.org and asjo <at> koldfront.dk (Adam Sjøgren) Request was from Adam Sjøgren <asjo <at> koldfront.dk> to control <at> debbugs.gnu.org. (Wed, 15 Jan 2020 06:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20112; Package emacs. (Wed, 15 Jan 2020 21:10:02 GMT) Full text and rfc822 format available.

Message #23 received at 20112 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Adam Sjøgren <asjo <at> koldfront.dk>
Cc: 20112 <at> debbugs.gnu.org
Subject: Re: bug#20112: 24.4; (emacs-uptime): insert at point when called
 with prefix
Date: Wed, 15 Jan 2020 22:09:35 +0100
Adam Sjøgren <asjo <at> koldfront.dk> writes:

> tag 20112 wontfix
> close 20112
> thanks
>
> Stefan writes:
>
>> Is there an actual use case for it?
>
> Beyond what I wrote in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20112#11 ?
>
> No, I don't think so.
>
> I assume nobody wants to remove the functionality from emacs-version, so
> I agree there is nothing to do here.

OK, thanks for clarifying.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Feb 2020 12:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 22 Apr 2020 16:07:01 GMT) Full text and rfc822 format available.

Forcibly Merged 20112 40772. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 22 Apr 2020 16:07:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 May 2020 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 18 Sep 2020 15:44:01 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 18 Sep 2020 15:44:02 GMT) Full text and rfc822 format available.

Removed tag(s) wontfix. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 18 Sep 2020 15:44:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 40772 <at> debbugs.gnu.org and Boruch Baum <boruch_baum <at> gmx.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 18 Sep 2020 15:44:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 Oct 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 181 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.