all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Minor modes and file names
@ 2021-01-28 15:57 steve-humphreys
  2021-01-28 16:15 ` Robert Pluim
  0 siblings, 1 reply; 4+ messages in thread
From: steve-humphreys @ 2021-01-28 15:57 UTC (permalink / raw)
  To: Help Gnu Emacs

I have made a minor made for texinfo and noticed that the minor mode
does not take effect unless tho file name matches the minor mode name.

For instance, changing the name of the file to "crucible-mode-2021-01-28.el"
the minor mode fails to load.

----- crucible-mode.el -----
(define-minor-mode crucible-mode ...)
(provide 'crucible-mode)

----- gtexinfo.el -----
(add-to-list
   'load-path "~/Genadm/build/gungadin-1.0/elisp/crucible")
(require 'crucible-mode)
(add-hook 'texinfo-mode-hook 'crucible-mode)






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

* Re: Minor modes and file names
  2021-01-28 15:57 Minor modes and file names steve-humphreys
@ 2021-01-28 16:15 ` Robert Pluim
  2021-01-28 16:51   ` steve-humphreys
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2021-01-28 16:15 UTC (permalink / raw)
  To: steve-humphreys; +Cc: Help Gnu Emacs

>>>>> On Thu, 28 Jan 2021 16:57:11 +0100, steve-humphreys@gmx.com said:

    steve-humphreys> I have made a minor made for texinfo and noticed that the minor mode
    steve-humphreys> does not take effect unless tho file name matches the minor mode name.

    steve-humphreys> For instance, changing the name of the file to "crucible-mode-2021-01-28.el"
    steve-humphreys> the minor mode fails to load.

    steve-humphreys> ----- crucible-mode.el -----
    steve-humphreys> (define-minor-mode crucible-mode ...)
    steve-humphreys> (provide 'crucible-mode)

    steve-humphreys> ----- gtexinfo.el -----
    steve-humphreys> (add-to-list
    steve-humphreys>    'load-path "~/Genadm/build/gungadin-1.0/elisp/crucible")
    steve-humphreys> (require 'crucible-mode)
    steve-humphreys> (add-hook 'texinfo-mode-hook 'crucible-mode)

This is expected and documented:

    (require FEATURE &optional FILENAME NOERROR)

      Probably introduced at or before Emacs version 15.

    If feature FEATURE is not loaded, load it from FILENAME.
    If FEATURE is not a member of the list `features', then the feature is
    not loaded; so load the file FILENAME.

    If FILENAME is omitted, the printname of FEATURE is used as the file
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    name, and `load' will try to load this name appended with the suffix
    `.elc', `.el'



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

* Re: Minor modes and file names
  2021-01-28 16:15 ` Robert Pluim
@ 2021-01-28 16:51   ` steve-humphreys
  2021-01-28 20:29     ` Tassilo Horn
  0 siblings, 1 reply; 4+ messages in thread
From: steve-humphreys @ 2021-01-28 16:51 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Help Gnu Emacs

Have tried to use it, but have encountered difficulties

(add-to-list
   'load-path "~/Genadm/build/gungadin-1.0/elisp/crucible")
(require 'crucible-mode crucible-mode-prot-2021-01-28-utc0656)
(add-hook 'texinfo-mode-hook 'crucible-mode)

> Sent: Friday, January 29, 2021 at 4:15 AM
> From: "Robert Pluim" <rpluim@gmail.com>
> To: steve-humphreys@gmx.com
> Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: Minor modes and file names
>
> >>>>> On Thu, 28 Jan 2021 16:57:11 +0100, steve-humphreys@gmx.com said:
>
>     steve-humphreys> I have made a minor made for texinfo and noticed that the minor mode
>     steve-humphreys> does not take effect unless tho file name matches the minor mode name.
>
>     steve-humphreys> For instance, changing the name of the file to "crucible-mode-2021-01-28.el"
>     steve-humphreys> the minor mode fails to load.
>
>     steve-humphreys> ----- crucible-mode.el -----
>     steve-humphreys> (define-minor-mode crucible-mode ...)
>     steve-humphreys> (provide 'crucible-mode)
>
>     steve-humphreys> ----- gtexinfo.el -----
>     steve-humphreys> (add-to-list
>     steve-humphreys>    'load-path "~/Genadm/build/gungadin-1.0/elisp/crucible")
>     steve-humphreys> (require 'crucible-mode)
>     steve-humphreys> (add-hook 'texinfo-mode-hook 'crucible-mode)
>
> This is expected and documented:
>
>     (require FEATURE &optional FILENAME NOERROR)
>
>       Probably introduced at or before Emacs version 15.
>
>     If feature FEATURE is not loaded, load it from FILENAME.
>     If FEATURE is not a member of the list `features', then the feature is
>     not loaded; so load the file FILENAME.
>
>     If FILENAME is omitted, the printname of FEATURE is used as the file
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     name, and `load' will try to load this name appended with the suffix
>     `.elc', `.el'
>
>



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

* Re: Minor modes and file names
  2021-01-28 16:51   ` steve-humphreys
@ 2021-01-28 20:29     ` Tassilo Horn
  0 siblings, 0 replies; 4+ messages in thread
From: Tassilo Horn @ 2021-01-28 20:29 UTC (permalink / raw)
  To: help-gnu-emacs

steve-humphreys@gmx.com writes:

> Have tried to use it, but have encountered difficulties
>
> (add-to-list
>    'load-path "~/Genadm/build/gungadin-1.0/elisp/crucible")
> (require 'crucible-mode crucible-mode-prot-2021-01-28-utc0656)

The second arg has to be a string, i.e,

  (require 'crucible-mode "crucible-mode-prot-2021-01-28-utc0656")

Bye,
Tassilo



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

end of thread, other threads:[~2021-01-28 20:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-28 15:57 Minor modes and file names steve-humphreys
2021-01-28 16:15 ` Robert Pluim
2021-01-28 16:51   ` steve-humphreys
2021-01-28 20:29     ` Tassilo Horn

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.