unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#3736: 23.1.50; Please use null-device instead of /dev/null
@ 2009-07-01 20:22 Lennart Borgman
  0 siblings, 0 replies; 14+ messages in thread
From: Lennart Borgman @ 2009-07-01 20:22 UTC (permalink / raw)
  To: emacs-pretest-bug

There are nearly a hundred places in Emacs lisp sources where
/dev/null is used instead of null-device. Please convert those to use
null-device so that it gets system-independent. (I wonder what to do
with those in Tramp.)


In GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-06-30





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
       [not found] <mailman.1659.1246480655.2239.bug-gnu-emacs@gnu.org>
@ 2009-07-02 12:22 ` Michael Albinus
  2009-07-02 13:03   ` Jason Rumney
  2009-07-02 18:49   ` Eli Zaretskii
  0 siblings, 2 replies; 14+ messages in thread
From: Michael Albinus @ 2009-07-02 12:22 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: emacs-pretest-bug, 3736

Lennart Borgman <lennart.borgman@gmail.com> writes:

> There are nearly a hundred places in Emacs lisp sources where
> /dev/null is used instead of null-device. Please convert those to use
> null-device so that it gets system-independent. (I wonder what to do
> with those in Tramp.)

On W32 systems, null-device is "NUL". Not useful for Tramp, it needs
"/dev/null" on remote machines.

Best regards, Michael.





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 12:22 ` bug#3736: 23.1.50; Please use null-device instead of /dev/null Michael Albinus
@ 2009-07-02 13:03   ` Jason Rumney
  2009-07-02 13:57     ` Sven Joachim
  2009-07-02 15:06     ` Michael Albinus
  2009-07-02 18:49   ` Eli Zaretskii
  1 sibling, 2 replies; 14+ messages in thread
From: Jason Rumney @ 2009-07-02 13:03 UTC (permalink / raw)
  To: Michael Albinus, 3736; +Cc: emacs-pretest-bug

Michael Albinus wrote:

> On W32 systems, null-device is "NUL". Not useful for Tramp, it needs
> "/dev/null" on remote machines.
>   

What if the remote machine uses "NUL", "NLA0:" or "Dev:Nul" for its null 
device? I think tramp benefits from the use of null-device instead of 
hard-coded "/dev/null" as much as any other part of Emacs.






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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 13:03   ` Jason Rumney
@ 2009-07-02 13:57     ` Sven Joachim
  2009-07-02 14:14       ` Jason Rumney
  2009-07-02 14:21       ` Lennart Borgman
  2009-07-02 15:06     ` Michael Albinus
  1 sibling, 2 replies; 14+ messages in thread
From: Sven Joachim @ 2009-07-02 13:57 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Michael Albinus, 3736

On 2009-07-02 15:03 +0200, Jason Rumney wrote:

> Michael Albinus wrote:
>
>> On W32 systems, null-device is "NUL". Not useful for Tramp, it needs
>> "/dev/null" on remote machines.
>>   
>
> What if the remote machine uses "NUL", "NLA0:" or "Dev:Nul" for its
> null device? I think tramp benefits from the use of null-device
> instead of hard-coded "/dev/null" as much as any other part of Emacs.

Not really, you know what null-device should be for the local machine,
but not for remote computers.

Sven





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 13:57     ` Sven Joachim
@ 2009-07-02 14:14       ` Jason Rumney
  2009-07-02 15:10         ` Michael Albinus
  2009-07-02 14:21       ` Lennart Borgman
  1 sibling, 1 reply; 14+ messages in thread
From: Jason Rumney @ 2009-07-02 14:14 UTC (permalink / raw)
  To: Sven Joachim; +Cc: Michael Albinus, 3736

Sven Joachim wrote:
> Not really, you know what null-device should be for the local machine,
> but not for remote computers.
>   

Probably the best solution is for tramp to implement a general 
server-local-variable mechanism, as there are probably other variables 
that need different values for different servers too.  The user could 
then configure a variable (such as tramp-server-local-variable-alist) to 
define any such variables that they need to, which would then be let 
bound as appropriate in tramp functions.







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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 13:57     ` Sven Joachim
  2009-07-02 14:14       ` Jason Rumney
@ 2009-07-02 14:21       ` Lennart Borgman
  1 sibling, 0 replies; 14+ messages in thread
From: Lennart Borgman @ 2009-07-02 14:21 UTC (permalink / raw)
  To: Sven Joachim, 3736; +Cc: Michael Albinus

