GNU bug report logs - #36979
Calendar: mention how to copy date

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 8 Aug 2019 20:32:02 UTC

Severity: wishlist

Tags: wontfix

Done: Glenn Morris <rgm <at> gnu.org>

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 36979 in the body.
You can then email your comments to 36979 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#36979; Package emacs. (Thu, 08 Aug 2019 20:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 08 Aug 2019 20:32:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Calendar: mention how to copy date
Date: Fri, 09 Aug 2019 02:56:53 +0800
(info "(emacs) To Other Calendar")'s
p C		calendar-chinese-print-date
p a		calendar-astro-print-day-number
p b		calendar-bahai-print-date
p c		calendar-iso-print-date...
are great, except you need to mention:

If you not only want to view the date in the minibuffer, but also want
to copy it, then also use (view-echo-area-messages). It is bound to C-h e...




Added tag(s) wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 08 Aug 2019 23:01:02 GMT) Full text and rfc822 format available.

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Thu, 08 Aug 2019 23:08:01 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Thu, 08 Aug 2019 23:08:01 GMT) Full text and rfc822 format available.

Message #12 received at 36979-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 36979-done <at> debbugs.gnu.org
Subject: Re: bug#36979: Calendar: mention how to copy date
Date: Thu, 08 Aug 2019 19:07:29 -0400
No. It is not appropriate to mention basic information like in reference
to specific commands.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Fri, 09 Aug 2019 01:33:01 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Fri, 09 Aug 2019 09:31:51 +0800
Well fine.
But do mention how to copy things like this rather than just view them.
I suppose the author of Calendar simply forgot to add a way to copy
them.
Just like if a browser offered link previews in the corner, but no way
to copy link URLs.
So it is an oversight. The only workaround it to dig it out with C-h e.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sat, 10 Aug 2019 02:31:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: 積丹尼 Dan Jacobson
 <jidanni <at> jidanni.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Fri, 09 Aug 2019 22:30:15 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > But do mention how to copy things like this rather than just view them.

How do they get displayed?  Surely there is a way to copy text from there.
If they are displayed in the echo area, can you find them in *Messages*?

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sat, 10 Aug 2019 18:26:01 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sun, 11 Aug 2019 02:25:07 +0800
>>>>> "RMS" == Richard Stallman <rms <at> gnu.org> writes:

>> But do mention how to copy things like this rather than just view them.

RMS> How do they get displayed?  Surely there is a way to copy text from there.
RMS> If they are displayed in the echo area, can you find them in *Messages*?

Yes, but is that the "proper" way to copy them?
One has to (know to) look in *Messages*, find the line one wants with
the cursor, and copy that line, no more, no less.

About 10 key strokes, careful positioning needed too.

Clearly "looking in the dumpster for the discarded document."

Thus we see the proper way to copy them has not been implemented yet.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sat, 10 Aug 2019 18:56:02 GMT) Full text and rfc822 format available.

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

From: Tomas Nordin <tomasn <at> posteo.net>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sat, 10 Aug 2019 20:55:43 +0200
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

>>>>>> "RMS" == Richard Stallman <rms <at> gnu.org> writes:
>
>>> But do mention how to copy things like this rather than just view them.
>
> RMS> How do they get displayed?  Surely there is a way to copy text from there.
> RMS> If they are displayed in the echo area, can you find them in *Messages*?
>
> Yes, but is that the "proper" way to copy them?
> One has to (know to) look in *Messages*, find the line one wants with
> the cursor, and copy that line, no more, no less.
>
> About 10 key strokes, careful positioning needed too.
>
> Clearly "looking in the dumpster for the discarded document."
>
> Thus we see the proper way to copy them has not been implemented yet.

