unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Is it expected to have reserved "system.el"?
@ 2023-01-02  9:49 Jean Louis
  2023-01-02 12:34 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Louis @ 2023-01-02  9:49 UTC (permalink / raw)
  To: emacs-devel

Personally I have already my `system.el' which deals with various
functions for the computer, such as fan speed, WiFi connection, SD
card, mounting disks, and similar.

Then I use my own function `system-move-file-to-trash' as recommended
by Emacs function `move-file-to-trash'. It indicates to me that there
may be other functions asking for users to define new functions which
are specifically system based.

And from there I am thinking that maybe developers wish to reserve the
prefix `system-' for users, so that users can develop such functions
relevant to system.

I cannot find references in Emacs manual to this.

Are there are functions in Emacs that are expected to be defined by
user with prefix `system-'?

Is it notion or idea that such functions exist?

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: Is it expected to have reserved "system.el"?
  2023-01-02  9:49 Is it expected to have reserved "system.el"? Jean Louis
@ 2023-01-02 12:34 ` Eli Zaretskii
  2023-01-02 16:35   ` Jean Louis
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-01-02 12:34 UTC (permalink / raw)
  To: Jean Louis; +Cc: emacs-devel

> Date: Mon, 2 Jan 2023 12:49:01 +0300
> From: Jean Louis <bugs@gnu.support>
> 
> Personally I have already my `system.el' which deals with various
> functions for the computer, such as fan speed, WiFi connection, SD
> card, mounting disks, and similar.
> 
> Then I use my own function `system-move-file-to-trash' as recommended
> by Emacs function `move-file-to-trash'. It indicates to me that there
> may be other functions asking for users to define new functions which
> are specifically system based.
> 
> And from there I am thinking that maybe developers wish to reserve the
> prefix `system-' for users, so that users can develop such functions
> relevant to system.
> 
> I cannot find references in Emacs manual to this.
> 
> Are there are functions in Emacs that are expected to be defined by
> user with prefix `system-'?
> 
> Is it notion or idea that such functions exist?

I don't understand these questions, and therefore cannot answer them.

Please provide more concrete details: which code you tried to use, and
what was the exact message you saw (please cite the message exactly as
shown by Emacs).  Without these details, I cannot understand what
exactly happened in your case.



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

* Re: Is it expected to have reserved "system.el"?
  2023-01-02 12:34 ` Eli Zaretskii
@ 2023-01-02 16:35   ` Jean Louis
  2023-01-02 17:05     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Louis @ 2023-01-02 16:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

* Eli Zaretskii <eliz@gnu.org> [2023-01-02 15:35]:
> I don't understand these questions, and therefore cannot answer them.
> 
> Please provide more concrete details: which code you tried to use, and
> what was the exact message you saw (please cite the message exactly as
> shown by Emacs).  Without these details, I cannot understand what
> exactly happened in your case.

Here it is:

> move-file-to-trash is an interactive byte-compiled Lisp function in
> ‘files.el’.

> (move-file-to-trash FILENAME)

> Move the file (or directory) named FILENAME to the trash.
> When ‘delete-by-moving-to-trash’ is non-nil, this function is
> called by ‘delete-file’ and ‘delete-directory’ instead of
> deleting files outright.

> If the function ‘system-move-file-to-trash’ is defined, call it
>  with FILENAME as an argument.
> Otherwise, if ‘trash-directory’ is non-nil, move FILENAME to that
>  directory.
> Otherwise, trash FILENAME using the freedesktop.org conventions,
>  like the GNOME, KDE and XFCE desktop environments.  Emacs moves
>  files only to "home trash", ignoring per-volume trashcans.

>   Probably introduced at or before Emacs version 23.2.

As you may see Emacs expects users to define function
`system-move-file-to-trash' and based on that, is there notion that
package named "system.el" is reserved for users on specific computer?

Is prefix `system-' maybe reserved from Emacs for every specific
system (computer)?

That is by chance exactly what I do, and I would favorite that approach.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




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

* Re: Is it expected to have reserved "system.el"?
  2023-01-02 16:35   ` Jean Louis
@ 2023-01-02 17:05     ` Eli Zaretskii
  2023-01-03 21:30       ` Jean Louis
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-01-02 17:05 UTC (permalink / raw)
  To: Jean Louis; +Cc: emacs-devel

> Date: Mon, 2 Jan 2023 19:35:26 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: emacs-devel@gnu.org
> 
> > move-file-to-trash is an interactive byte-compiled Lisp function in
> > ‘files.el’.
> 
> > (move-file-to-trash FILENAME)
> 
> > Move the file (or directory) named FILENAME to the trash.
> > When ‘delete-by-moving-to-trash’ is non-nil, this function is
> > called by ‘delete-file’ and ‘delete-directory’ instead of
> > deleting files outright.
> 
> > If the function ‘system-move-file-to-trash’ is defined, call it
> >  with FILENAME as an argument.
> > Otherwise, if ‘trash-directory’ is non-nil, move FILENAME to that
> >  directory.
> > Otherwise, trash FILENAME using the freedesktop.org conventions,
> >  like the GNOME, KDE and XFCE desktop environments.  Emacs moves
> >  files only to "home trash", ignoring per-volume trashcans.
> 
> >   Probably introduced at or before Emacs version 23.2.
> 
> As you may see Emacs expects users to define function
> `system-move-file-to-trash' and based on that, is there notion that
> package named "system.el" is reserved for users on specific computer?

No and no.  What the above says is that if the function by that name
is defined, it will be used.  We have 2 platforms which define such a
function: MS-Windows and macOS.  On other platforms, we use our own
Lisp code in move-file-to-trash.  We don't _expect_ users to define
such a function.  And there's no claim here that no other function can
be called system-SOMETHING.

> Is prefix `system-' maybe reserved from Emacs for every specific
> system (computer)?

No.



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

* Re: Is it expected to have reserved "system.el"?
  2023-01-02 17:05     ` Eli Zaretskii
@ 2023-01-03 21:30       ` Jean Louis
  0 siblings, 0 replies; 5+ messages in thread
From: Jean Louis @ 2023-01-03 21:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

* Eli Zaretskii <eliz@gnu.org> [2023-01-02 20:05]:
> > As you may see Emacs expects users to define function
> > `system-move-file-to-trash' and based on that, is there notion that
> > package named "system.el" is reserved for users on specific computer?
> 
> No and no.  What the above says is that if the function by that name
> is defined, it will be used.  We have 2 platforms which define such a
> function: MS-Windows and macOS.  On other platforms, we use our own
> Lisp code in move-file-to-trash.  We don't _expect_ users to define
> such a function.  And there's no claim here that no other function can
> be called system-SOMETHING.

Alright, I got it now. Surprising. 

It should be part of docstring.

> > Is prefix `system-' maybe reserved from Emacs for every specific
> > system (computer)?
> 
> No.


Thank you.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



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

end of thread, other threads:[~2023-01-03 21:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02  9:49 Is it expected to have reserved "system.el"? Jean Louis
2023-01-02 12:34 ` Eli Zaretskii
2023-01-02 16:35   ` Jean Louis
2023-01-02 17:05     ` Eli Zaretskii
2023-01-03 21:30       ` Jean Louis

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