From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: immerrr again Newsgroups: gmane.emacs.devel Subject: Re: python.el: improve sexp-based navigation or make it optional? Date: Sat, 16 May 2020 22:46:13 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="48944"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , emacs-devel To: =?UTF-8?Q?Andreas_R=C3=B6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 16 22:47:08 2020 Return-path: Envelope-to: ged-emacs-devel@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 1ja3i6-000Cas-Qh for ged-emacs-devel@m.gmane-mx.org; Sat, 16 May 2020 22:47:06 +0200 Original-Received: from localhost ([::1]:38646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ja3i5-000177-TR for ged-emacs-devel@m.gmane-mx.org; Sat, 16 May 2020 16:47:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ja3hV-0000gg-8O for emacs-devel@gnu.org; Sat, 16 May 2020 16:46:29 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:34569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ja3hT-0004Gg-C3 for emacs-devel@gnu.org; Sat, 16 May 2020 16:46:28 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id b6so5855455ljj.1 for ; Sat, 16 May 2020 13:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QIcp6kM+MveakAtm4t77Wq0Y3EUge8whgyWLoAYcX7g=; b=k5fw6Ouw/rsZ48wfT3j+oV2DX9wAK8mt1ydMhMj0V5UzIi2WOveqZ9VP2Xe2dA9GjG es54uWmTBGjSXKZxbyEInuKi8OAwc34Z37wuJsPI9DkcjENcmtSOA/vTd0cHOdZv/05Z wgmkYASDc6l4moMhxlkKrtV/+7jLtlVNxl73Ncc8nGRcIj2TQNtQsWGJgoGcUWb3/VAA kEuRRIoBURcgtrkUQ/EPaugFIcPXO/WwCnNnX7KKpnwAnXutJXpvBzDQmT9S+oyhPGUT sRAsxqO9AOGat/EQoxXATeqMYMGchOfa+2cvetpuz3OJyAfd8t/bb29jdfyS9sxQmApU peGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QIcp6kM+MveakAtm4t77Wq0Y3EUge8whgyWLoAYcX7g=; b=Ul0w/xTSU0oqZy01KUht+ZPwX7+6039eGw6jAwUMakzWs9GY9Euq7Bz1HjkP8tff/t X2Gt6d/hyOwX5EEsakto/BVZ3leFrGcFrJfLjrCikoL5vklLcy52qecGrA0LfP1CFn2u ufYToGa/Ir/1lxg1IRQCm2f9e27P2KgjWrPhl5hagznr7V4A1JVGo5wMpJJ25vzvFbiU f4nGR27eFgfSuPGQkjEkxfx8Rv3f4X9d1I7Jq1V1+DI+JPJ+vE58+5e9CQ5zzpDvmdhK 8b8iMUfR8ZBk5M6MT+G/hmbFzZ0VubkfEUp/p8wVx2zVSN4xl+owJjbYCaxAw0pf3TUA bQMQ== X-Gm-Message-State: AOAM5301Xj3GKzLtqN8lum5fpYeJMDgblZUk82Xe+cGlS+tGFk78a/+u hj2yhi3POXjJPZpR2u1WeyzM1FronA+fhLPdjJw= X-Google-Smtp-Source: ABdhPJy/xGG7iQX0toYW439hDhpdlMjQzfQ+X+4HypstYH3LdS9QT7wDrh83hDtpXq8+r4lSdgZBafCahezHDDOkmrA= X-Received: by 2002:a2e:8155:: with SMTP id t21mr5654229ljg.5.1589661985253; Sat, 16 May 2020 13:46:25 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=immerrr@gmail.com; helo=mail-lj1-x229.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250528 Archived-At: On Sat, May 16, 2020 at 9:04 PM Andreas R=C3=B6hler wrote: > > > On 16.05.20 15:16, immerrr again wrote: > > > > In absence of such mode, I wonder if it would be a welcome addition to > > introduce a configuration parameter that at least disables the smart > > navigation, making sexp skip one symbol or explicitly > > parenthesized/bracketed expression at a time. > > Maybe that does it?: (from python.el) > > If you prefer `cc-mode'-like > ;; `forward-sexp' movement, setting `forward-sexp-function' to nil is > ;; enough, You can do that using the `python-mode-hook': > > ;; (add-hook 'python-mode-hook > ;; (lambda () (setq forward-sexp-function nil))) > Yep, it works, thanks! I have forgotten about that variable. I wonder if it would be hard to implement the sexp visualisation mode that would show "virtual parentheses". Overlays perhaps would be a tad slow, if there was a parenthesis pair shown for every sexp out there. Maybe I could limit it only to the sexps that immediately surround point... Properties would be much better performance wise, but looks like "display" characters are added as a block, and one cannot enter a sequence of virtual parentheses with point. I could try adding spaces or whatnot, but then I'd have to be extra careful that they are cleaned up before saving or copying buffer contents. Any recommendations on what could be the starting point here?