From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#72778: 31.0.50; Calc: g f doesn't display gnuplot window after closing Date: Mon, 26 Aug 2024 11:32:19 +0530 Message-ID: <87bk1fx1n8.fsf@gmail.com> References: <87ikvqv5a6.fsf@web.de> <87jzg676di.fsf@gmail.com> <86wmk6nzrd.fsf@gnu.org> <87cylxywu1.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9324"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 72778@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 26 08:04:37 2024 Return-path: Envelope-to: geb-bug-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 1siSqC-0002Gl-Pi for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Aug 2024 08:04:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1siSpt-0000M3-2X; Mon, 26 Aug 2024 02:04:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1siSpo-0000Lh-6E for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 02:04:12 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1siSpn-0004ca-FY for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 02:04:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=73YfKCPgd+DlcyAvIF3Oi1zGEB/fijwLDpjgGeu8hn4=; b=m9MkppjufKhmZgEJcRt8cOwFwvNvfizsXBf7BXC5nU8qtffrBLuaAadob57By5Q2EwDLRplJS+c63fL1afvPAEdVUGtICvdxnjStfHy/kmwMsOGcZcqQW8b3EIMfHZy9c180py5mroQAszFM9OzzVHIEKV9YpvOZjo/oaBE8vyoA1gX1l/+0PmmHJY+j6ZldGSOUMSMj8lLE/z9BD8RYBINfq5EcHxALcwXrGperG3pdUjNM5o2bEuvP1ZCp/tXNC4CARgQIBXjUvf7sxXWhJ1UyKjBurn7gvvX0m8k7HQq6SNZ65z6Tnl1F3NoSl1K2pGE0F/VArHX8oFjNQ6ggPw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1siSqb-0000ot-S5 for bug-gnu-emacs@gnu.org; Mon, 26 Aug 2024 02:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Aug 2024 06:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72778 X-GNU-PR-Package: emacs Original-Received: via spool by 72778-submit@debbugs.gnu.org id=B72778.17246522623093 (code B ref 72778); Mon, 26 Aug 2024 06:05:01 +0000 Original-Received: (at 72778) by debbugs.gnu.org; 26 Aug 2024 06:04:22 +0000 Original-Received: from localhost ([127.0.0.1]:43560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1siSpy-0000np-7j for submit@debbugs.gnu.org; Mon, 26 Aug 2024 02:04:22 -0400 Original-Received: from mail-pf1-f194.google.com ([209.85.210.194]:58737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1siSpw-0000nY-IQ for 72778@debbugs.gnu.org; Mon, 26 Aug 2024 02:04:21 -0400 Original-Received: by mail-pf1-f194.google.com with SMTP id d2e1a72fcca58-71431524f33so3323732b3a.1 for <72778@debbugs.gnu.org>; Sun, 25 Aug 2024 23:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724652144; x=1725256944; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=73YfKCPgd+DlcyAvIF3Oi1zGEB/fijwLDpjgGeu8hn4=; b=Nglc2ek9ud2pbD/Osgo16sVfG6bK9K0QXtcLzIvcNKUS0F5CqdPej/LQk07KXmMHv1 ZxBkkpSOgxNpHcUJQJL2oKQxFAnTZnGc36HCq5nnAJiEXKq7YVjkuUmFCchbjn7XID2O JzVPZxCv4QuadSQhvfdrGWDQ5eSlVh15072RAwXS0SmE3wHCOIZ9MFC9AH1la/N31Scm ykcGdKlIZ9dCSKsMpZtqAG+U2I9jz6xJxbb9yYimeA8xXyP/2MWNI0xSfvXYf2Fijff2 U119sTM9uMgGBRFb4Saux9LKqdM1bT5sNINqXI/a4uvzUIK0oVVnQZM8QSAraseq+J2p VFSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724652144; x=1725256944; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=73YfKCPgd+DlcyAvIF3Oi1zGEB/fijwLDpjgGeu8hn4=; b=IgEYfzwzqs1WdGFzJeQXnucPA3CrelJrpuMbU29dJPpwhh9jOPV0tMfR2uURhYf6I1 LS4xLaFLn72Bi1qbvgUYYLFHoT1r8NHVw4iLg/PqYZcdxHT2O9UZg4Q6P5HEVymLYoFy 7OQkJWk+u5KxnjVJZFFj/WcpcIut8jRUHwEtZex5IClWJ1y/0U1uLeezl5dCJioNiofw md+4TSymx7oCJYavtAMKCPZcPwC262/ypXTAlh4grIxXaU9Yo/5sLb5cgqI55vceu++e eGUnd8OC5WS/bA2RD993a4gzmr8wOoMRvrF56kuehsMZeV4cnoxo9TOtfalO7NywID/t uIKw== X-Forwarded-Encrypted: i=1; AJvYcCWrC0B4Nz9ngVR9OL6XivrD0qQOI3iFA6Dkq3nChUM/kqiXGMaDobXr1hLvSEj8v/60Dmcakg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxDBZ6nvbKOT5RBwz5ru7yCCwAGFQqE3DU49gi6+73fLue8yX/l wTmK1KTAqBRWfoefcjZj2B0ifKHdDawmar6xs+UCp+1SDh8NXxG0 X-Google-Smtp-Source: AGHT+IEAei47wErsV1ajIJG4AzZlCYpaigfXXohqmMwTFn+gjjYm4fhjCwDVJAmwO/fCiTd3w5XdWQ== X-Received: by 2002:a05:6a21:e8a:b0:1be:c6f8:c530 with SMTP id adf61e73a8af0-1cc89d7faadmr12227033637.26.1724652143467; Sun, 25 Aug 2024 23:02:23 -0700 (PDT) Original-Received: from localhost ([118.185.152.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-714342732b5sm6594744b3a.92.2024.08.25.23.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 23:02:22 -0700 (PDT) In-Reply-To: <87cylxywu1.fsf@web.de> (Michael Heerdegen's message of "Sun, 25 Aug 2024 07:51:02 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290774 Archived-At: [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=86=E0=AE=95= =E0=AE=B8=E0=AF=8D=E0=AE=9F=E0=AF=8D 25, 2024] Michael Heerdegen wrote: > Eli Zaretskii writes: > >> IME, gnuplot is notorious in changing its non-interactive behavior >> from time to time, which might break the assumptions that Calc makes. >> Suggest to look in the gnuplot's change log to see if they made some >> change in the recent years, maybe this will give some ideas. > > I'm too ignorant to know what to look for. > > Some more data points, though: > > - In *Gnuplot Trail* I see that gnuplot receives the command and emits > a new prompt even when the command is ignored. > > - Executing (calc-gnuplot-command "set term wxt") (be sure that it is > not ignored!) fixes the problem for me. I guess we don't want to do > that. > > - I can't reproduce the issue with a terminal emulator even when > changing the gnuplot terminal to x11 (this is what Emacs uses for its > gnuplot process). > > I don't know much about process communication, excuse me if this is all > irrelevant. I am ignorant about process communication but I was able to reliably make gnuplot open the terminal window every time by sending an extra newline before the plot command. Try M-: (process-send-string (get-buffer-process (current-buffer)) "\nplot = sin(x)\n") RET in the *Gnuplot Trail* buffer. If you kill the gnuplot terminal window, and reeval the same sexp, it opens again. A na=C3=AFve fix employing this method would be diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index fb817b1bc3d..7b1ebc9f603 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -1417,7 +1417,7 @@ calc-gnuplot-command "Send ARGS to Gnuplot. Returns nil if Gnuplot signaled an error." (calc-graph-init) - (let ((cmd (concat (mapconcat 'identity args " ") "\n"))) + (let ((cmd (concat "\n" (mapconcat 'identity args " ") "\n"))) (or (calc-graph-w32-p) (accept-process-output)) (with-current-buffer calc-gnuplot-buffer But it would be better if someone can explain why we require this newline before CMD too.