GNU bug report logs - #24985
Add missing provide statements

Previous Next

Package: emacs;

Reported by: Philippe Vaucher <philippe.vaucher <at> gmail.com>

Date: Tue, 22 Nov 2016 10:43:02 UTC

Severity: minor

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 24985 in the body.
You can then email your comments to 24985 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#24985; Package emacs. (Tue, 22 Nov 2016 10:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philippe Vaucher <philippe.vaucher <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 22 Nov 2016 10:43:02 GMT) Full text and rfc822 format available.

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

From: Philippe Vaucher <philippe.vaucher <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Add missing provide statements
Date: Tue, 22 Nov 2016 11:42:18 +0100
[Message part 1 (text/plain, inline)]
Hello,

While correcting misuse of `eval-after-load' in some libraries, we
discovered that `text-mode' does not `provide' itself as a feature.

That forces people to use `eval-after-load' with a string (filename),
instead of a symbol (feature), which is the better form. It is the better
form because with a string, any file named the same way triggers the
eval-after-load which is problematic for custom configurations named after
packages.

Original thread at https://github.com/magnars/expand-region.el/pull/212

I used the following command to figure out which other files might need
additional `provide' statements:

grep -rL '(provide' ~/work/emacs/lisp | xargs egrep 'define-[^ ]+-mode' |
grep -v ChangeLog

