unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 861ac933dd8: Run `man' also on remote systems
       [not found] ` <20231101155445.B09E0C0C180@vcs2.savannah.gnu.org>
@ 2023-11-01 18:10   ` Eshel Yaron
  2023-11-01 20:13     ` Emanuel Berg
  2023-11-02 11:21     ` Michael Albinus
  0 siblings, 2 replies; 7+ messages in thread
From: Eshel Yaron @ 2023-11-01 18:10 UTC (permalink / raw)
  To: emacs-devel; +Cc: Michael Albinus

Hello Michael,

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

> branch: master
> commit 861ac933dd8aed1028edc4b9142400e3702874d5
> Author: Michael Albinus <michael.albinus@gmx.de>
> Commit: Michael Albinus <michael.albinus@gmx.de>
>
>     Run `man' also on remote systems

Thanks for implementing this, I just found myself wishing `M-x man`
would run on the remote host a few days ago.  This works well now!

I have a couple of suggestions around the new documentation:

> +*** New user option 'Man-support-remote-systems'.
> +If the user option 'Man-support-remote-systems' is non-nil, and
> +'default-directory' indicates a remote system, the man page is taken
> +from the remote system.  Calling the 'man' command with a prefix like
> +'C-u M-x man' reverts the value of 'Man-support-remote-systems' for
> +that call.

I think specifying the name of the option again is redundant, and
mentioning `default-directory` gets a bit too much into the
implementation details.  So I'd say instead:

    This option controls whether 'M-x man' executes the "man" command on
    a remote system when the current buffer is remote.  You can invoke
    the 'man' command with a prefix argument to reverse the value of
    this option only for the current invocation.
    