On Thu, Jul 2, 2009 at 3:57 PM, Sven Joachim<svenjoac@gmx.de> wrote:
> On 2009-07-02 15:03 +0200, Jason Rumney wrote:
>
>> Michael Albinus wrote:
>>
>>> On W32 systems, null-device is "NUL". Not useful for Tramp, it needs
>>> "/dev/null" on remote machines.
>>>
>>
>> What if the remote machine uses "NUL", "NLA0:" or "Dev:Nul" for its
>> null device? I think tramp benefits from the use of null-device
>> instead of hard-coded "/dev/null" as much as any other part of Emacs.
>
> Not really, you know what null-device should be for the local machine,
> but not for remote computers.

Does not the remote computer identify itself so that it is possible to
at least make a better guess?





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 13:03   ` Jason Rumney
  2009-07-02 13:57     ` Sven Joachim
@ 2009-07-02 15:06     ` Michael Albinus
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Albinus @ 2009-07-02 15:06 UTC (permalink / raw)
  To: Jason Rumney; +Cc: 3736

Jason Rumney <jasonr@gnu.org> writes:

>> On W32 systems, null-device is "NUL". Not useful for Tramp, it needs
>> "/dev/null" on remote machines.
>
> What if the remote machine uses "NUL", "NLA0:" or "Dev:Nul" for its
> null device? I think tramp benefits from the use of null-device
> instead of hard-coded "/dev/null" as much as any other part of Emacs.

In case Tramp uses "/dev/null", the remote machine is expected to be
unixish. For other remote machine types, "/dev/null" is not used.

I would not carve this sentence in stone, but that's the situation
today.

Best regards, Michael.





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 14:14       ` Jason Rumney
@ 2009-07-02 15:10         ` Michael Albinus
  2020-11-19  2:31           ` Stefan Kangas
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Albinus @ 2009-07-02 15:10 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Sven Joachim, 3736

Jason Rumney <jasonr@gnu.org> writes:

> Probably the best solution is for tramp to implement a general
> server-local-variable mechanism, as there are probably other variables
> that need different values for different servers too.  The user could
> then configure a variable (such as tramp-server-local-variable-alist)
> to define any such variables that they need to, which would then be
> let bound as appropriate in tramp functions.

Nice idea. Tramp does it already in some cases (for example for
environment variables of the remote host), but your proposal is more
general.

Noted.

Best regards, Michael.





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 12:22 ` bug#3736: 23.1.50; Please use null-device instead of /dev/null Michael Albinus
  2009-07-02 13:03   ` Jason Rumney
@ 2009-07-02 18:49   ` Eli Zaretskii
  1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2009-07-02 18:49 UTC (permalink / raw)
  To: Michael Albinus, 3736

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Thu, 02 Jul 2009 14:22:38 +0200
> Cc: emacs-pretest-bug@gnu.org, 3736@emacsbugs.donarmstrong.com
> 
> Lennart Borgman <lennart.borgman@gmail.com> writes:
> 
> > There are nearly a hundred places in Emacs lisp sources where
> > /dev/null is used instead of null-device. Please convert those to use
> > null-device so that it gets system-independent. (I wonder what to do
> > with those in Tramp.)
> 
> On W32 systems, null-device is "NUL". Not useful for Tramp, it needs
> "/dev/null" on remote machines.

On remote machines, Tramp indeed shouldn't use a value that is correct
for the local OS.





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2009-07-02 15:10         ` Michael Albinus
@ 2020-11-19  2:31           ` Stefan Kangas
  2020-11-19 16:32             ` Michael Albinus
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Kangas @ 2020-11-19  2:31 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 3736, Sven Joachim, Jason Rumney

Michael Albinus <michael.albinus@gmx.de> writes:

> Jason Rumney <jasonr@gnu.org> writes:
>
>> Probably the best solution is for tramp to implement a general
>> server-local-variable mechanism, as there are probably other variables
>> that need different values for different servers too.  The user could
>> then configure a variable (such as tramp-server-local-variable-alist)
>> to define any such variables that they need to, which would then be
>> let bound as appropriate in tramp functions.
>
> Nice idea. Tramp does it already in some cases (for example for
> environment variables of the remote host), but your proposal is more
> general.
>
> Noted.

(That was 12 years ago.)

Now that we have this concept of "connection local variables", does that
satisfy the requirement to be able to specify null-device for remote
hosts?





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2020-11-19  2:31           ` Stefan Kangas
@ 2020-11-19 16:32             ` Michael Albinus
  2020-11-21 15:16               ` Michael Albinus
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Albinus @ 2020-11-19 16:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 3736, Sven Joachim, Jason Rumney

Stefan Kangas <stefan@marxist.se> writes:

Hi Stefan,

> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> Jason Rumney <jasonr@gnu.org> writes:
>>
>>> Probably the best solution is for tramp to implement a general
>>> server-local-variable mechanism, as there are probably other variables
>>> that need different values for different servers too.  The user could
>>> then configure a variable (such as tramp-server-local-variable-alist)
>>> to define any such variables that they need to, which would then be
>>> let bound as appropriate in tramp functions.
>>
>> Nice idea. Tramp does it already in some cases (for example for
>> environment variables of the remote host), but your proposal is more
>> general.
>>
>> Noted.
>
> (That was 12 years ago.)

Thanks for the reminder. Somehow, I've missed to tag this bug locally,
so I've lost it.

> Now that we have this concept of "connection local variables", does that
> satisfy the requirement to be able to specify null-device for remote
> hosts?

Yes, shall be possible. I'll see what I could do (with slow progress, as
it happens these days to me). Target will be Emacs 28.

Best regards, Michael.





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2020-11-19 16:32             ` Michael Albinus
@ 2020-11-21 15:16               ` Michael Albinus
  2020-11-26 15:28                 ` Michael Albinus
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Albinus @ 2020-11-21 15:16 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 3736, Sven Joachim, Jason Rumney

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Stefan,

