unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24985: Add missing provide statements
@ 2016-11-22 10:42 Philippe Vaucher
  2016-11-22 12:15 ` Michael Albinus
  0 siblings, 1 reply; 12+ messages in thread
From: Philippe Vaucher @ 2016-11-22 10:42 UTC (permalink / raw)
  To: 24985


[-- Attachment #1.1: Type: text/plain, Size: 732 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1036 bytes --]

[-- Attachment #2: 0001-Add-missing-provide-statements.patch --]
[-- Type: text/x-patch, Size: 1600 bytes --]

From b0b8720c4eecf44ab63ec85bcb6b92958ced48cb Mon Sep 17 00:00:00 2001
From: Philippe Vaucher <philippe.vaucher@stvs.com>
Date: Tue, 22 Nov 2016 09:35:22 +0100
Subject: [PATCH] Add missing provide statements

* lisp/composite.el: add provide statement
* lisp/replace.el: add provide statement
* lisp/textmodes/text-mode.el: add provide statement
---
 lisp/composite.el           | 2 ++
 lisp/replace.el             | 2 ++
 lisp/textmodes/text-mode.el | 2 ++
 3 files changed, 6 insertions(+)

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)
+
 \f
 
 ;;; composite.el ends here
diff --git a/lisp/replace.el b/lisp/replace.el
index eb5e0cf..ef15f61 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1823,6 +1823,8 @@ See also `multi-occur'."
      ;; And the second element is the list of context after-lines.
      (if (> nlines 0) after-lines))))
 
+(provide 'occur)
+
 \f
 ;; It would be nice to use \\[...], but there is no reasonable way
 ;; to make that display both SPC and Y.
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 731c2d2..51a7bbe 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -232,4 +232,6 @@ The argument NLINES says how many lines to center."
 	   (setq nlines (1+ nlines))
 	   (forward-line -1)))))
 
+(provide 'text-mode)
+
 ;;; text-mode.el ends here
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-11-26 10:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22 10:42 bug#24985: Add missing provide statements Philippe Vaucher
2016-11-22 12:15 ` Michael Albinus
2016-11-22 13:58   ` Philippe Vaucher
2016-11-22 15:13     ` Michael Albinus
2016-11-23  9:26       ` Philippe Vaucher
2016-11-23  9:46         ` Michael Albinus
2016-11-25 10:27     ` Eli Zaretskii
2016-11-25 11:51       ` Philippe Vaucher
2016-11-26  1:07         ` Richard Stallman
2016-11-26  7:17           ` Eli Zaretskii
2016-11-26  9:17             ` Michael Albinus
2016-11-26 10:07               ` Philippe Vaucher

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).