From: Jim Porter <jporterbugs@gmail.com>
To: 51426@debbugs.gnu.org, michael.albinus@gmx.de
Subject: bug#51426: 29.0.50; [PATCH] Should 'comint-term-environment' be connection-aware?
Date: Thu, 28 Oct 2021 22:26:31 -0700 [thread overview]
Message-ID: <5cbecece-e982-6362-9eac-1610f00f4929@gmail.com> (raw)
In-Reply-To: <878rydxfgl.fsf@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]
On 10/28/2021 9:48 AM, Michael Albinus wrote:
> What I'm curious about is whether we shall give more guidance using this
> feature. The majority of the users don't know connection-local
> variables, your example from the initial message might be instructive
> for them.
>
> WDYT?
Sure, that seems like a good idea. I expanded the example in the section
on "Per-Connection Local Variables" to show setting
`system-uses-terminfo'. Hopefully this will point people in the right
direction, and make it more apparent that
`connection-local-set-profiles' lets you set multiple profiles for a
connection, not just one. (That's documented in the Emacs Lisp manual,
but I think it would be helpful to show it in the Emacs manual as well.)
Perhaps it would make sense to mention this in the Tramp manual too,
such as under the section "Running shell on a remote host". On the other
hand, setting `system-uses-terminfo' connection-locally only applies to
Emacs 29+, so it might make that section more confusing to include it
there. People might expect it to work on older versions of Emacs as well.
[-- Attachment #2: 0001-Expand-the-documentation-for-connection-local-variab.patch --]
[-- Type: text/plain, Size: 2673 bytes --]
From b2ca1c7884790886142af12115c5fc5c20979a25 Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Thu, 28 Oct 2021 22:14:07 -0700
Subject: [PATCH] Expand the documentation for connection local variables
* doc/emacs/custom.texi (Per-Connection Local Variables): Expand the
example to include setting 'system-uses-terminfo'.
---
doc/emacs/custom.texi | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index eb30a6acc5..a158631825 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1474,9 +1474,10 @@ Connection Variables
Most of the variables reflect the situation on the local machine.
Often, they must use a different value when you operate in buffers
-with a remote default directory. Think about the shell to be applied
-when calling @code{shell} -- it might be @file{/bin/bash} on your
-local machine, and @file{/bin/ksh} on a remote machine.
+with a remote default directory. Think about the behavior when
+calling @code{shell} -- on your local machine, you might use
+@file{/bin/bash} and rely on termcap, but on a remote machine, it may
+be @file{/bin/ksh} and terminfo.
This can be accomplished with @dfn{connection-local variables}.
Directory and file local variables override connection-local
@@ -1492,6 +1493,9 @@ Connection Variables
criteria, identifying a remote machine:
@example
+(connection-local-set-profile-variables 'remote-terminfo
+ '((system-uses-terminfo . t)))
+
(connection-local-set-profile-variables 'remote-ksh
'((shell-file-name . "/bin/ksh")
(shell-command-switch . "-c")))
@@ -1501,13 +1505,15 @@ Connection Variables
(shell-command-switch . "-c")))
(connection-local-set-profiles
- '(:application tramp :machine "remotemachine") 'remote-ksh)
+ '(:application tramp :machine "remotemachine")
+ 'remote-terminfo 'remote-ksh)
@end example
- This code declares two different profiles, @code{remote-ksh} and
-@code{remote-bash}. The profile @code{remote-ksh} is applied to all
+ This code declares three different profiles, @code{remote-terminfo},
+@code{remote-ksh}, and @code{remote-bash}. The profiles
+@code{remote-terminfo} and @code{remote-ksh} are applied to all
buffers which have a remote default directory matching the regexp
-@code{"remotemachine} as host name. Such a criteria can also
+@code{"remotemachine"} as host name. Such a criteria can also
discriminate for the properties @code{:protocol} (this is the Tramp
method) or @code{:user} (a remote user name). The @code{nil} criteria
matches all buffers with a remote default directory.
--
2.25.1
next prev parent reply other threads:[~2021-10-29 5:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 22:54 bug#51426: 29.0.50; [PATCH] Should 'comint-term-environment' be connection-aware? Jim Porter
2021-10-27 8:20 ` Michael Albinus
2021-10-28 0:45 ` Jim Porter
2021-10-28 8:02 ` Michael Albinus
2021-10-28 15:49 ` Jim Porter
2021-10-28 16:48 ` Michael Albinus
2021-10-29 5:26 ` Jim Porter [this message]
2021-10-29 8:21 ` Michael Albinus
2021-10-29 16:39 ` Jim Porter
2021-10-30 15:43 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5cbecece-e982-6362-9eac-1610f00f4929@gmail.com \
--to=jporterbugs@gmail.com \
--cc=51426@debbugs.gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).