> +(defun Man-header-file-path ()
> +  "C Header file search path used in Man.
> +In the local case, it is the value of `Man-header-file-path'.
> +Otherwise, it will be checked on the remote system."

Here I'd suggest:

    Return the C header file search path that Man uses.
    Normally, this is the value of the user option
    `Man-header-file-path', but when executing "man" on a remote system
    this function tries to find the C header path on that system.
    
> +If `default-directory' is remote, and `Man-support-remote-systems'
> +is non-nil, the man page will be formatted on the corresponding
> +remote system.
> +
> +If `man' is called interactively with a prefix argument, the
> +value of `Man-support-remote-systems' is reverted."

Here it would be slightly clearer to use the active voice IMO, namely:

    If `default-directory' is remote, and `Man-support-remote-systems'
    is non-nil, this command formats the man page on the remote system.
    A prefix argument reverses the value of `Man-support-remote-systems'
    for the current call.

I'm would also consider changing the name of the new user option from
`Man-support-remote-systems' to `Man-execute-on-remote-systems', since
to me that better conveys the choice you make by setting this option.


Best,

Eshel



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

* Re: master 861ac933dd8: Run `man' also on remote systems
  2023-11-01 18:10   ` master 861ac933dd8: Run `man' also on remote systems Eshel Yaron
@ 2023-11-01 20:13     ` Emanuel Berg
  2023-11-02  6:16       ` Eli Zaretskii
  2023-11-02 11:21     ` Michael Albinus
  1 sibling, 1 reply; 7+ messages in thread
From: Emanuel Berg @ 2023-11-01 20:13 UTC (permalink / raw)
  To: emacs-devel

Eshel Yaron wrote:

>> branch: master
>> commit 861ac933dd8aed1028edc4b9142400e3702874d5
>> Author: Michael Albinus <michael.albinus@gmx.de>
>> Commit: Michael Albinus <michael.albinus@gmx.de>
>>
>>     Run `man' also on remote systems
>
> Thanks for implementing this, I just found myself wishing
> `M-x man` would run on the remote host a few days ago.
> This works well now!

I upgraded just now to

  GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo
  version 1.16.0) of 2023-11-01 [commit
  8eb9b82ce58a8323af21f52625a401e19e279a9c]

but don't get it to work. After using the below settings and
command to get to a file on an OpenBSD system and do, from
that buffer,

  M-x man RET ls RET

I get the GNU ls(1) manpage, not the OpenBSD one.

Maybe it is supposed to work some other way?

;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/tramp-incal.el

(require 'tramp)
(require 'tramp-sh)

(setq tramp-histfile-override nil)

(add-to-list 'tramp-methods
  '("sunos-ssh"
    (tramp-login-program       "ssh")
    (tramp-login-args        (("-l" "%u")
                              ("-p" "%p")
                              ("%c")
                              ("-e" "none")
                              ("-t" "-t")
                              ("%h")
                              ("\"/bin/sh -i\"") ))
    (tramp-async-args        (("-q")))
    (tramp-remote-shell        "/bin/sh")
    (tramp-remote-shell-login ("-l"))
    (tramp-remote-shell-args  ("-c")) ))

;; OpenBSD system:
;; (find-file "/-:incal@srv.dataswamp.org:public_html/sth/sth.py")

(provide 'tramp-incal)

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




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

* Re: master 861ac933dd8: Run `man' also on remote systems
  2023-11-01 20:13     ` Emanuel Berg
@ 2023-11-02  6:16       ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2023-11-02  6:16 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: emacs-devel

> From: Emanuel Berg <incal@dataswamp.org>
> Date: Wed, 01 Nov 2023 21:13:27 +0100
> 
> I upgraded just now to
> 
>   GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo
>   version 1.16.0) of 2023-11-01 [commit
>   8eb9b82ce58a8323af21f52625a401e19e279a9c]
> 
> but don't get it to work. After using the below settings and
> command to get to a file on an OpenBSD system and do, from
> that buffer,
> 
>   M-x man RET ls RET
> 
> I get the GNU ls(1) manpage, not the OpenBSD one.

Please report bugs using "M-x report-emacs-bug", which will send the
report to the bug tracker.  Posting bug reports here is not TRT, and
we discourage it.

Thanks.



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

* Re: master 861ac933dd8: Run `man' also on remote systems
  2023-11-01 18:10   ` master 861ac933dd8: Run `man' also on remote systems Eshel Yaron
  2023-11-01 20:13     ` Emanuel Berg
@ 2023-11-02 11:21     ` Michael Albinus
  2023-11-02 11:43       ` Emanuel Berg
  2023-11-02 11:55       ` Eshel Yaron
  1 sibling, 2 replies; 7+ messages in thread
From: Michael Albinus @ 2023-11-02 11:21 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: emacs-devel

Eshel Yaron <me@eshelyaron.com> writes:

> Hello Michael,

Hi Eshel,

> I have a couple of suggestions around the new documentation:

I'm norious bad with documentation, much appreciated!

I have pushed your proposals to master with the modification, that it
doesn't speak about *execution* of the man program on the remote
system. Not all Tramp backends support remote processes, so we cannot
let run man there. Instead, for such use cases, I plan to implement a
local copy of the man page from the remote system, and let run "man -l
<local copy>" then.

> I'm would also consider changing the name of the new user option from
> `Man-support-remote-systems' to `Man-execute-on-remote-systems', since
> to me that better conveys the choice you make by setting this option.

For the very same reason I haven't applied this change. But of course,
I'm open to any better name for `Man-support-remote-systems'.

> Best,
>
> Eshel

Best regards, Michael.



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

* Re: master 861ac933dd8: Run `man' also on remote systems
  2023-11-02 11:21     ` Michael Albinus
@ 2023-11-02 11:43       ` Emanuel Berg
  2023-11-02 11:55       ` Eshel Yaron
  1 sibling, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2023-11-02 11:43 UTC (permalink / raw)
  To: emacs-devel

Michael Albinus wrote:

>> I'm would also consider changing the name of the new user
>> option from `Man-support-remote-systems' to
>> `Man-execute-on-remote-systems', since to me that better
>> conveys the choice you make by setting this option.
>
> For the very same reason I haven't applied this change.
> But of course, I'm open to any better name for
> `Man-support-remote-systems'.

I got it to work, you have to set
`Man-support-remote-systems':

  (setq Man-support-remote-systems t)

\o/

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




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

* Re: master 861ac933dd8: Run `man' also on remote systems
  2023-11-02 11:21     ` Michael Albinus
  2023-11-02 11:43       ` Emanuel Berg
@ 2023-11-02 11:55       ` Eshel Yaron
  2023-11-02 13:51         ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Eshel Yaron @ 2023-11-02 11:55 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

> I have pushed your proposals to master with the modification, that it
> doesn't speak about *execution* of the man program on the remote
> system. Not all Tramp backends support remote processes, so we cannot
> let run man there. Instead, for such use cases, I plan to implement a
> local copy of the man page from the remote system, and let run "man -l
> <local copy>" then.

I see, that makes sense.  So ISTM that what the new option essentially
does is to control whether or not Emacs renders remote man pages, versus
only rendering pages found on the local system.  Is that a correct
description?

>> I'm would also consider changing the name of the new user option from
>> `Man-support-remote-systems' to `Man-execute-on-remote-systems', since
>> to me that better conveys the choice you make by setting this option.
>
> For the very same reason I haven't applied this change. But of course,
> I'm open to any better name for `Man-support-remote-systems'.

How about `Man-render-remote-manpage`, or `Man-use-remote-manpage`?



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

* Re: master 861ac933dd8: Run `man' also on remote systems
  2023-11-02 11:55       ` Eshel Yaron
@ 2023-11-02 13:51         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2023-11-02 13:51 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: michael.albinus, emacs-devel

> From: Eshel Yaron <me@eshelyaron.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 02 Nov 2023 12:55:03 +0100
> 
> > For the very same reason I haven't applied this change. But of course,
> > I'm open to any better name for `Man-support-remote-systems'.
> 
> How about `Man-render-remote-manpage`, or `Man-use-remote-manpage`?

Isn't it true that not only the man pages come from the remote system,
but also the 'man' program is invoked on the remote system?  If it's
true, then "remote-manpage" should not be part of the name.



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

end of thread, other threads:[~2023-11-02 13:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <169885408539.20142.2201339795070761011@vcs2.savannah.gnu.org>
     [not found] ` <20231101155445.B09E0C0C180@vcs2.savannah.gnu.org>
2023-11-01 18:10   ` master 861ac933dd8: Run `man' also on remote systems Eshel Yaron
2023-11-01 20:13     ` Emanuel Berg
2023-11-02  6:16       ` Eli Zaretskii
2023-11-02 11:21     ` Michael Albinus
2023-11-02 11:43       ` Emanuel Berg
2023-11-02 11:55       ` Eshel Yaron
2023-11-02 13:51         ` Eli Zaretskii

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