unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* File for minor mode not found
@ 2022-01-09  5:14 fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-09  6:47 ` tomas
       [not found] ` <SJ0PR10MB5488E2D49393EC94EC06A41CF34F9@SJ0PR10MB5488.namprd10.prod.outlook.com>
  0 siblings, 2 replies; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-09  5:14 UTC (permalink / raw)
  To: Help Gnu Emacs


Have made a minor mode called daph stored in file path

~/Admir/typ/zig/daph-ideograms"

This is the call for daph-minor-mode

(define-minor-mode daph-minor-mode

At the end or the file I use (provide 'daph)

In another file I call the minor mode

(defun fad-daph-ideograms ()
   "Tex command highlighting."

   (add-to-list
      'load-path "~/Admir/typ/zig/daph-ideograms")

   (require 'daph)
   (daph-ideograms-launch)
   (add-hook 'texinfo-mode-hook #'daph-minor-mode))

But when I launch emacs I get

File is missing: Cannot open load file, No such file or directory, daph

What is happening, and how can I fix this?








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

* Re: File for minor mode not found
  2022-01-09  5:14 File for minor mode not found fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-09  6:47 ` tomas
  2022-01-09  7:06   ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-01-09 14:43   ` fatiparty--- via Users list for the GNU Emacs text editor
       [not found] ` <SJ0PR10MB5488E2D49393EC94EC06A41CF34F9@SJ0PR10MB5488.namprd10.prod.outlook.com>
  1 sibling, 2 replies; 24+ messages in thread
From: tomas @ 2022-01-09  6:47 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 856 bytes --]

On Sun, Jan 09, 2022 at 06:14:33AM +0100, fatiparty--- via Users list for the GNU Emacs text editor wrote:
> 
> Have made a minor mode called daph stored in file path
> 
> ~/Admir/typ/zig/daph-ideograms"

Under which name is it stored there?

> This is the call for daph-minor-mode
> 
> (define-minor-mode daph-minor-mode
> 
> At the end or the file I use (provide 'daph)
> 
> In another file I call the minor mode
> 
> (defun fad-daph-ideograms ()
>    "Tex command highlighting."
> 
>    (add-to-list
>       'load-path "~/Admir/typ/zig/daph-ideograms")
> 
>    (require 'daph)

This is looking for a file "daph.el" (after looking for a "daph.elc")
somewhere in `load-path'. Does that exist?

Sorry for asking something which might be obvious, but your question
doesn't make it completely clear.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: File for minor mode not found
  2022-01-09  6:47 ` tomas
@ 2022-01-09  7:06   ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-01-09 10:04     ` tomas
  2022-01-09 14:43   ` fatiparty--- via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 24+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-01-09  7:06 UTC (permalink / raw)
  To: help-gnu-emacs

tomas wrote:

> Sorry for asking something which might be obvious, but your
> question doesn't make it completely clear.

But when it only might be obvious, doesn't that mean it isn't?

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: File for minor mode not found
  2022-01-09  7:06   ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2022-01-09 10:04     ` tomas
  2022-01-09 15:01       ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 24+ messages in thread
From: tomas @ 2022-01-09 10:04 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On Sun, Jan 09, 2022 at 08:06:59AM +0100, Emanuel Berg via Users list for the GNU Emacs text editor wrote:
> tomas wrote:
> 
> > Sorry for asking something which might be obvious, but your
> > question doesn't make it completely clear.
> 
> But when it only might be obvious, doesn't that mean it isn't?

It just means that I don't know whether it's obvious to other people.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* File for minor mode not found
  2022-01-09  6:47 ` tomas
  2022-01-09  7:06   ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2022-01-09 14:43   ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-09 15:12     ` Stephen Berman
                       ` (2 more replies)
  1 sibling, 3 replies; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-09 14:43 UTC (permalink / raw)
  To: Tomas; +Cc: Help Gnu Emacs


Jan 9, 2022, 06:47 by tomas@tuxteam.de:

> On Sun, Jan 09, 2022 at 06:14:33AM +0100, fatiparty--- via Users list for the GNU Emacs text editor wrote:
>
>>
>> Have made a minor mode called daph stored in file path
>>
>> ~/Admir/typ/zig/daph-ideograms"
>>
>
> Under which name is it stored there?
>
>> This is the call for daph-minor-mode
>>
>> (define-minor-mode daph-minor-mode
>>
>> At the end or the file I use (provide 'daph)
>>
>> In another file I call the minor mode
>>
>> (defun fad-daph-ideograms ()
>>    "Tex command highlighting."
>>
>>    (add-to-list
>>       'load-path "~/Admir/typ/zig/daph-ideograms")
>>
>>    (require 'daph)
>>
>
> This is looking for a file "daph.el" (after looking for a "daph.elc")
> somewhere in `load-path'. Does that exist?
>
> Sorry for asking something which might be obvious, but your question
> doesn't make it completely clear.
>

It does not exist.  The file is named daph-ideograms.el but I am using 
(provide 'daph) at the end of the file.  And using (require 'daph) after 
setting the load-path in another file.


> Cheers
> -- 
> t
>



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

* Re: File for minor mode not found
  2022-01-09 10:04     ` tomas
@ 2022-01-09 15:01       ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 24+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-01-09 15:01 UTC (permalink / raw)
  To: help-gnu-emacs

tomas wrote:

>>> Sorry for asking something which might be obvious, but
>>> your question doesn't make it completely clear.
>> 
>> But when it only might be obvious, doesn't that mean
>> it isn't?
>
> It just means that I don't know whether it's obvious to
> other people.

Well, obviously.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: File for minor mode not found
  2022-01-09 14:43   ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-09 15:12     ` Stephen Berman
  2022-01-09 15:57       ` Tomas
       [not found]     ` <878rvpeyek.fsf@gmx.net-MszOZsb----2>
  2022-01-09 15:56     ` Tomas
  2 siblings, 1 reply; 24+ messages in thread
From: Stephen Berman @ 2022-01-09 15:12 UTC (permalink / raw)
  To: fatiparty--- via Users list for the GNU Emacs text editor; +Cc: fatiparty

On Sun, 9 Jan 2022 15:43:42 +0100 (CET) fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> Jan 9, 2022, 06:47 by tomas@tuxteam.de:
>
>> On Sun, Jan 09, 2022 at 06:14:33AM +0100, fatiparty--- via Users list for
>> the GNU Emacs text editor wrote:
>>
>>>
>>> Have made a minor mode called daph stored in file path
>>>
>>> ~/Admir/typ/zig/daph-ideograms"
>>>
>>
>> Under which name is it stored there?
>>
>>> This is the call for daph-minor-mode
>>>
>>> (define-minor-mode daph-minor-mode
>>>
>>> At the end or the file I use (provide 'daph)
>>>
>>> In another file I call the minor mode
>>>
>>> (defun fad-daph-ideograms ()
>>>    "Tex command highlighting."
>>>
>>>    (add-to-list
>>>       'load-path "~/Admir/typ/zig/daph-ideograms")
>>>
>>>    (require 'daph)
>>>
>>
>> This is looking for a file "daph.el" (after looking for a "daph.elc")
>> somewhere in `load-path'. Does that exist?
>>
>> Sorry for asking something which might be obvious, but your question
>> doesn't make it completely clear.
>>
>
> It does not exist.  The file is named daph-ideograms.el but I am using 
> (provide 'daph) at the end of the file.  And using (require 'daph) after 
> setting the load-path in another file.

That should be (require 'daph "daph-ideograms"), see `C-h f require':.

   require is a built-in function in ‘C source code’.
   
   (require FEATURE &optional FILENAME NOERROR)
   
   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’, or the system-dependent suffix for dynamic module
   files, in that order.

Steve Berman



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

* File for minor mode not found
       [not found]     ` <878rvpeyek.fsf@gmx.net-MszOZsb----2>
@ 2022-01-09 15:46       ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-09 16:01         ` Stephen Berman
       [not found]         ` <874k6cgap3.fsf@gmx.net-MszaWDg----2>
  0 siblings, 2 replies; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-09 15:46 UTC (permalink / raw)
  To: Stephen Berman; +Cc: fatiparty--- via Users list for the GNU Emacs text editor


Jan 9, 2022, 15:12 by stephen.berman@gmx.net:

> On Sun, 9 Jan 2022 15:43:42 +0100 (CET) fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
>> Jan 9, 2022, 06:47 by tomas@tuxteam.de:
>>
>>> On Sun, Jan 09, 2022 at 06:14:33AM +0100, fatiparty--- via Users list for
>>> the GNU Emacs text editor wrote:
>>>
>>>>
>>>> Have made a minor mode called daph stored in file path
>>>>
>>>> ~/Admir/typ/zig/daph-ideograms"
>>>>
>>>
>>> Under which name is it stored there?
>>>
>>>> This is the call for daph-minor-mode
>>>>
>>>> (define-minor-mode daph-minor-mode
>>>>
>>>> At the end or the file I use (provide 'daph)
>>>>
>>>> In another file I call the minor mode
>>>>
>>>> (defun fad-daph-ideograms ()
>>>>    "Tex command highlighting."
>>>>
>>>>    (add-to-list
>>>>       'load-path "~/Admir/typ/zig/daph-ideograms")
>>>>
>>>>    (require 'daph)
>>>>
>>>
>>> This is looking for a file "daph.el" (after looking for a "daph.elc")
>>> somewhere in `load-path'. Does that exist?
>>>
>>> Sorry for asking something which might be obvious, but your question
>>> doesn't make it completely clear.
>>>
>>
>> It does not exist.  The file is named daph-ideograms.el but I am using 
>> (provide 'daph) at the end of the file.  And using (require 'daph) after 
>> setting the load-path in another file.
>>
>
> That should be (require 'daph "daph-ideograms"), see `C-h f require':.
>
>  require is a built-in function in ‘C source code’.
>  
>  (require FEATURE &optional FILENAME NOERROR)
>  
>  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’, or the system-dependent suffix for dynamic module
>  files, in that order.
>
> Steve Berman
>

Thanks Steve.  One thing that has been difficult to see, is the relationship between
(provide 'daph) and (require 'daph).  Following your suggestion, I need to have
(require 'daph "daph-ideograms").  Are there any implications for the (provide 'daph) part?



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

* Re: File for minor mode not found
  2022-01-09 14:43   ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-09 15:12     ` Stephen Berman
       [not found]     ` <878rvpeyek.fsf@gmx.net-MszOZsb----2>
@ 2022-01-09 15:56     ` Tomas
  2 siblings, 0 replies; 24+ messages in thread
From: Tomas @ 2022-01-09 15:56 UTC (permalink / raw)
  To: fatiparty; +Cc: Help Gnu Emacs

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

On Sun, Jan 09, 2022 at 03:43:42PM +0100, fatiparty@tutanota.com wrote:

[...]

> > This is looking for a file "daph.el" (after looking for a "daph.elc")
> > somewhere in `load-path'. Does that exist?
> >
> > Sorry for asking something which might be obvious, but your question
> > doesn't make it completely clear.
> >
> 
> It does not exist.  The file is named daph-ideograms.el but I am using 
> (provide 'daph) at the end of the file.  And using (require 'daph) after 
> setting the load-path in another file.

Ah, no. That's not how it works: Emacs won't look into all files to find
which one `provides' daph.

It looks for whatever file called "daph.elc" or "daph.el" which comes
first in its search path. So you better call your file "daph.el" (or
alternatively you call your feature "daph-ideograms", as you prefer).

(The "provide" at the end of your file is doing a slightly different
job: it is confirming that, indeed, the feature is present now: the
file's loading could, for example, fail).

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: File for minor mode not found
  2022-01-09 15:12     ` Stephen Berman
@ 2022-01-09 15:57       ` Tomas
  0 siblings, 0 replies; 24+ messages in thread
From: Tomas @ 2022-01-09 15:57 UTC (permalink / raw)
  To: Stephen Berman
  Cc: fatiparty,
	fatiparty--- via Users list for the GNU Emacs text editor

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]

On Sun, Jan 09, 2022 at 04:12:19PM +0100, Stephen Berman wrote:

[...]

> That should be (require 'daph "daph-ideograms"), see `C-h f require':.

Oh, yes: that's yet another possibility.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: File for minor mode not found
  2022-01-09 15:46       ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-09 16:01         ` Stephen Berman
       [not found]         ` <874k6cgap3.fsf@gmx.net-MszaWDg----2>
  1 sibling, 0 replies; 24+ messages in thread
From: Stephen Berman @ 2022-01-09 16:01 UTC (permalink / raw)
  To: fatiparty--- via Users list for the GNU Emacs text editor; +Cc: fatiparty

On Sun, 9 Jan 2022 16:46:51 +0100 (CET) fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> Jan 9, 2022, 15:12 by stephen.berman@gmx.net:
>
>> On Sun, 9 Jan 2022 15:43:42 +0100 (CET) fatiparty--- via Users list for the
>> GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
[...]
>>> It does not exist.  The file is named daph-ideograms.el but I am using 
>>> (provide 'daph) at the end of the file.  And using (require 'daph) after 
>>> setting the load-path in another file.
>>>
>>
>> That should be (require 'daph "daph-ideograms"), see `C-h f require':.
>>
>>  require is a built-in function in ‘C source code’.
>>  
>>  (require FEATURE &optional FILENAME NOERROR)
>>  
>>  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’, or the system-dependent suffix for dynamic module
>>  files, in that order.
>>
>> Steve Berman
>>
>
> Thanks Steve.  One thing that has been difficult to see, is the
> relationship between (provide 'daph) and (require 'daph).  Following
> your suggestion, I need to have (require 'daph "daph-ideograms").  Are
> there any implications for the (provide 'daph) part?

No, that's fine.  As its doc string says, `provide' just "[a]nnounce[s]
that FEATURE is a feature of the current Emacs."  So there's no
requirement that FEATURE be the name of an existing file.  But `require'
loads a feature from an existing file, so it has to find that file,
using the name of the feature as a default.  But if the file providing
that feature has a different name, you have to pass that name (just the
base name without extension) to `require'.

Steve Berman



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

* File for minor mode not found
       [not found]         ` <874k6cgap3.fsf@gmx.net-MszaWDg----2>
@ 2022-01-09 16:37           ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-09 16:50             ` tomas
  0 siblings, 1 reply; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-09 16:37 UTC (permalink / raw)
  To: Stephen Berman; +Cc: fatiparty--- via Users list for the GNU Emacs text editor


Jan 9, 2022, 16:01 by stephen.berman@gmx.net:

> On Sun, 9 Jan 2022 16:46:51 +0100 (CET) fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
>> Jan 9, 2022, 15:12 by stephen.berman@gmx.net:
>>
>>> On Sun, 9 Jan 2022 15:43:42 +0100 (CET) fatiparty--- via Users list for the
>>> GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>>>
> [...]
>
>>>> It does not exist.  The file is named daph-ideograms.el but I am using 
>>>> (provide 'daph) at the end of the file.  And using (require 'daph) after 
>>>> setting the load-path in another file.
>>>>
>>>
>>> That should be (require 'daph "daph-ideograms"), see `C-h f require':.
>>>
>>>  require is a built-in function in ‘C source code’.
>>>  
>>>  (require FEATURE &optional FILENAME NOERROR)
>>>  
>>>  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’, or the system-dependent suffix for dynamic module
>>>  files, in that order.
>>>
>>> Steve Berman
>>>
>>
>> Thanks Steve.  One thing that has been difficult to see, is the
>> relationship between (provide 'daph) and (require 'daph).  Following
>> your suggestion, I need to have (require 'daph "daph-ideograms").  Are
>> there any implications for the (provide 'daph) part?
>>
>
> No, that's fine.  As its doc string says, `provide' just "[a]nnounce[s]
> that FEATURE is a feature of the current Emacs."  So there's no
> requirement that FEATURE be the name of an existing file.  But `require'
> loads a feature from an existing file, so it has to find that file,
> using the name of the feature as a default.  But if the file providing
> that feature has a different name, you have to pass that name (just the
> base name without extension) to `require'.
>
> Steve Berman
>
I have difficulty about the utility of 'provide'.  You have pointed out that (provide 'daph)
simply announces that daph is a feature of the current emacs.  Can it be any name?  The 
manual states that "calling 'provide' adds 'feature' tothe front of 'features' if it is not already
 in that list".  This suggests that provide should also use  (provide 'daph-ideograms).  

I guess that one could define the feature as 'daph' when using 'provide'.  And use the feature 'daph'
when calling 'require'.  In this way, the 'daph' will be recognise the 'daph' feature in the features variable,
but use the optional filename "daph-ideograms"

Thus

daph-ideograms.el
**********************
  (provide 'daph)

test.el
******* 
  (add-to-list
      'load-path "~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/daph-ideograms")
   ;; Load the Daph Package if it has not already been loaded.
   (require 'daph "daph-ideograms")

--------

My load path is quite long, and wonder how this can be shortened by storing in some other variable
before passing to 'add-to-list'.









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

* Re: File for minor mode not found
  2022-01-09 16:37           ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-09 16:50             ` tomas
  2022-01-09 21:49               ` fatiparty--- via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 24+ messages in thread
From: tomas @ 2022-01-09 16:50 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1948 bytes --]

On Sun, Jan 09, 2022 at 05:37:49PM +0100, fatiparty--- via Users list for the GNU Emacs text editor wrote:

[...]

> I have difficulty about the utility of 'provide'.  You have pointed out that (provide 'daph)
> simply announces that daph is a feature of the current emacs.  Can it be any name?  The 
> manual states that "calling 'provide' adds 'feature' tothe front of 'features' if it is not already
>  in that list".  This suggests that provide should also use  (provide 'daph-ideograms).  

That depends on how you want to call your feature. Note that once a
feature is `provide'd, a `require' of that feature does nothing. Quoting
from the docs:

  require is a built-in function in ‘C source code’.

  (require FEATURE &optional FILENAME NOERROR)

  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.

> I guess that one could define the feature as 'daph' when using 'provide'.  And use the feature 'daph'
> when calling 'require'.  In this way, the 'daph' will be recognise the 'daph' feature in the features variable,
> but use the optional filename "daph-ideograms"

Yes, that'd be a way to do it (in theory you could have one file
providing several features, for example).

> Thus
> 
> daph-ideograms.el
> **********************
>   (provide 'daph)
> 
> test.el
> ******* 
>   (add-to-list
>       'load-path "~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/daph-ideograms")
>    ;; Load the Daph Package if it has not already been loaded.
>    (require 'daph "daph-ideograms")
> 
> --------
> 
> My load path is quite long, and wonder how this can be shortened by storing in some other variable
> before passing to 'add-to-list'.

I don't quite understand your last sentence. What is it you are trying
to shorten -- and how?

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* RE: [External] : File for minor mode not found
       [not found]   ` <MsxIft1--B-2@tutanota.com>
@ 2022-01-09 17:25     ` Drew Adams
  0 siblings, 0 replies; 24+ messages in thread
From: Drew Adams @ 2022-01-09 17:25 UTC (permalink / raw)
  To: fatiparty@tutanota.com; +Cc: 'Help-Gnu-Emacs (help-gnu-emacs@gnu.org)'

[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]

Yes.

See `C-h f require' and `C-h f provide' and
`C-h i' with Elisp manual, node Named Features<https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html>.

Either name your file and the feature the same (minus the ".el") or explicitly pass the filename, as well as the feature name, to `require'. From the Elisp manual:

If the feature is not present, then ‘require’ loads FILENAME with ‘load’.  If FILENAME is not supplied, then the name of the symbol FEATURE is used as the base file name to load.  However, in this case, ‘require’ insists on finding FEATURE with an added ‘.el’ or  ‘.elc’ suffix (possibly extended with a compression suffix); a file whose name is just FEATURE won’t be used.  (The variable  ‘load-suffixes’ specifies the exact required Lisp suffixes.)

Is your file ~/Admir/typ/zig/daph-ideograms/daph.el?
           ^^^^^^^
If not, (require 'daph) won't load it.
No, it is daph-ideograms.el

Is there way to load it when the filename differs?

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 17795 bytes --]

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

* File for minor mode not found
  2022-01-09 16:50             ` tomas
@ 2022-01-09 21:49               ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-09 22:10                 ` Tomas
       [not found]                 ` <YdtdbjZlybD0X0rJ@tuxteam.de-Mt-tK84----2>
  0 siblings, 2 replies; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-09 21:49 UTC (permalink / raw)
  To: Tomas; +Cc: Help Gnu Emacs


Jan 9, 2022, 16:50 by tomas@tuxteam.de:

> On Sun, Jan 09, 2022 at 05:37:49PM +0100, fatiparty--- via Users list for the GNU Emacs text editor wrote:
>
> [...]
>
>> I have difficulty about the utility of 'provide'.  You have pointed out that (provide 'daph)
>> simply announces that daph is a feature of the current emacs.  Can it be any name?  The 
>> manual states that "calling 'provide' adds 'feature' tothe front of 'features' if it is not already
>>  in that list".  This suggests that provide should also use  (provide 'daph-ideograms). 
>>
>
> That depends on how you want to call your feature. Note that once a
> feature is `provide'd, a `require' of that feature does nothing. Quoting
> from the docs:
>
>  require is a built-in function in ‘C source code’.
>
>  (require FEATURE &optional FILENAME NOERROR)
>
>  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.
>
>> I guess that one could define the feature as 'daph' when using 'provide'.  And use the feature 'daph'
>> when calling 'require'.  In this way, the 'daph' will be recognise the 'daph' feature in the features variable,
>> but use the optional filename "daph-ideograms"
>>
>
> Yes, that'd be a way to do it (in theory you could have one file
> providing several features, for example).
>
>> Thus
>>
>> daph-ideograms.el
>> **********************
>>   (provide 'daph)
>>
>> test.el
>> ******* 
>>   (add-to-list
>>       'load-path "~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/daph-ideograms")
>>    ;; Load the Daph Package if it has not already been loaded.
>>    (require 'daph "daph-ideograms")
>>
>> --------
>>
>> My load path is quite long, and wonder how this can be shortened by storing in some other variable
>> before passing to 'add-to-list'.
>>
>
> I don't quite understand your last sentence. What is it you are trying
> to shorten -- and how?
>
I want to keep within 72 characters on the line.  I could store the first part  
 '~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/' in some variable, and find some
way to add the complete path for 'add-to-list'.



> Cheers
> -- 
> t
>



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

* Re: File for minor mode not found
  2022-01-09 21:49               ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-09 22:10                 ` Tomas
       [not found]                 ` <YdtdbjZlybD0X0rJ@tuxteam.de-Mt-tK84----2>
  1 sibling, 0 replies; 24+ messages in thread
From: Tomas @ 2022-01-09 22:10 UTC (permalink / raw)
  To: fatiparty; +Cc: Help Gnu Emacs

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

On Sun, Jan 09, 2022 at 10:49:58PM +0100, fatiparty@tutanota.com wrote:
> 
> Jan 9, 2022, 16:50 by tomas@tuxteam.de:

[...]

> >> test.el
> >> ******* 
> >>   (add-to-list
> >>       'load-path "~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/daph-ideograms")
> >>    ;; Load the Daph Package if it has not already been loaded.
> >>    (require 'daph "daph-ideograms")
> >>
> >> --------
> >>
> >> My load path is quite long, and wonder how this can be shortened by storing in some other variable
> >> before passing to 'add-to-list'.
> >>
> >
> > I don't quite understand your last sentence. What is it you are trying
> > to shorten -- and how?
> >
> I want to keep within 72 characters on the line.  I could store the first part  
>  '~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/' in some variable, and find some
> way to add the complete path for 'add-to-list'.

Ah -- it's about the (string) length of that path element, not about the
(list) length of the whole load-path.

Well, typically some prefix of the path element has a significance. Say,
for example "~/Admin/bin/gadi-1.0" be gadi-files or so. That's the way I
usually do it.

Bonus points: you only get to change one when that changes :-)

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* File for minor mode not found
       [not found]                 ` <YdtdbjZlybD0X0rJ@tuxteam.de-Mt-tK84----2>
@ 2022-01-10 12:19                   ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-10 18:09                     ` Tomas
       [not found]                     ` <Ydx2V/PAuIJAU8HR@tuxteam.de-Mt4B_wx----2>
  0 siblings, 2 replies; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-10 12:19 UTC (permalink / raw)
  To: Tomas; +Cc: Help Gnu Emacs

Jan 9, 2022, 22:10 by tomas@tuxteam.de:

> On Sun, Jan 09, 2022 at 10:49:58PM +0100, fatiparty@tutanota.com wrote:
>
>>
>> Jan 9, 2022, 16:50 by tomas@tuxteam.de:
>>
>
> [...]
>
>> >> test.el
>> >> ******* 
>> >>   (add-to-list
>> >>       'load-path "~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/daph-ideograms")
>> >>    ;; Load the Daph Package if it has not already been loaded.
>> >>    (require 'daph "daph-ideograms")
>> >>
>> >> --------
>> >>
>> >> My load path is quite long, and wonder how this can be shortened by storing in some other variable
>> >> before passing to 'add-to-list'.
>> >>
>> >
>> > I don't quite understand your last sentence. What is it you are trying
>> > to shorten -- and how?
>> >
>> I want to keep within 72 characters on the line.  I could store the first part  
>>  '~/Admin/bin/gadi-1.0/typex/ziggurat-protowrit/' in some variable, and find some
>> way to add the complete path for 'add-to-list'.
>>
>
> Ah -- it's about the (string) length of that path element, not about the
> (list) length of the whole load-path.
>
> Well, typically some prefix of the path element has a significance. Say,
> for example "~/Admin/bin/gadi-1.0" be gadi-files or so. That's the way I
> usually do it.
>
> Bonus points: you only get to change one when that changes :-)
>
That is correct.  Would one use setq or something buffer local.  How would.  
for instance, gadi-files be constructed?


> Cheers
> -- 
> t
>



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

* Re: File for minor mode not found
  2022-01-10 12:19                   ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-10 18:09                     ` Tomas
       [not found]                     ` <Ydx2V/PAuIJAU8HR@tuxteam.de-Mt4B_wx----2>
  1 sibling, 0 replies; 24+ messages in thread
From: Tomas @ 2022-01-10 18:09 UTC (permalink / raw)
  To: fatiparty; +Cc: Help Gnu Emacs

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

On Mon, Jan 10, 2022 at 01:19:55PM +0100, fatiparty@tutanota.com wrote:
> Jan 9, 2022, 22:10 by tomas@tuxteam.de:

[...]

> > Well, typically some prefix of the path element has a significance. Say,
> > for example "~/Admin/bin/gadi-1.0" be gadi-files or so. That's the way I
> > usually do it.
> >
> > Bonus points: you only get to change one when that changes :-)
> >
> That is correct.  Would one use setq or something buffer local.  How would.  
> for instance, gadi-files be constructed?

This is a matter of style and taste -- and can vary a lot.

If there is just one place where you do it (quite possible) then I
wouldn't even bother (someone else might, though). And actually, I would
try to keep it that way.

But if I found myself doing `(add-to-list 'load-path "~/Admin/bin/gadi-1.0/...")',
I'd be tempted to do something along these lines:

  (defvar my-gadi-basedir "~/Admin/bin/gadi-1.0"
    "the base dir for gadi programs")

  (defun my-gadi-add-to-load-path (dir)
    (add-to-list 'load-path
      (file-name-concat my-gadi-basedir dir)

and then:

  (my-gadi-add-to-load-path "typex/ziggurat-protowrit/daph-ideograms")

I'm assuming that your "package prefix" is `my-gadi'. It is, of course,
a judgement call whether or when this extra complication is worth the
hassle. And there are (at least) 43 other ways to skin that cat.
Besides, my choice of the split point for -basedir is just based on a
very inexact feeling: you have more details.

So take this just as a rough sketch for inspiration.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* File for minor mode not found
       [not found]                     ` <Ydx2V/PAuIJAU8HR@tuxteam.de-Mt4B_wx----2>
@ 2022-01-11  0:23                       ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-11  6:38                         ` Tomas
       [not found]                         ` <Yd0lz7vSTBzYeeJW@tuxteam.de-Mt6ynvW--7-2>
  0 siblings, 2 replies; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-11  0:23 UTC (permalink / raw)
  To: Tomas; +Cc: Help Gnu Emacs

Jan 10, 2022, 18:09 by tomas@tuxteam.de:

> On Mon, Jan 10, 2022 at 01:19:55PM +0100, fatiparty@tutanota.com wrote:
>
>> Jan 9, 2022, 22:10 by tomas@tuxteam.de:
>>
>
> [...]
>
>> > Well, typically some prefix of the path element has a significance. Say,
>> > for example "~/Admin/bin/gadi-1.0" be gadi-files or so. That's the way I
>> > usually do it.
>> >
>> > Bonus points: you only get to change one when that changes :-)
>> >
>> That is correct.  Would one use setq or something buffer local.  How would.  
>> for instance, gadi-files be constructed?
>>
>
> This is a matter of style and taste -- and can vary a lot.
>
> If there is just one place where you do it (quite possible) then I
> wouldn't even bother (someone else might, though). And actually, I would
> try to keep it that way.
>
> But if I found myself doing `(add-to-list 'load-path "~/Admin/bin/gadi-1.0/...")',
> I'd be tempted to do something along these lines:
>
>  (defvar my-gadi-basedir "~/Admin/bin/gadi-1.0"
>  "the base dir for gadi programs")
>
>  (defun my-gadi-add-to-load-path (dir)
>  (add-to-list 'load-path
>  (file-name-concat my-gadi-basedir dir)
>

With file-name-concat, I get 

Symbol's function definition is void: file-name-concat

I am using GNU Emacs 27.2 of 2021-09-28


> and then:
>
>  (my-gadi-add-to-load-path "typex/ziggurat-protowrit/daph-ideograms")
>
> I'm assuming that your "package prefix" is `my-gadi'. It is, of course,
> a judgement call whether or when this extra complication is worth the
> hassle. And there are (at least) 43 other ways to skin that cat.
> Besides, my choice of the split point for -basedir is just based on a
> very inexact feeling: you have more details.
>
> So take this just as a rough sketch for inspiration.
>
> Cheers
> -- 
> t
>



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

* Re: File for minor mode not found
  2022-01-11  0:23                       ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-11  6:38                         ` Tomas
  2022-01-11 16:33                           ` Michael Heerdegen
       [not found]                         ` <Yd0lz7vSTBzYeeJW@tuxteam.de-Mt6ynvW--7-2>
  1 sibling, 1 reply; 24+ messages in thread
From: Tomas @ 2022-01-11  6:38 UTC (permalink / raw)
  To: fatiparty; +Cc: Help Gnu Emacs

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

On Tue, Jan 11, 2022 at 01:23:34AM +0100, fatiparty@tutanota.com wrote:

[...]

> With file-name-concat, I get 
> 
> Symbol's function definition is void: file-name-concat
> 
> I am using GNU Emacs 27.2 of 2021-09-28

Oh, that seems to be an 28.1 introduction. Try

  (concat (file-name-as-directory my-gadi-basedir) dir)

instead. That seemed to be the recommended way, at least up to 27.2 [1].

Cheers

[1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Names.html

-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* File for minor mode not found
       [not found]                         ` <Yd0lz7vSTBzYeeJW@tuxteam.de-Mt6ynvW--7-2>
@ 2022-01-11 16:25                           ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-11 16:36                             ` Michael Heerdegen
  0 siblings, 1 reply; 24+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-11 16:25 UTC (permalink / raw)
  To: Tomas; +Cc: Help Gnu Emacs


Jan 11, 2022, 18:38 by tomas@tuxteam.de:

> On Tue, Jan 11, 2022 at 01:23:34AM +0100, fatiparty@tutanota.com wrote:
>
> [...]
>
>> With file-name-concat, I get 
>>
>> Symbol's function definition is void: file-name-concat
>>
>> I am using GNU Emacs 27.2 of 2021-09-28
>>
>
> Oh, that seems to be an 28.1 introduction. Try
>
>  (concat (file-name-as-directory my-gadi-basedir) dir)
>
> instead. That seemed to be the recommended way, at least up to 27.2 [1].
>

Thank You Tomas.  Is it possible to do one or the other by checking if one
is using 27.2 or 28.1 ?


> Cheers
>
> [1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Names.html
>
> -- 
> t
>



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

* Re: File for minor mode not found
  2022-01-11  6:38                         ` Tomas
@ 2022-01-11 16:33                           ` Michael Heerdegen
  2022-01-11 16:41                             ` tomas
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Heerdegen @ 2022-01-11 16:33 UTC (permalink / raw)
  To: help-gnu-emacs

Tomas <tomas@tuxteam.de> writes:

> Oh, that seems to be an 28.1 introduction. Try
>
>   (concat (file-name-as-directory my-gadi-basedir) dir)
>
> instead. That seemed to be the recommended way, at least up to 27.2
> [1].

[1] also mentions:

| To avoid the issues [...] use:
| 
| (expand-file-name relfile dirname)

Michael.

> [1]
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Names.html




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

* Re: File for minor mode not found
  2022-01-11 16:25                           ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-11 16:36                             ` Michael Heerdegen
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Heerdegen @ 2022-01-11 16:36 UTC (permalink / raw)
  To: help-gnu-emacs

fatiparty--- via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Thank You Tomas.  Is it possible to do one or the other by checking if one
> is using 27.2 or 28.1 ?

The standard solution is to check with `functionp' whether the function
exists in the current Emacs version:

#+begin_src emacs-lisp
(if (functionp 'file-name-concat)
    (use-it)
  (alternative-solution))
#+end_src

Michael.




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

* Re: File for minor mode not found
  2022-01-11 16:33                           ` Michael Heerdegen
@ 2022-01-11 16:41                             ` tomas
  0 siblings, 0 replies; 24+ messages in thread
From: tomas @ 2022-01-11 16:41 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Tue, Jan 11, 2022 at 05:33:11PM +0100, Michael Heerdegen wrote:
> Tomas <tomas@tuxteam.de> writes:
> 
> > Oh, that seems to be an 28.1 introduction. Try
> >
> >   (concat (file-name-as-directory my-gadi-basedir) dir)
> >
> > instead. That seemed to be the recommended way, at least up to 27.2
> > [1].
> 
> [1] also mentions:
> 
> | To avoid the issues [...] use:
> | 
> | (expand-file-name relfile dirname)
> 
> Michael.

Ah, thanks. That seems to be the one I was actually looking for :)

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

end of thread, other threads:[~2022-01-11 16:41 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-09  5:14 File for minor mode not found fatiparty--- via Users list for the GNU Emacs text editor
2022-01-09  6:47 ` tomas
2022-01-09  7:06   ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-09 10:04     ` tomas
2022-01-09 15:01       ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-09 14:43   ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-09 15:12     ` Stephen Berman
2022-01-09 15:57       ` Tomas
     [not found]     ` <878rvpeyek.fsf@gmx.net-MszOZsb----2>
2022-01-09 15:46       ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-09 16:01         ` Stephen Berman
     [not found]         ` <874k6cgap3.fsf@gmx.net-MszaWDg----2>
2022-01-09 16:37           ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-09 16:50             ` tomas
2022-01-09 21:49               ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-09 22:10                 ` Tomas
     [not found]                 ` <YdtdbjZlybD0X0rJ@tuxteam.de-Mt-tK84----2>
2022-01-10 12:19                   ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-10 18:09                     ` Tomas
     [not found]                     ` <Ydx2V/PAuIJAU8HR@tuxteam.de-Mt4B_wx----2>
2022-01-11  0:23                       ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-11  6:38                         ` Tomas
2022-01-11 16:33                           ` Michael Heerdegen
2022-01-11 16:41                             ` tomas
     [not found]                         ` <Yd0lz7vSTBzYeeJW@tuxteam.de-Mt6ynvW--7-2>
2022-01-11 16:25                           ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-11 16:36                             ` Michael Heerdegen
2022-01-09 15:56     ` Tomas
     [not found] ` <SJ0PR10MB5488E2D49393EC94EC06A41CF34F9@SJ0PR10MB5488.namprd10.prod.outlook.com>
     [not found]   ` <MsxIft1--B-2@tutanota.com>
2022-01-09 17:25     ` [External] : " Drew Adams

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).