Thanks,
Philippe
[Message part 2 (text/html, inline)]
[0001-Add-missing-provide-statements.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Tue, 22 Nov 2016 12:16:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Philippe Vaucher <philippe.vaucher <at> gmail.com>
Cc: 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Tue, 22 Nov 2016 13:15:40 +0100
Philippe Vaucher <philippe.vaucher <at> gmail.com> writes:

> Hello,

Hi Philippe,

> diff --git a/lisp/composite.el b/lisp/composite.el
> index 94b14df..262f121 100644
> --- a/lisp/composite.el
> +++ b/lisp/composite.el
> @@ -843,6 +843,8 @@ For more information on Auto Composition mode, see
>  
>  (defalias 'toggle-auto-composition 'auto-composition-mode)
>  
> +(provide 'auto-composition-mode)

Why that? I would expect (provide 'composite) here.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Tue, 22 Nov 2016 13:59:01 GMT) Full text and rfc822 format available.

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

From: Philippe Vaucher <philippe.vaucher <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Tue, 22 Nov 2016 14:58:19 +0100
[Message part 1 (text/plain, inline)]
>
> >  (defalias 'toggle-auto-composition 'auto-composition-mode)
> >
> > +(provide 'auto-composition-mode)
>
> Why that? I would expect (provide 'composite) here.
>

I thought that the most interesting thing in composite was
auto-composition-mode... same reasoning for replace.el which provided
'occur in my first patch.

Anyway, you're right, it's not very consistent. Here attached is a new
patch that simply follows the file name.

In the future, I think we should consider renaming/splitting these files so
each mode provide its feature (e.g occur provides 'occur, etc).

Best regards,
Philippe
[Message part 2 (text/html, inline)]
[0001-Add-missing-provide-statements.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Tue, 22 Nov 2016 15:15:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Philippe Vaucher <philippe.vaucher <at> gmail.com>
Cc: 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Tue, 22 Nov 2016 16:13:54 +0100
Philippe Vaucher <philippe.vaucher <at> gmail.com> writes:

> I thought that the most interesting thing in composite was
> auto-composition-mode... same reasoning for replace.el which provided
> 'occur in my first patch.

See the docstring of `require':

If feature FEATURE is not loaded, load it from FILENAME ... If FILENAME
is omitted, the printname of FEATURE is used as the file name.

Therefore, it is always a good practice to provide a feature with the
same name as the file.

> Best regards,
> Philippe

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Wed, 23 Nov 2016 09:28:02 GMT) Full text and rfc822 format available.

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

From: Philippe Vaucher <philippe.vaucher <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Wed, 23 Nov 2016 10:26:41 +0100
[Message part 1 (text/plain, inline)]
>
> Therefore, it is always a good practice to provide a feature with the
> same name as the file.
>

Yes, hence my second patch.

Okay, is there anything else to discuss? Is the patch ok?

Best regards,
Philippe
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Wed, 23 Nov 2016 09:47:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Philippe Vaucher <philippe.vaucher <at> gmail.com>
Cc: 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Wed, 23 Nov 2016 10:46:31 +0100
Philippe Vaucher <philippe.vaucher <at> gmail.com> writes:

> Okay, is there anything else to discuss? Is the patch ok?

Nothing else from my pov.

> Best regards,
> Philippe

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Fri, 25 Nov 2016 10:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philippe Vaucher <philippe.vaucher <at> gmail.com>
Cc: michael.albinus <at> gmx.de, 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Fri, 25 Nov 2016 12:27:26 +0200
> From: Philippe Vaucher <philippe.vaucher <at> gmail.com>
> Date: Tue, 22 Nov 2016 14:58:19 +0100
> Cc: 24985 <at> debbugs.gnu.org
> 
>  > (defalias 'toggle-auto-composition 'auto-composition-mode)
>  >
>  > +(provide 'auto-composition-mode)
> 
>  Why that? I would expect (provide 'composite) here.
> 
> I thought that the most interesting thing in composite was auto-composition-mode... same reasoning for
> replace.el which provided 'occur in my first patch.
> 
> Anyway, you're right, it's not very consistent. Here attached is a new patch that simply follows the file name.

Thanks, pushed to master.

In the future, please start each sentence in the log entry with a
capital letter, and end it with a period.  Here's how I reformatted
your log message:

* lisp/composite.el:
* lisp/replace.el:
* lisp/textmodes/text-mode.el: Add provide statement.




bug closed, send any further explanations to 24985 <at> debbugs.gnu.org and Philippe Vaucher <philippe.vaucher <at> gmail.com> Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 25 Nov 2016 10:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Fri, 25 Nov 2016 11:53:02 GMT) Full text and rfc822 format available.

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

From: Philippe Vaucher <philippe.vaucher <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Fri, 25 Nov 2016 12:51:43 +0100
[Message part 1 (text/plain, inline)]
>
> In the future, please start each sentence in the log entry with a
> capital letter, and end it with a period.  Here's how I reformatted
> your log message:
>
> * lisp/composite.el:
> * lisp/replace.el:
> * lisp/textmodes/text-mode.el: Add provide statement.
>

Alright. Thanks!

Philippe
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Sat, 26 Nov 2016 01:08:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Philippe Vaucher <philippe.vaucher <at> gmail.com>
Cc: eliz <at> gnu.org, michael.albinus <at> gmx.de, 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Fri, 25 Nov 2016 20:07:34 -0500
[[[ 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. ]]]

  > > * lisp/composite.el:
  > > * lisp/replace.el:
  > > * lisp/textmodes/text-mode.el: Add provide statement.

Why do these files need a provide?
They are always loaded.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Sat, 26 Nov 2016 07:18:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: rms <at> gnu.org
Cc: philippe.vaucher <at> gmail.com, michael.albinus <at> gmx.de, 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Sat, 26 Nov 2016 09:17:15 +0200
> From: Richard Stallman <rms <at> gnu.org>
> CC: eliz <at> gnu.org, michael.albinus <at> gmx.de, 24985 <at> debbugs.gnu.org
> Date: Fri, 25 Nov 2016 20:07:34 -0500
> 
>   > > * lisp/composite.el:
>   > > * lisp/replace.el:
>   > > * lisp/textmodes/text-mode.el: Add provide statement.
> 
> Why do these files need a provide?
> They are always loaded.

Yes, they are always loaded.  But having a provide in them doesn't
hurt anything, AFAICT.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Sat, 26 Nov 2016 09:18:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: philippe.vaucher <at> gmail.com, rms <at> gnu.org, 24985 <at> debbugs.gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Sat, 26 Nov 2016 10:17:48 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>>   > > * lisp/composite.el:
>>   > > * lisp/replace.el:
>>   > > * lisp/textmodes/text-mode.el: Add provide statement.
>> 
>> Why do these files need a provide?
>> They are always loaded.
>
> Yes, they are always loaded.  But having a provide in them doesn't
> hurt anything, AFAICT.

And in case they are required somewhere else, they would be reloaded,
w/o a provide.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24985; Package emacs. (Sat, 26 Nov 2016 10:08:01 GMT) Full text and rfc822 format available.

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

From: Philippe Vaucher <philippe.vaucher <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24985 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#24985: Add missing provide statements
Date: Sat, 26 Nov 2016 11:07:45 +0100
[Message part 1 (text/plain, inline)]
> And in case they are required somewhere else, they would be reloaded,
> w/o a provide.

Also like I said in my original bug report, it forced people using
"eval-after-load" to use the string parameter, which leads to
problems/inconsistency in custom config or tests.

Now maybe using eval-after-load for these modes is a mistake but again it
is not very consistent.

Philippe
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 24 Dec 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 235 days ago.

Previous Next


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