I can add my sympathy for the desire of functionality to add date under
point to the kill ring. I was searching for such a feature at some point
(didn't find it) and wrote this function which I bound to RET in
calendar-mode-map:

(defun tn-calendar-kill-date (&optional arg)
  "Kill new a string based on point in calendar buffer in iso format

With no prefix ARG, kill the date as an iso date.
With one prefix arg ('C-u'), kill the date as an iso week.
with two prefix arg ('C-u C-u'), kill as both the iso week and date."
  (interactive "p")
  (let* ((date (calendar-cursor-to-date))
         (encoded-time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date)))
         (date-string (format-time-string "%Y-%m-%d" encoded-time))
         (iso-week-string (format-time-string "%gW%V" encoded-time))
         kill-string)

    (cond
     ((= arg 4)
      (setq kill-string iso-week-string))
     ((= arg 16)
      (setq kill-string (format "%s %s" iso-week-string date-string)))
     (t
      (setq kill-string date-string)))

    (kill-new kill-string)
    (message "Put %s to kill-ring" kill-string)))

Best regards
--
Tomas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sat, 10 Aug 2019 19:06:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Tomas Nordin <tomasn <at> posteo.net>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sun, 11 Aug 2019 03:05:05 +0800
Yeah, like e.g., shr-maybe-probe-and-copy-url: Copy the URL under point to the kill ring.
The user might not just want to see things, but copy them.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sun, 11 Aug 2019 02:40:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: 積丹尼 Dan Jacobson
 <jidanni <at> jidanni.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sat, 10 Aug 2019 22:39:19 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Yes, but is that the "proper" way to copy them?
  > One has to (know to) look in *Messages*, find the line one wants with
  > the cursor, and copy that line, no more, no less.

*Messages* is a general-purpose feature that lets you do all sorts of
things with echo area messages, including copy them.  Having
general-purpose features like this makes Emacs cleaner and simpler
than having many special-purpose features for doing various jobs of
this kind.

Instead of making and documenting some special-purpose features for
copying messages from calendar commands, we should document that you
can do it by going to the *Messages* buffer.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sun, 11 Aug 2019 02:51:01 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sun, 11 Aug 2019 10:50:41 +0800
Digging things out of *Messages* is hard unless one uses the mouse.
(And when one does, doing so actually alters *Messages* at the bottom,
with mark set messages.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sun, 11 Aug 2019 11:14:02 GMT) Full text and rfc822 format available.

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

From: Deus Max <deusmax <at> gmx.com>
To: Tomas Nordin <tomasn <at> posteo.net>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sun, 11 Aug 2019 14:13:25 +0300
On Sat, Aug 10 2019, Tomas Nordin wrote:

>
> I can add my sympathy for the desire of functionality to add date under
> point to the kill ring. I was searching for such a feature at some point
> (didn't find it) and wrote this function which I bound to RET in
> calendar-mode-map:
>
> (defun tn-calendar-kill-date (&optional arg)
>   "Kill new a string based on point in calendar buffer in iso format
>
> With no prefix ARG, kill the date as an iso date.
> With one prefix arg ('C-u'), kill the date as an iso week.
> with two prefix arg ('C-u C-u'), kill as both the iso week and date."
>   (interactive "p")
>   (let* ((date (calendar-cursor-to-date))
>          (encoded-time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date)))
>          (date-string (format-time-string "%Y-%m-%d" encoded-time))
>          (iso-week-string (format-time-string "%gW%V" encoded-time))
>          kill-string)
>
>     (cond
>      ((= arg 4)
>       (setq kill-string iso-week-string))
>      ((= arg 16)
>       (setq kill-string (format "%s %s" iso-week-string date-string)))
>      (t
>       (setq kill-string date-string)))
>
>     (kill-new kill-string)
>     (message "Put %s to kill-ring" kill-string)))
>
> Best regards
> --
> Tomas

Hi Tomas,

Great function for it can be very useful thank you.

I slightly modified it, so it doesn't blow up when the cursor is not on
a date and provides an informative message.