>>>> Probably the best solution is for tramp to implement a general
>>>> server-local-variable mechanism, as there are probably other variables
>>>> that need different values for different servers too.  The user could
>>>> then configure a variable (such as tramp-server-local-variable-alist)
>>>> to define any such variables that they need to, which would then be
>>>> let bound as appropriate in tramp functions.
>>>
>>> Nice idea. Tramp does it already in some cases (for example for
>>> environment variables of the remote host), but your proposal is more
>>> general.
>
>> Now that we have this concept of "connection local variables", does that
>> satisfy the requirement to be able to specify null-device for remote
>> hosts?
>
> Yes, shall be possible. I'll see what I could do (with slow progress, as
> it happens these days to me). Target will be Emacs 28.

I've added the functions null-device and path-separator, which return
the connection-local values of the respective variables. As first shot,
I've changed grep.el using this. Let's see whether there's
feedback. However, people will see a difference only if they work on a
local w32 system, and apply Emacs's grep command on a remote machine --
a constellation I cannot test myself.

I'll continue to adapt other Emacs Lisp files.

Best regards, Michael.





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2020-11-21 15:16               ` Michael Albinus
@ 2020-11-26 15:28                 ` Michael Albinus
  2020-11-26 16:47                   ` Stefan Kangas
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Albinus @ 2020-11-26 15:28 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 3736-done, Sven Joachim, Jason Rumney

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Stefan,

> I've added the functions null-device and path-separator, which return
> the connection-local values of the respective variables. As first shot,
> I've changed grep.el using this. Let's see whether there's
> feedback. However, people will see a difference only if they work on a
> local w32 system, and apply Emacs's grep command on a remote machine --
> a constellation I cannot test myself.
>
> I'll continue to adapt other Emacs Lisp files.

I have applied all respective changes in the master branch which look
obvious to me. There are still ~40 occurences of /dev/null in the lisp
directory, but most of them are comments. So I'll close this bug.

If people are interested in fixing the few other places, they could do
now by using the null-device variable or function. In case they don't
know what's better, a new bug report for the given case would do,
instead of keeping *this* bug report open forever.

Best regards, Michael.





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

* bug#3736: 23.1.50; Please use null-device instead of /dev/null
  2020-11-26 15:28                 ` Michael Albinus
@ 2020-11-26 16:47                   ` Stefan Kangas
  0 siblings, 0 replies; 14+ messages in thread
From: Stefan Kangas @ 2020-11-26 16:47 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 3736-done, Sven Joachim, Jason Rumney

Michael Albinus <michael.albinus@gmx.de> writes:

> I have applied all respective changes in the master branch which look
> obvious to me. There are still ~40 occurences of /dev/null in the lisp
> directory, but most of them are comments. So I'll close this bug.

Thanks for taking care of all that.

> If people are interested in fixing the few other places, they could do
> now by using the null-device variable or function. In case they don't
> know what's better, a new bug report for the given case would do,
> instead of keeping *this* bug report open forever.

Sounds reasonable.





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

end of thread, other threads:[~2020-11-26 16:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1659.1246480655.2239.bug-gnu-emacs@gnu.org>
2009-07-02 12:22 ` bug#3736: 23.1.50; Please use null-device instead of /dev/null Michael Albinus
2009-07-02 13:03   ` Jason Rumney
2009-07-02 13:57     ` Sven Joachim
2009-07-02 14:14       ` Jason Rumney
2009-07-02 15:10         ` Michael Albinus
2020-11-19  2:31           ` Stefan Kangas
2020-11-19 16:32             ` Michael Albinus
2020-11-21 15:16               ` Michael Albinus
2020-11-26 15:28                 ` Michael Albinus
2020-11-26 16:47                   ` Stefan Kangas
2009-07-02 14:21       ` Lennart Borgman
2009-07-02 15:06     ` Michael Albinus
2009-07-02 18:49   ` Eli Zaretskii
2009-07-01 20:22 Lennart Borgman

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