GNU bug report logs - #39555
[PATCH] Allow tempo-define-template to reassign tags to new templates

Previous Next

Package: emacs;

Reported by: Federico Tedin <federicotedin <at> gmail.com>

Date: Mon, 10 Feb 2020 22:35:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <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 39555 in the body.
You can then email your comments to 39555 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#39555; Package emacs. (Mon, 10 Feb 2020 22:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Federico Tedin <federicotedin <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 10 Feb 2020 22:35:01 GMT) Full text and rfc822 format available.

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

From: Federico Tedin <federicotedin <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Allow tempo-define-template to reassign tags to new templates
Date: Mon, 10 Feb 2020 23:34:04 +0100
[Message part 1 (text/plain, inline)]
(This may apply as a bug and as a wishlist item at the same time - not sure)

Two problems I've found using tempo.el are:

1) If I'm using templates + tags (with `tempo-complete-tag') in a buffer, and I
define new templates + tags from another buffer, I can't immediately use
them in the original buffer (I have to do M-: (setq
tempo-dirty-collection t) ).

2) If I want to assign a different template to an already existing tag,
I have to remove the tag manually from the tags collection.

These two problems can become a bit annoying specially when
writing/trying out new templates with tags. For someone learning about
tempo.el for the first time, I can imagine they could be a problem as
well. To fix these, I'm attaching a patch with some changes.

In `tempo-invalidate-collection', I decided to loop over every buffer to
check if `tempo-dirty-collection' has a local value, and only set it to
t if it does. I am not sure if this is the ideal way of setting a
buffer-local variable to a certain value for all buffers that have bound
a local value to it. Feedback is welcome.

- Fede

[tempo.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39555; Package emacs. (Fri, 14 Feb 2020 10:13:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: 39555 <at> debbugs.gnu.org
Subject: Re: bug#39555: [PATCH] Allow tempo-define-template to reassign tags to
 new templates
Date: Fri, 14 Feb 2020 12:12:03 +0200
> From: Federico Tedin <federicotedin <at> gmail.com>
> Date: Mon, 10 Feb 2020 23:34:04 +0100
> 
> (This may apply as a bug and as a wishlist item at the same time - not sure)

I think this should go to master in any case.

Given that tempo.el is not actively maintained lately, I think you can
install your changes, after taking care of the minor issues below.

> -(defun tempo-invalidate-collection ()
> +(defun tempo-invalidate-collection (&optional global)
>    "Marks the tag collection as obsolete.
> -Whenever it is needed again it will be rebuilt."
> -  (setq tempo-dirty-collection t))
> +Whenever it is needed again it will be rebuilt.  When GLOBAL is
                                                    ^^^^
Please use "if", not "when".  That's our usual style of describing
optional arguments.

I think the API changes should be in NEWS.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39555; Package emacs. (Mon, 17 Feb 2020 21:29:02 GMT) Full text and rfc822 format available.

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

From: Federico Tedin <federicotedin <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39555 <at> debbugs.gnu.org
Subject: Re: bug#39555: [PATCH] Allow tempo-define-template to reassign tags
 to new templates
Date: Mon, 17 Feb 2020 22:27:51 +0100
[Message part 1 (text/plain, inline)]
> I think this should go to master in any case.
>
> Given that tempo.el is not actively maintained lately, I think you can
> install your changes, after taking care of the minor issues below.
>
>> -(defun tempo-invalidate-collection ()
>> +(defun tempo-invalidate-collection (&optional global)
>>    "Marks the tag collection as obsolete.
>> -Whenever it is needed again it will be rebuilt."
>> -  (setq tempo-dirty-collection t))
>> +Whenever it is needed again it will be rebuilt.  When GLOBAL is
>                                                     ^^^^
> Please use "if", not "when".  That's our usual style of describing
> optional arguments.
>
> I think the API changes should be in NEWS.
>
> Thanks.

No problem, I'm attaching a new patch with those corrections applied.

- Fede

[0001-Allow-tempo-define-template-to-reassign-tags-to-new-.patch (text/x-patch, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 21 Feb 2020 09:21:02 GMT) Full text and rfc822 format available.

Notification sent to Federico Tedin <federicotedin <at> gmail.com>:
bug acknowledged by developer. (Fri, 21 Feb 2020 09:21:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: 39555-done <at> debbugs.gnu.org
Subject: Re: bug#39555: [PATCH] Allow tempo-define-template to reassign tags
 to new templates
Date: Fri, 21 Feb 2020 11:20:40 +0200
> From: Federico Tedin <federicotedin <at> gmail.com>
> Cc: 39555 <at> debbugs.gnu.org
> Date: Mon, 17 Feb 2020 22:27:51 +0100
> 
> No problem, I'm attaching a new patch with those corrections applied.

Thanks, pushed to the master branch.

Please see my follow-up commit with minor punctuation fixes.  Also,
please try to always mention in the log message the bug number when
it's known (this is impossible if your original message that opens a
bug report already includes the patch, but it _is_ possible when you
post additional versions to the same bug report).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39555; Package emacs. (Fri, 21 Feb 2020 19:48:02 GMT) Full text and rfc822 format available.

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

From: Federico Tedin <federicotedin <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39555-done <at> debbugs.gnu.org, Federico Tedin <federicotedin <at> gmail.com>
Subject: Re: bug#39555: [PATCH] Allow tempo-define-template to reassign tags
 to new templates
Date: Fri, 21 Feb 2020 20:47:01 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Federico Tedin <federicotedin <at> gmail.com>
>> Cc: 39555 <at> debbugs.gnu.org
>> Date: Mon, 17 Feb 2020 22:27:51 +0100
>> 
>> No problem, I'm attaching a new patch with those corrections applied.
>
> Thanks, pushed to the master branch.
>
> Please see my follow-up commit with minor punctuation fixes.  Also,
> please try to always mention in the log message the bug number when
> it's known (this is impossible if your original message that opens a
> bug report already includes the patch, but it _is_ possible when you
> post additional versions to the same bug report).

Noted! Thanks.




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

This bug report was last modified 4 years and 29 days ago.

Previous Next


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