;; Copied from bug#36979 by Tomas Nordin, emacs-bugs maillist.
(defun tn-calendar-kill-date (&optional arg)
  "Kill new a string based on point in calendar buffer in iso format

With no prefix ARG, kill the date as an iso date.
With one prefix arg ('C-u'), kill the date as an iso week.
with two prefix arg ('C-u C-u'), kill as both the iso week and date."
  (interactive "p")
  (let ((date (calendar-cursor-to-date t)))
    (if date
        ;; date is valid
        (let* ((encoded-time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date)))
               (date-string (format-time-string "%Y-%m-%d" encoded-time))
               (iso-week-string (format-time-string "%gW%V" encoded-time))
               kill-string)
          (cond
           ((= arg 4)
            (setq kill-string iso-week-string))
           ((= arg 16)
            (setq kill-string (format "%s %s" iso-week-string date-string)))
           (t
            (setq kill-string date-string)))
          ;; add to kill ring
          (kill-new kill-string)
          (message "Put %s to kill-ring" kill-string))
      ;; date is not valid - cursor is not on a date.
      (message "Not on a date."))))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sun, 11 Aug 2019 12:38:01 GMT) Full text and rfc822 format available.

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

From: Deus Max <deusmax <at> gmx.com>
To: Tomas Nordin <tomasn <at> posteo.net>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sun, 11 Aug 2019 15:37:43 +0300
On Sun, Aug 11 2019, Deus Max wrote:

> On Sat, Aug 10 2019, Tomas Nordin wrote:
>
>>
>> I can add my sympathy for the desire of functionality to add date under
>> point to the kill ring. I was searching for such a feature at some point
>> (didn't find it) and wrote this function which I bound to RET in
>> calendar-mode-map:
>>

I believe it is probably more intuitive is to bind it to "k" instead of
RET.







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Mon, 12 Aug 2019 01:37:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: 積丹尼 Dan Jacobson
 <jidanni <at> jidanni.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sun, 11 Aug 2019 21:36:33 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Digging things out of *Messages* is hard unless one uses the mouse.

I use Emacs on a text terminal -- no mouse -- and I don't find that to be so.


-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Mon, 12 Aug 2019 21:57:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Tue, 13 Aug 2019 05:55:59 +0800
>> Digging things out of *Messages* is hard unless one uses the mouse.

RMS> I use Emacs on a text terminal -- no mouse -- and I don't find that to be so.

Post the (view-lossage) of what you use.
At least 10 keystroks when one would have been enough.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Tue, 13 Aug 2019 02:15:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: 積丹尼 Dan Jacobson
 <jidanni <at> jidanni.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Mon, 12 Aug 2019 22:14:42 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > At least 10 keystroks when one would have been enough.

It might be so, but how often does the average user do such a thing?
Once a week?

You can define a keyboard macro if you do it more often.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sat, 17 Aug 2019 01:17:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sat, 17 Aug 2019 09:15:48 +0800
Maybe there should be a generic
copy-previous-message - copies last message we saw in the minibuffer to the kill ring.
copy-next-message     - will copy the next message we will see in the minibuffer to the kill ring.

With argument copies the ARGth message.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36979; Package emacs. (Sat, 17 Aug 2019 22:21:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: 積丹尼 Dan Jacobson
 <jidanni <at> jidanni.org>
Cc: 36979 <at> debbugs.gnu.org
Subject: Re: bug#36979: closed (Re: bug#36979: Calendar: mention how to copy
 date)
Date: Sat, 17 Aug 2019 18:20:47 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Maybe there should be a generic
  > copy-previous-message - copies last message we saw in the _echo area_ to the kill ring.
  > copy-next-message     - will copy the next message we will see in the _echo area_ to the kill ring.

I think the first one could be useful.  Repeating the command could
get you successively earlier messages, each replacing the one you got
before.

It could display the message again in the echo area as well as putting
it in the kill ring, adding the string "Copied: " to show that the
message was not emitted just now.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 15 Sep 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 281 days ago.

Previous Next


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