From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Albinus Subject: Re: Bug: :session doesn't honor :verbatim [8.2.10 (release_8.2.10 @ /usr/local/share/emacs/26.0.50/lisp/org/)] Date: Mon, 17 Apr 2017 09:53:38 +0200 Message-ID: <87tw5neagt.fsf@detlef> References: <877f2kwxmv.fsf@detlef> <878tn0r53m.fsf@tils.net> <87efwsnhzd.fsf@detlef> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d01Tq-0008VF-Lr for emacs-orgmode@gnu.org; Mon, 17 Apr 2017 03:53:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d01Tn-0001jT-K2 for emacs-orgmode@gnu.org; Mon, 17 Apr 2017 03:53:50 -0400 Received: from mout.gmx.net ([212.227.15.19]:50049) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d01Tn-0001ip-95 for emacs-orgmode@gnu.org; Mon, 17 Apr 2017 03:53:47 -0400 In-Reply-To: (Charles C. Berry's message of "Sun, 16 Apr 2017 16:14:03 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Charles C. Berry" Cc: emacs-orgmode@gnu.org, Tilmann Singer "Charles C. Berry" writes: >> However, I don't want to change this globally. Is there an org mean to >> change this locally just for the session? >> >> Maybe the shell prompt could be customizable for a session in ob-sh.el? > > That happens in the shell. You can do this to start your session: > > #+BEGIN_SRC shell :session mysess > PS1="MyPrompt-$ " > #+END_SRC > > #+RESULTS: > > and then tell emacs to locally set `comint-prompt-regexp' to a value > other than what was copied from `shell-prompt-pattern' > > #+BEGIN_SRC emacs-lisp > (save-excursion > (pop-to-buffer "mysess") > (setq-local comint-prompt-regexp "MyPrompt-$ ")) > #+END_SRC > > #+RESULTS: > : MyPrompt-$ > > and then it should work. > > #+BEGIN_SRC shell :session mysess > echo "a%b" > #+END_SRC > > #+RESULTS: > : a%b > > --- > > You might skip the second step and instead set `shell-prompt-pattern' > to "MyPrompt-$ ". If `comint-use-prompt-regexp' is nil, then the > `comint-prompt-regexp' is only consulted by ob-shell.el funs per the > docstring of comint-use-prompt-regexp. Thanks for the examples. Anything goes, of course, but I'm hoping for a tighter integration. Maybe a :prompt param to sh source blocks, which sets the prompt in a session, and which also manipulates `comint-prompt-regexp' or `shell-prompt-pattern' local in the session buffer. Or a mechanism like in Tramp, where the shell prompt is set to a random string not expected in the shell (see `tramp-end-of-output'), and `comint-prompt-regexp' or `shell-prompt-pattern' are adapted automatically local in the session buffer. > Chuck Best regards, Michael.