From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Open multiple separate terminal buffers with multi-term in Emacs. Date: Mon, 15 Nov 2021 02:37:40 -0500 Message-ID: <87a6i5c1iz.fsf@gnuvola.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35625"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: help-gnu-emacs To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 15 08:39:36 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmWaV-00092I-5I for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 15 Nov 2021 08:39:36 +0100 Original-Received: from localhost ([::1]:41520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmWaT-0000Ol-8H for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 15 Nov 2021 02:39:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmWZ1-0000Oc-R3 for help-gnu-emacs@gnu.org; Mon, 15 Nov 2021 02:38:03 -0500 Original-Received: from delivery.mailspamprotection.com ([146.66.122.10]:58931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmWYv-0004QM-Sf for help-gnu-emacs@gnu.org; Mon, 15 Nov 2021 02:38:03 -0500 Original-Received: from 241.110.209.35.bc.googleusercontent.com ([35.209.110.241] helo=giow1035.siteground.us) by se25.mailspamprotection.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1mmWYp-0007LJ-Mb; Mon, 15 Nov 2021 01:37:54 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnuvola.org ; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ySjhK+k/GwUiwPqow0EZPcl+B1HpZTA9TmZ91lkmoZ8=; b=Crg/ivtwNuQFXpeL+MEwcdyYdQ Beb7LqD8ZlANl5aFxf9UawKTNh9LRj4mCrI2vSzmCOWcJBgNQrGC5Bu7MbrpWZ+svRYYlniBdqLUO Mhfto+D5DbSwvHMgAOEsqLQa1NQn2bX7asFTWf5LF9KLUh3/ISwKj1GYQDRJ/6P2kHDQ=; Original-Received: from [50.89.166.226] (port=40982 helo=abolire) by giow1035.siteground.us with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.90-.1) (envelope-from ) id 1mmWYp-000IIw-5W; Mon, 15 Nov 2021 07:37:51 +0000 In-Reply-To: (Hongyi Zhao's message of "Wed, 2 Jun 2021 09:38:42 +0800") X-Originating-IP: 35.209.110.241 X-SpamExperts-Domain: giow1035.siteground.us X-SpamExperts-Username: 35.209.110.241 Authentication-Results: mailspamprotection.com; auth=pass smtp.auth=35.209.110.241@giow1035.siteground.us X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.30) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT/4uAxu76UMw9YLv/x/xGH7PUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5yFxTiM0+JL8AduhP3LugoyJf62BJtE0fskIiXxk321KJo4 UO1ObgXTcNQ2iSs4ce7b97PFwL9ZdIDN6dO51iWS1VxjV7AVAOdf64t1htxiACTg127TqHZDxA/k ZB41Rh/17sxadddDOquHzUKfRLUg5ZuxPE4nrdt31pd1IZUzuCnqpLrfsBGIRuxo06afmLx5xBHk CMCjMposz65/e+f6YBf7/a8NBk5QBVKzqmoHK99E/X2MV36bmjSFn96hE42eAmsbxaASo9pF/rVY T5ZBGvxIDa8U6mGWnxS58HyAGIH8dkRkFi5XTKWKzjwdbpCb662/rVKGbaZ5TUU0LhsTOW7drtNP hnIZj8TJ4YYjwLYgV1Knkmc8cv1rhi84unIC2GO2HS/YYsU5tOt2STC/asuExWjuzmsL+LXEDqfC 8bwqyT5p50x81ZKcmzCu2U1DxyV916q4OdFmRPL5yfH7DN6+8DsCup5AUR3adq+ACac68vxnyc5t 8TMLFGCIMyabtFWEMLqsZqM85AyyKVDKBkiY9v1Rlez6jmoRl5GlOLcFP/Fxqx7uULDQRB3NLRCz XTDuQD6Wo+v7yEuTZVqRIAhBw2aBusD1DcxzR396fUU0lgR429Y/qzlQ1hsGBy3gb/JvSWqNrnYy +yuCPysSw2FzLa3s4qLQYL0BD6khV8HSxgblGwjLEviZyKdX/r7TPpuFqUUQz+mM8JAD4ECWcNPy xY8mw0IvQTHuXY7/m0Wyim657WT+6 X-Report-Abuse-To: spam@quarantine1.mailspamprotection.com Received-SPF: pass client-ip=146.66.122.10; envelope-from=ttn@gnuvola.org; helo=delivery.mailspamprotection.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134601 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain () Hongyi Zhao () Wed, 2 Jun 2021 09:38:42 +0800 According to the tricks mentioned here, [...] I installed the following packages [...] Any hints for this problem will be highly appreciated. I like to keep things simple. Please find attached multi-shell.el, which has worked fine for me for many years. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=multi-shell.el Content-Transfer-Encoding: quoted-printable ;;; multi-shell.el -*- lexical-binding: t = -*- ;;; ;;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, ;;; 2004, 2007, 2008 Thien-Thi Nguyen ;;; ;;; This file is part of ttn's personal elisp library, released under ;;; the terms of the GNU General Public License as published by the ;;; Free Software Foundation; either version 3, or (at your option) any ;;; later version. There is NO WARRANTY. See file COPYING for details. ;;; Description: Modification of ``shell'' allows multiple shells w/ prefix. (require 'comint) (require 'shell) (defvar multi-shell-hist-d (expand-file-name "multi-shell-history" user-emacs-directory) "Directory where `multi-shell' maintains shell history files.") ;;;###autoload (defun multi-shell (n) "Do `shell', naming buffer based on N, a small integer (prefix arg). The shell's history is taken from the file named N in `multi-shell-hist-d', which will be created (along with parent dirs) if necessary. See documention for `shell'." (interactive "p") (let* ((shell-name (format "shell %s" n)) (buf-name (concat "*" shell-name "*"))) (unless (comint-check-proc buf-name) (let* ((prog (or (getenv "ESHELL") (getenv "SHELL") "/bin/sh")) (histfile (expand-file-name (number-to-string n) multi-shell-hist-d)) (process-environment (cons (format "HISTFILE=3D%s" (expand-file-name histfile)) process-environment)) (name (file-name-nondirectory prog)) (startfile (concat "~/.emacs_" name)) (xargs-name (intern-soft (concat "explicit-" name "-args")))) (make-directory (file-name-directory histfile) t) (set-buffer (apply 'make-comint shell-name prog (when (file-exists-p startfile) startfile) (if (and xargs-name (boundp xargs-name)) (symbol-value xargs-name) '("-i")))) (shell-mode))) (switch-to-buffer buf-name))) (defun multi-shell-grep-history (regexp) "In `multi-shell-hist-d', do `grep' on REGEXP." (interactive "sRegexp: ") (let ((default-directory (file-name-as-directory multi-shell-hist-d))) (grep (format "grep -nH -e %s *" (shell-quote-argument regexp))))) (provide 'multi-shell) ;;; multi-shell.el ends here --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Personally, i globally bind =E2=80=98C-x s=E2=80=99 to =E2=80=98multi-shell= =E2=80=99, then it's a matter of =E2=80=98C-x s=E2=80=99 or =E2=80=98M-3 C-x s=E2=80=99 or whate= ver to get the Nth shell. =2D-=20 Thien-Thi Nguyen ----------------------------------------------- (defun responsep (query) ; (2021) Software Libero (pcase (context query) ; =3D Dissenso Etico (`(technical ,ml) (correctp ml)) ...)) 748E A0E8 1CB8 A748 9BFA =2D-------------------------------------- 6CE4 6703 2224 4C80 7502 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iG4EARECAC4WIQR0jqDoHLinSJv6bORnAyIkTIB1AgUCYZIORhAcdHRuQGdudXZv bGEub3JnAAoJEGcDIiRMgHUCA/sAn0cM11Ffs15O7lw0Q19UyF71LeWGAJ948/Sp 6QPemPBEGNmuuB3nvyHY7w== =zqid -----END PGP SIGNATURE----- --==-=-=--