From debbugs-submit-bounces@debbugs.gnu.org Wed May 01 18:50:14 2024 Received: (at submit) by debbugs.gnu.org; 1 May 2024 22:50:14 +0000 Received: from localhost ([127.0.0.1]:39878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2ImE-000538-Dp for submit@debbugs.gnu.org; Wed, 01 May 2024 18:50:14 -0400 Received: from lists.gnu.org ([2001:470:142::17]:46340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2ImB-000532-Ld for submit@debbugs.gnu.org; Wed, 01 May 2024 18:50:12 -0400 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 1s2Ilk-0001Jb-68 for bug-gnu-emacs@gnu.org; Wed, 01 May 2024 18:49:44 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2Ili-0004qr-F5 for bug-gnu-emacs@gnu.org; Wed, 01 May 2024 18:49:43 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-572a93890d1so1652875a12.3 for ; Wed, 01 May 2024 15:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714603781; x=1715208581; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=SihBBAxVxhTzbPFFe3EYQXRBZaZzLj3kXgMOwtXaAfs=; b=C4dIVFOWfB5aPuYYUwGGRuLH0q896f27HksRPV9gkW7r3B2f1uHGIvjvxTWNbhJNBO nqmIz4jWYCaUsNCO6mZoqhmJhNhEmcFIXEEO3Bpmz72KeJmrSJMOG5728zbnbapJ2IE+ jGveuhrcaTUQBcjHCpui5RconVsZir+R2YL+ovsPJ97DlJLrAojgf9gxGhZpmRkHzCFb 7HJLNZxB7CGwgY9aA8kT+Rlp3in0H8kB4XovyDjrL7JnjBcPoA4ggwNKrAOMdSR5goj3 4bO6V9DHQFZVhHElyBsHL6Pv5z9S5zi588oW0LEjiA0Z7f0fLFQPRT+F03BAMw0EOleR LTgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714603781; x=1715208581; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SihBBAxVxhTzbPFFe3EYQXRBZaZzLj3kXgMOwtXaAfs=; b=dgk79+msF4ZLIBPcoWxOjdi1Q2UeNDyEBBM+fm8S8sM/b3Uw0fFR71i/XGeabo3YCN WNdt9ym5U5HTsmXXOU0h4npDHIiP9aLtLhV22xwIM97gvf9WlAGwWYm7Ac9wIoYmNzbe nmv6QFmCft6Vw8t3zSlxihP16KXdPJoQBc7XSI3rUpLIhiZTOHRWFZMp/4NwAaqDbnSo RvT8NumSWa88y1Ok2t5P78tXOX5xd/JsfR5MewiESxcl9YrzLcB26hMtlMGGPPixuCat JWw12YJVVqHWLR5d7YJ6EQ9J886vd6u1sdIUvLiGJgl4TjDH4r4enBgrp84n27pJ8Dv3 Qifw== X-Gm-Message-State: AOJu0Yw4qr56u3I5FMnx+diibEC4lfzfBZapgN0dGExjppygzdvaxWyL RzJT0iQuf92XGAyDJQNzcGNuijKcznZLgQkv5e0RuRNd6cjzocNQUiZ0vhmBcPp1n4z1MM2+B5W e9fWfCub4DJW5+17bJmopQ1FHOmwNsG/O X-Google-Smtp-Source: AGHT+IEz7ddEeasuiVf4LT7fmpYZp+MCXiVDhwuzEQZ6kz6GvjaWP5Ekx+NX8X0FBlkCXn5rvC570UvIlCToeop8zDs= X-Received: by 2002:a50:9ee2:0:b0:56d:fb36:c388 with SMTP id a89-20020a509ee2000000b0056dfb36c388mr331051edf.9.1714603780601; Wed, 01 May 2024 15:49:40 -0700 (PDT) MIME-Version: 1.0 From: Lin Sun Date: Wed, 1 May 2024 22:49:29 +0000 Message-ID: Subject: 30.0.50; [PATCH] ; Check the process param in function (python-shell-completion-at-point) To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary="0000000000004630cf06176c4d6a" Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=sunlin7.mail@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --0000000000004630cf06176c4d6a Content-Type: text/plain; charset="UTF-8" Hi, There is an unexpected error message happening with function `python-shell-completion-at-point`. > Wrong type argument: processp, nil It happened because the function does NOT check the process param. The patch will check the param and display a user error message gracefully. Steps to reproduce the issue. 1. $ emacs -q /tmp/a.py # start emacs and open a python source file 2. type "C-c C-p" (or M-x run-python) to start a python shell 3. type exit() to stop the python process but the buffer still exists 4. M-x python-shell-completion-at-point will get the error message Please help review the patch. Thanks. Regards --0000000000004630cf06176c4d6a Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Check-the-process-param-in-function-python-shell-com.patch" Content-Disposition: attachment; filename="0001-Check-the-process-param-in-function-python-shell-com.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lvoesrqy0 RnJvbSBhYTQ0Yzk1YzdmMTNmMmQ2OGJlODMyNjBlNjE4Y2Y0ZDgwNmIzMTNiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW4gU3VuIDxzdW5saW43QGhvdG1haWwuY29tPgpEYXRlOiBX ZWQsIDEgTWF5IDIwMjQgMDY6NTU6MzEgKzAwMDAKU3ViamVjdDogW1BBVENIXSA7IENoZWNrIHRo ZSBwcm9jZXNzIHBhcmFtIGluIGZ1bmN0aW9uCiAocHl0aG9uLXNoZWxsLWNvbXBsZXRpb24tYXQt cG9pbnQpCgoqIGxpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCAocHl0aG9uLXNoZWxsLWNvbXBsZXRp b24tYXQtcG9pbnQpOgogIENoZWNrIHRoZSBwcm9jZXNzIHBhcmFtIGF0IHRoZSBiZWdpbm5pbmcg b2YgdGhlIGZ1bmN0aW9uLgotLS0KIGxpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCB8IDIgKysKIDEg ZmlsZSBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKykKCmRpZmYgLS1naXQgYS9saXNwL3Byb2dtb2Rl cy9weXRob24uZWwgYi9saXNwL3Byb2dtb2Rlcy9weXRob24uZWwKaW5kZXggZDZjMjllNWZmYy4u NGIyZTJmODIxNSAxMDA2NDQKLS0tIGEvbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVsCisrKyBiL2xp c3AvcHJvZ21vZGVzL3B5dGhvbi5lbApAQCAtNDcwOCw2ICs0NzA4LDggQEAgcHl0aG9uLXNoZWxs LWNvbXBsZXRpb24tYXQtcG9pbnQKIE9wdGlvbmFsIGFyZ3VtZW50IFBST0NFU1MgZm9yY2VzIGNv bXBsZXRpb25zIHRvIGJlIHJldHJpZXZlZAogdXNpbmcgdGhhdCBvbmUgaW5zdGVhZCBvZiBjdXJy ZW50IGJ1ZmZlcidzIHByb2Nlc3MuIgogICAoc2V0cSBwcm9jZXNzIChvciBwcm9jZXNzIChnZXQt YnVmZmVyLXByb2Nlc3MgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAodW5sZXNzIHByb2Nlc3MKKyAg ICAodXNlci1lcnJvciAiTm8gYWN0aXZlIHB5dGhvbiBpbmZlcmlvciBwcm9jZXNzIikpCiAgIChs ZXQqICgoaXMtc2hlbGwtYnVmZmVyIChkZXJpdmVkLW1vZGUtcCAnaW5mZXJpb3ItcHl0aG9uLW1v ZGUpKQogICAgICAgICAgKGxpbmUtc3RhcnQgKGlmIGlzLXNoZWxsLWJ1ZmZlcgogICAgICAgICAg ICAgICAgICAgICAgICAgIDs7IFdvcmtpbmcgb24gYSBzaGVsbCBidWZmZXI6IHVzZSBwcm9tcHQg ZW5kLgotLSAKMi4yMC41Cgo= --0000000000004630cf06176c4d6a-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 02 11:36:54 2024 Received: (at 70707) by debbugs.gnu.org; 2 May 2024 15:36:54 +0000 Received: from localhost ([127.0.0.1]:44441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2YUP-0007Lo-Rm for submit@debbugs.gnu.org; Thu, 02 May 2024 11:36:54 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:51454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2YUN-0007Lg-34 for 70707@debbugs.gnu.org; Thu, 02 May 2024 11:36:53 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a51a7d4466bso913430166b.2 for <70707@debbugs.gnu.org>; Thu, 02 May 2024 08:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714664183; x=1715268983; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=wPt7wbOjWBtjneAa12cxNNy86BUv8MJrqsrrGH0yDgQ=; b=ClmQul//QZSwxMwCSsmxjuo60DowVO9d8j8ynRqQ3uyDRmo4LK1VMHTGEYNkbxNL+m j2Bel3gWcdi3OIue8+AqF4laXF6GdNiXSd1Or+0eFeGOdA7Xnao8vtEmBgbPnaYZemAq 50WSjAjhzutQnS4w/9xEZNJGaDnx1Zsa5L4u8aKf0ggbY+iRRm1UQLBg+/kcuQRFU0Nn 4vEiJCehV85VpRlmDCAq8zCZLDX/WMOchxUbCIuwAgqU2xiPGG773yfPJc5hNYFx6XnX zw6R7wz97tBemP04cWyLHkMR9N2IgPGtmlvuUkJfe03CmnIlSGeefBx3sJuHV2A7u0To carA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714664183; x=1715268983; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wPt7wbOjWBtjneAa12cxNNy86BUv8MJrqsrrGH0yDgQ=; b=jNA/inDnUxu86PoB3PSEMsWiY/iZrQE0mqyAioKfsmAPbDStU41+01hyf3pJyCAaNY fz+/SFz4ouKDiKadzvr0ihRUcLRBl9eh61ovZmdQxOzdEUt6m3RQN4jGGKl6KjMKoNtT tNsGQPEDKBouHAzjy7R8/kdT1UnkexhvLUFkJFOxSj5H3/nyU+86kp4Z1rXND4LUg8jc r99n6zmkRMkiaRZFqiDRPZYP/27HslIsoe3KLoGvQJyFjwXS8v3n+nSPvk68Cdr7Kglx UVfAnP9p6+yQiq1Dpnk1NLz0d1QRBoclTgiZU+kSZxesZ4rmyomzx/BPHWlyA8vrSa9g arrg== X-Gm-Message-State: AOJu0YzwhBTcGH8/RPxk2ww/vV2Vprqlj7WBsTogWUmJSWY1OcCztn8n kJ9jOXmfi4HNi7epB0ggf+Me7vTLQ2r/Gs6PNBST7qk12sMOhVakcDwun7bDrvNNFeSf/0V5XB8 sAaknRouL5LjTUN90srxn8YpYL016QvuF X-Google-Smtp-Source: AGHT+IFcBAY7onI0TqDEJaWhAGXazaVWKIucaeplp2Xxb873/52KZrFFjmP5LdxaRRyQcatXaeXbYaq2C9LJAitLAxM= X-Received: by 2002:a50:d741:0:b0:570:1ea8:c50a with SMTP id i1-20020a50d741000000b005701ea8c50amr4463242edj.6.1714664182931; Thu, 02 May 2024 08:36:22 -0700 (PDT) MIME-Version: 1.0 From: Lin Sun Date: Thu, 2 May 2024 15:36:12 +0000 Message-ID: Subject: bug#70707: 30.0.50; [PATCH] ; Check the process param in function (python-shell-completion-at-point) To: 70707@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70707 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Correction for step 4: 4. Switch to *python* buffer, then M-x python-shell-completion-at-point will get the error message From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 20:45:35 2024 Received: (at 70707) by debbugs.gnu.org; 6 May 2024 00:45:35 +0000 Received: from localhost ([127.0.0.1]:34464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3mU3-0001K2-8D for submit@debbugs.gnu.org; Sun, 05 May 2024 20:45:35 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:55675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3mTy-0001Ju-Tn for 70707@debbugs.gnu.org; Sun, 05 May 2024 20:45:34 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-51aa6a8e49aso1877779e87.3 for <70707@debbugs.gnu.org>; Sun, 05 May 2024 17:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714956301; x=1715561101; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=d6+sdD4roN3AZjFcTt3vMiraJGImsw3k/HJEziC6laY=; b=V006gwfRg/pDc5WGCkhsb7QNVRFNnq1P/JIAuLbZU0InofLNmDyzSkqU/8npBnQdRn jcAuc5ANT6GPRTMmb50MVj6aRb0YJac/cVvkz62S8eO4M5BARFspcYVHwbhDzgQcS1Vm F5gy0pGk6FFjHr7+Liohvt2DaZ3VBKg44yqpu0LoOhJAsyvDRBwioFrXXYAkJclFHuzH qNg9JVlHgOVFGzemtW/o1nGXOdf4gvb4b7CGyrHcucjcSk1ylnte8s2Qyaq9W0kUfVlX 7mpR2cszw3f2e/HXZ/n1ob+03YKCrDeblqMq1MvbUwDPQp3VR0SQpwrv2v7pPgoIbTuX +jDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714956301; x=1715561101; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d6+sdD4roN3AZjFcTt3vMiraJGImsw3k/HJEziC6laY=; b=Jxtc3FYT3H1n/czw26NIP3J1QpPQlRTyJpWeQzSBkluo4KzEa9HbM/logEkBl/S7RD ez2UP9pra3cCSjbGZYDrAuB7CtRT9a2+gqJxao4qkBCqWVYf08vEg/vUXUpyQXnB33jM VBo5/WMBxtaSECEMwXDfdrvghm2qZ2fAHPCtvliWmGMUI24JtOngRotslysq3gQakLC+ KibH/pkDsc5ncZsyxcBQy7hEVF+yyjzZd8qSvZ/gyDNFyWLnVx2cXXO0umxEssTHMITw KqCB7GkB90pG/XKebL9jOHw8aKpV95MjSp0YPYiz00reVgfikgvP9uo3jSItcEzD7eK+ T5Xw== X-Gm-Message-State: AOJu0YwLJ+O6mYt38mk8we+NihfBXtXarelPT9uP1rTL7gfaJ0x/TXgB C/cBGefDj6INmCsQglpRBu8ISOGFC4e51MqtJF+WpndWiBxwVjQpst/4nBHPojfJCmh+a4tyaju 9+BQhxFWejdXLzRcnah3QSgGbPanAkcap X-Google-Smtp-Source: AGHT+IHXO6Gf/7MZeZytetBZYZWxrUARkWLCLSwGc6VBRmEfYzDISa9W5KUeLEI+RCWKuHU5j56qkwXA9Cnl18bv4go= X-Received: by 2002:ac2:5dd3:0:b0:519:33a5:973e with SMTP id x19-20020ac25dd3000000b0051933a5973emr5177809lfq.6.1714956300538; Sun, 05 May 2024 17:45:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lin Sun Date: Mon, 6 May 2024 00:44:49 +0000 Message-ID: Subject: Re: bug#70707: 30.0.50; [PATCH] ; Check the process param in function (python-shell-completion-at-point) To: 70707@debbugs.gnu.org, kobarity Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70707 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Hi, > > There is an unexpected error message happening with function > `python-shell-completion-at-point`. > > Wrong type argument: processp, nil > It happened because the function does NOT check the process param. > The patch will check the param and display a user error message gracefully. > > Steps to reproduce the issue. > 1. $ emacs -q /tmp/a.py # start emacs and open a python source file > 2. type "C-c C-p" (or M-x run-python) to start a python shell > 3. type exit() to stop the python process but the buffer still exists > 4. Switch to *python* buffer, then M-x > python-shell-completion-at-point will get the error message > > Please help review the patch. Thanks. Regards > > > From aa44c95c7f13f2d68be83260e618cf4d806b313b Mon Sep 17 00:00:00 2001 > From: Lin Sun > Date: Wed, 1 May 2024 06:55:31 +0000 > Subject: [PATCH] ; Check the process param in function > (python-shell-completion-at-point) > > * lisp/progmodes/python.el (python-shell-completion-at-point): > Check the process param at the beginning of the function. > --- > lisp/progmodes/python.el | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > index d6c29e5ffc..4b2e2f8215 100644 > --- a/lisp/progmodes/python.el > +++ b/lisp/progmodes/python.el > @@ -4708,6 +4708,8 @@ python-shell-completion-at-point > Optional argument PROCESS forces completions to be retrieved > using that one instead of current buffer's process." > (setq process (or process (get-buffer-process (current-buffer)))) > + (unless process > + (user-error "No active python inferior process")) > (let* ((is-shell-buffer (derived-mode-p 'inferior-python-mode)) > (line-start (if is-shell-buffer > ;; Working on a shell buffer: use prompt end. > -- > 2.20.5 Hi Kobarity, Please help review the patch for checking process and emitting user-error when it's not available. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 11:12:52 2024 Received: (at 70707) by debbugs.gnu.org; 6 May 2024 15:12:52 +0000 Received: from localhost ([127.0.0.1]:38579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s401M-0005qr-89 for submit@debbugs.gnu.org; Mon, 06 May 2024 11:12:52 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:58638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s401J-0005qd-6O for 70707@debbugs.gnu.org; Mon, 06 May 2024 11:12:50 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1eb24e3a2d9so19836895ad.1 for <70707@debbugs.gnu.org>; Mon, 06 May 2024 08:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715008339; x=1715613139; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=niY0ES2RPn1B6WnxjLkNmPqUET8cPp6a+q4bo8i7fnQ=; b=Whe4ckIft8i+q2Z2D1x5aZPmVLlIyQBFeduIeH0uXgrI/OdsEWE8PFjFJ8dJnM+8GB qI/sYPA64ziZ0IfbxNBbDyCDNxveWKwncpjB0Io8GiBiyuvLWoXgQefkltVyyI+HYDoV diiBR6NfuLjDhR2MuaIibks4EuYoSSRJWbpKInYCgtCAj4qBGuhyRWmblaylYZ2v4lpv LXd9Jg+roPqzQvvNHrRsZLnHWpAquylVHguTaB/ZnIQHstIUpvWVy2vWlS0Ul+uo2xX3 bGrFliEE8Ag/gJ8MIHJiN5Kn1DM2/9SaG6HZGX51t4A9fAA3LkoFYbtJkbkcWLs4tPRM XAiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715008339; x=1715613139; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=niY0ES2RPn1B6WnxjLkNmPqUET8cPp6a+q4bo8i7fnQ=; b=Q28pkCOMH6AE4Gbwte7EmD7T0mPYYriv9GTUktVU4NmiAEWIyUt/JqrYEucJkWqulf zjMinJ6z4uk3EMxOSR/wq4A4PUnMQZHfJEtIRLPfh6N/Tg/0fXgwNqLCPjgIG271U27R BW472I1ZSc+2egFMzRfllcvF5S2zfXrvz/9ZqYK4g/bpdkQ67C3p79uvq39ZR6VK2Nng jSJrTsdGjCMDZ7Jorp7r6NZdovNuD++hicpF+X02SKecKpYd62PwIb1NnahT11COvdYQ T23dHzBNTldzsSqXl1YPYIQAPWJR6Zc4lRxVQXutaGV7hqh9RN09qAirSRGYg4Rr5uO8 4ZXw== X-Gm-Message-State: AOJu0YygL/hc5PqVg4zZO3Ue4nRfIihJAnSl/uT//Kw5Jxh0We4520Gw 1isO7FeI5bfZpknHUb91ncRZX9WhkpgD0iLCzMaAWh9gme65ROyO X-Google-Smtp-Source: AGHT+IGi9vXHjrVBTzRn8KfXuk7ksCbbpvSibUl9OfuYrukj6dfht96t3UKAsrqOb5F4VBwgf2dvcg== X-Received: by 2002:a17:902:b186:b0:1e2:9066:4a8b with SMTP id s6-20020a170902b18600b001e290664a8bmr12437073plr.26.1715008338659; Mon, 06 May 2024 08:12:18 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id h13-20020a170902680d00b001e2a4663179sm2776330plk.258.2024.05.06.08.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 08:12:18 -0700 (PDT) Date: Tue, 07 May 2024 00:12:10 +0900 Message-ID: From: kobarity To: Lin Sun Subject: Re: bug#70707: 30.0.50; [PATCH] ; Check the process param in function (python-shell-completion-at-point) In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70707 Cc: 70707@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lin Sun wrote: > > > Hi, > > > > There is an unexpected error message happening with function > > `python-shell-completion-at-point`. > > > Wrong type argument: processp, nil > > It happened because the function does NOT check the process param. > > The patch will check the param and display a user error message gracefully. > > > > Steps to reproduce the issue. > > 1. $ emacs -q /tmp/a.py # start emacs and open a python source file > > 2. type "C-c C-p" (or M-x run-python) to start a python shell > > 3. type exit() to stop the python process but the buffer still exists > > 4. Switch to *python* buffer, then M-x > > python-shell-completion-at-point will get the error message > > > > Please help review the patch. Thanks. Regards > > > > > > From aa44c95c7f13f2d68be83260e618cf4d806b313b Mon Sep 17 00:00:00 2001 > > From: Lin Sun > > Date: Wed, 1 May 2024 06:55:31 +0000 > > Subject: [PATCH] ; Check the process param in function > > (python-shell-completion-at-point) > > > > * lisp/progmodes/python.el (python-shell-completion-at-point): > > Check the process param at the beginning of the function. > > --- > > lisp/progmodes/python.el | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > > index d6c29e5ffc..4b2e2f8215 100644 > > --- a/lisp/progmodes/python.el > > +++ b/lisp/progmodes/python.el > > @@ -4708,6 +4708,8 @@ python-shell-completion-at-point > > Optional argument PROCESS forces completions to be retrieved > > using that one instead of current buffer's process." > > (setq process (or process (get-buffer-process (current-buffer)))) > > + (unless process > > + (user-error "No active python inferior process")) > > (let* ((is-shell-buffer (derived-mode-p 'inferior-python-mode)) > > (line-start (if is-shell-buffer > > ;; Working on a shell buffer: use prompt end. > > -- > > 2.20.5 > > Hi Kobarity, Please help review the patch for checking process and > emitting user-error when it's not available. Thanks. Hi Lin, The patch itself looks good to me. > > 4. Switch to *python* buffer, then M-x > > python-shell-completion-at-point will get the error message As `python-shell-completion-at-point' is not an interactive function, I tested with M-x complete-symbol. From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 11:50:14 2024 Received: (at 70707) by debbugs.gnu.org; 6 May 2024 15:50:14 +0000 Received: from localhost ([127.0.0.1]:38776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s40bW-0006Fk-5E for submit@debbugs.gnu.org; Mon, 06 May 2024 11:50:14 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:61559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s40bR-0006FS-Ct for 70707@debbugs.gnu.org; Mon, 06 May 2024 11:50:12 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a59c448b44aso327390666b.2 for <70707@debbugs.gnu.org>; Mon, 06 May 2024 08:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715010578; x=1715615378; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lF3GWXJmddohiu7T6UPn4MwQG+DuCV7QjKejaeDm/FY=; b=RngeUlWgSTS+lLeLD2zB+OqDzcgnkFVQmorOU8z3gX7I0o3ypc1aGsu3tc03yQfmIQ c/UbWLay6pia6W/Jx/Rks8UV6gAb85I4NPcWR1Ro0o9U2OdBsFRD+x1sdtf1/LafEC5z 85KUl/SFIlXn9ozE54MmW5Q50TxQ7eshfgZ53MDSWw1dWxDHZMxyxr6PWObYngs/sa9b +4uwb9rNKO50ou1wzsxFtdEEI8uKw5RowWxfDKAeABuSWV21DN7x1VX42pWImVsSf/jq rwR7Ggk/OHDYTIZ1T/b1hoajKFvYhCX+pGnQvummc4DvmBHGAOus8dNvMMR1EixfrAHh nhiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715010578; x=1715615378; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lF3GWXJmddohiu7T6UPn4MwQG+DuCV7QjKejaeDm/FY=; b=Vq4H3B2v5tFV7+lfS1+pLexdIjKDEdwjk4st6mYNlXhKGHtnnaCe5VV3scBOsPFt/c UB+ptoHp8V5gU16uJpQ1jCfO/Jxi0cimyEXBmpMgigAscQfTgm8RUTBKUgMTyzjLFuZn 8gauUlMXgiOIFpMHq6R2gk5VmgVsbBz8WLp4DLG1iR69UaXUbAt8b+rm9f7b8DuLEWQq J2xa5AxTB11QCXsvf3kY2rqCZaAX8HqI7VcRNFDrNpvR9+zaf/ULjvIfY168cev37ZgB hmsl59+0HC1D0TcR75AeuhrKhGT6DkyHqeiDKPgy+FGR7TTkQ+BT53lq0KGXVn8MJK9G Z9JQ== X-Gm-Message-State: AOJu0YzhplJU/xs3Hv1ztQiIcmq5WzijYTAsKWj8Qr4oYTcNFA4bkzpF vrr1cc4pn7SfhXVJIujYoh8ARplpgAf42H77yrD4mzvYP+hgYvzRhlmOBFT8YDvyGkJFsMM1vaU hnYVo5QlcPlUPMtjszh7yUqgq15A= X-Google-Smtp-Source: AGHT+IHeeU2FxEtjE4Ajz1mrtaD2Z7x086EY2vMgFkgyEE/OsYGbWBJdBgLgOH3EBgI+TrZLo0KM74uJYLU5CyzYO6g= X-Received: by 2002:a50:9b14:0:b0:56e:2a64:8290 with SMTP id o20-20020a509b14000000b0056e2a648290mr6861818edi.5.1715010577853; Mon, 06 May 2024 08:49:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lin Sun Date: Mon, 6 May 2024 15:49:26 +0000 Message-ID: Subject: Re: bug#70707: 30.0.50; [PATCH] ; Check the process param in function (python-shell-completion-at-point) To: kobarity , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70707 Cc: 70707@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Mon, May 6, 2024 at 3:12=E2=80=AFPM kobarity wrote: > > > Lin Sun wrote: > > > > > Hi, > > > > > > There is an unexpected error message happening with function > > > `python-shell-completion-at-point`. > > > > Wrong type argument: processp, nil > > > It happened because the function does NOT check the process param. > > > The patch will check the param and display a user error message grace= fully. > > > > > > Steps to reproduce the issue. > > > 1. $ emacs -q /tmp/a.py # start emacs and open a python source file > > > 2. type "C-c C-p" (or M-x run-python) to start a python shell > > > 3. type exit() to stop the python process but the buffer still exists > > > 4. Switch to *python* buffer, then M-x > > > python-shell-completion-at-point will get the error message > > > > > > Please help review the patch. Thanks. Regards > > > > > > > > > From aa44c95c7f13f2d68be83260e618cf4d806b313b Mon Sep 17 00:00:00 200= 1 > > > From: Lin Sun > > > Date: Wed, 1 May 2024 06:55:31 +0000 > > > Subject: [PATCH] ; Check the process param in function > > > (python-shell-completion-at-point) > > > > > > * lisp/progmodes/python.el (python-shell-completion-at-point): > > > Check the process param at the beginning of the function. > > > --- > > > lisp/progmodes/python.el | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > > > index d6c29e5ffc..4b2e2f8215 100644 > > > --- a/lisp/progmodes/python.el > > > +++ b/lisp/progmodes/python.el > > > @@ -4708,6 +4708,8 @@ python-shell-completion-at-point > > > Optional argument PROCESS forces completions to be retrieved > > > using that one instead of current buffer's process." > > > (setq process (or process (get-buffer-process (current-buffer)))) > > > + (unless process > > > + (user-error "No active python inferior process")) > > > (let* ((is-shell-buffer (derived-mode-p 'inferior-python-mode)) > > > (line-start (if is-shell-buffer > > > ;; Working on a shell buffer: use prompt en= d. > > > -- > > > 2.20.5 > > > > Hi Kobarity, Please help review the patch for checking process and > > emitting user-error when it's not available. Thanks. > > Hi Lin, > > The patch itself looks good to me. > > > > 4. Switch to *python* buffer, then M-x > > > python-shell-completion-at-point will get the error message > > As `python-shell-completion-at-point' is not an interactive function, > I tested with M-x complete-symbol. Hi Kobarity, Thanks for confirming! And yes, the complete-symbol is the interactive function which will be called the `python-shell-completion-at-point'. Hi Eli, Please help merge the patch. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 12:38:22 2024 Received: (at 70707) by debbugs.gnu.org; 6 May 2024 16:38:22 +0000 Received: from localhost ([127.0.0.1]:38985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s41M5-0006mg-Mw for submit@debbugs.gnu.org; Mon, 06 May 2024 12:38:21 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:58568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s41M3-0006mY-Mc for 70707@debbugs.gnu.org; Mon, 06 May 2024 12:38:20 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-51f74fa2a82so2411779e87.0 for <70707@debbugs.gnu.org>; Mon, 06 May 2024 09:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715013469; x=1715618269; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3+85+I9RZ/Bs9TSojOHsdC0mzryseKFeEyXjVbHn8zM=; b=Y+ak9gLKbQavsDhYSztVAmMzoRN/oKLrUGvssH7XW/nxPN2WQXm+O2nu5dpwU7ceIT 0ltFtKutZkDC6x2d4CS4tHGFnPKT0FTE31gUUpoItAfO+i+2E1Tf/l+vmnppJO0mDjeg kl9sijJfCRZ6YgXcaTc7buhs4XVkSv+9TFlZz8fDZIz2YRk2f7xcbda+9ApVUegz4Ras 9AaGnawBFwOTL73/onyWhwpsEupmfsSwtbcMfGK+R3z+n+yLhbUDwOBsD+iUJAGnoGuv dVuuf/XwtjB4lY25Wwejt6YjbnxifiGZ4Y/xAEmmUMft4JEdAYCD8xtencYGhNctprGk BXUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715013469; x=1715618269; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3+85+I9RZ/Bs9TSojOHsdC0mzryseKFeEyXjVbHn8zM=; b=NMEBr9gC94j2agtoEboJO8r7zYtrybma4gIxvFGLDBA8KUvKaCGMg9mQR6lpWxczsu 5+TbMiHrcLcGGPXPnzJ6FIj0I/xpHitatn7OEN0unXA0w0PiXQ8/dnwSsMbskf/ulEZY 4/0ZUdrNjF7yr71GLvrRpJh1aPenWO4sWUZfMhmTP4O2Yudn/9Rgyz0MpmI62St1h6hs alVqfFSvlyXNI9TDkdwcNXRvZfMBclSnLal0MwSIMXFVwMvdUUns20X8vCknDxAhfKRi YC0ibAdlX9GHXjP9h0zzPfdbq+UV2RGQNg+DN2ejntz6Fm/Y3wsCRmLMzOLMv3BFvriV oc3A== X-Gm-Message-State: AOJu0YykJyANgiGG+djlFwIMVIBuzq8hEVX4LRBPOau74hEqoIZ65LrP 13p1/1FMitdWSMzpErESw1zFpr4mJ9hs1A0mcgjDdBTYGbVtP7fNdi7S8vZ/O5mx0MmcaFssxH/ YFa976TyNVa1/Q0Yzu/5ru2xiH/Q= X-Google-Smtp-Source: AGHT+IEF+yxdOni8GSLEWxXGNqbXCErEIQDva3RynT++qeFLzOTUCbvS0x5AUihF1tUPVnSAocSMmzQeIgqy6RSJKck= X-Received: by 2002:a05:6512:682:b0:51d:53fa:6530 with SMTP id t2-20020a056512068200b0051d53fa6530mr10522045lfe.28.1715013468836; Mon, 06 May 2024 09:37:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lin Sun Date: Mon, 6 May 2024 16:37:37 +0000 Message-ID: Subject: Re: bug#70707: 30.0.50; [PATCH] ; Check the process param in function (python-shell-completion-at-point) To: kobarity , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70707 Cc: 70707@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Correct my previous comment: The (complete-symbol) will call the (python-shell-completion-at-point) in python-mode. From debbugs-submit-bounces@debbugs.gnu.org Thu May 09 03:59:08 2024 Received: (at 70707-done) by debbugs.gnu.org; 9 May 2024 07:59:08 +0000 Received: from localhost ([127.0.0.1]:53820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4ygG-0004bE-Bh for submit@debbugs.gnu.org; Thu, 09 May 2024 03:59:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4ygD-0004ar-5G for 70707-done@debbugs.gnu.org; Thu, 09 May 2024 03:59:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4yfh-0003IC-Op; Thu, 09 May 2024 03:58:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=f4FhP7F4hMJ0CvN59nU4flN1/x2MLmJIXRWBgxcABHM=; b=CwxN9jxcfWUm LOF9ozC97x8SmM32htkXp6e9UIiDrBvKuXHyaeR/J/eWUc5GswFxlYN9uIW/othIkwiEXyOAJgVfE 7r17mYEZr932Oja2qru8WrTa7j6wxVfdK0mckNmVZCJ6UgOcg47If8lsG9//cF51x95bbAvwkmqia H9fSG2BJWHx9Dl+RolL/3DWRrlzVuq/WxqND12YnDFj730kI1VUc3b00P+R3/IVMYB840JjaUI3gU 4NndN/sXbeo480B7ItXYrpZDy5vbUTWYF/nxJJLdGuEpHUsybvR9hcvj0F39zNV+gOavcRRZuXuTc OarkbCWQsLdVsJcOxDihJw==; Date: Thu, 09 May 2024 10:58:30 +0300 Message-Id: <86h6f776xl.fsf@gnu.org> From: Eli Zaretskii To: kobarity In-Reply-To: (message from kobarity on Tue, 07 May 2024 00:12:10 +0900) Subject: Re: bug#70707: 30.0.50; [PATCH] ; Check the process param in function (python-shell-completion-at-point) References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70707-done Cc: 70707-done@debbugs.gnu.org, sunlin7.mail@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 70707@debbugs.gnu.org > Date: Tue, 07 May 2024 00:12:10 +0900 > From: kobarity > > > Hi Kobarity, Please help review the patch for checking process and > > emitting user-error when it's not available. Thanks. > > Hi Lin, > > The patch itself looks good to me. Thanks, installed on master, and closing the bug. From unknown Fri Aug 15 19:32:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 06 Jun 2024 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator