all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#75486: [PATCH] Python: disable some unconditional messaging
@ 2025-01-11  6:36 Vitaliy Chepelev via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2025-01-11  8:05 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Vitaliy Chepelev via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2025-01-11  6:36 UTC (permalink / raw)
  To: 75486

Severity: minor

This code disable function that used in one place and just do
 unconditional messaging about a indented block, I don't know for what.
 I guess, it was used for debuging
 python-info-dedenter-opening-block-position. This functions just call
 one function and message a result. Messaging happen when TAB key pressed
 as a part of python-indent-line-function.  I use master head to create
 this patch.

---
 lisp/progmodes/python.el | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 16c296a8f86..4fa62ef927f 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1897,8 +1897,7 @@ level."
                   (point)))))
     (save-excursion
       (indent-line-to
-       (python-indent-calculate-indentation previous))
-      (python-info-dedenter-opening-block-message))
+       (python-indent-calculate-indentation previous)))
     (when follow-indentation-p
       (back-to-indentation))))

@@ -6241,19 +6240,6 @@ likely an invalid python file."
           ;; sort by closer
           (nreverse opening-blocks))))))

-(define-obsolete-function-alias
-  'python-info-closing-block-message
-  #'python-info-dedenter-opening-block-message "24.4")
-
-(defun python-info-dedenter-opening-block-message  ()
-  "Message the first line of the block the current statement closes."
-  (let ((point (python-info-dedenter-opening-block-position)))
-    (when point
-        (message "Closes %s" (save-excursion
-                               (goto-char point)
-                               (buffer-substring
-                                (point) (line-end-position)))))))
-
 (defun python-info-dedenter-statement-p ()
   "Return point if current statement is a dedenter.
 Sets `match-data' to the keyword that starts the dedenter
--
2.45.2





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#75486: [PATCH] Python: disable some unconditional messaging
  2025-01-11  6:36 bug#75486: [PATCH] Python: disable some unconditional messaging Vitaliy Chepelev via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2025-01-11  8:05 ` Eli Zaretskii
  2025-01-11 12:02   ` kobarity
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2025-01-11  8:05 UTC (permalink / raw)
  To: Vitaliy Chepelev, kobarity; +Cc: 75486

> Date: Sat, 11 Jan 2025 06:36:15 -0000
> From:  Vitaliy Chepelev via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Severity: minor
> 
> This code disable function that used in one place and just do
>  unconditional messaging about a indented block, I don't know for what.
>  I guess, it was used for debuging
>  python-info-dedenter-opening-block-position. This functions just call
>  one function and message a result. Messaging happen when TAB key pressed
>  as a part of python-indent-line-function.  I use master head to create
>  this patch.

Thanks.  kobarity, any comments about the usefulness of this function?
The code looks like it's there on purpose, not for debugging, but I
don't use python.el.






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#75486: [PATCH] Python: disable some unconditional messaging
  2025-01-11  8:05 ` Eli Zaretskii
@ 2025-01-11 12:02   ` kobarity
  0 siblings, 0 replies; 3+ messages in thread
From: kobarity @ 2025-01-11 12:02 UTC (permalink / raw)
  To: Eli Zaretskii, Vitaliy Chepelev; +Cc: 75486

Eli Zaretskii wrote:
> 
> > Date: Sat, 11 Jan 2025 06:36:15 -0000
> > From:  Vitaliy Chepelev via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> > 
> > Severity: minor
> > 
> > This code disable function that used in one place and just do
> >  unconditional messaging about a indented block, I don't know for what.
> >  I guess, it was used for debuging
> >  python-info-dedenter-opening-block-position. This functions just call
> >  one function and message a result. Messaging happen when TAB key pressed
> >  as a part of python-indent-line-function.  I use master head to create
> >  this patch.
> 
> Thanks.  kobarity, any comments about the usefulness of this function?
> The code looks like it's there on purpose, not for debugging, but I
> don't use python.el.

Yes, I think it's working as expected.  Try the following example.

#+begin_src python
if a == 1:
    if b == 2:
        if c == 3:
            pass
        else:
#+end_src

If you enter the last "else:", Emacs displays "Closes if c == 3:".
This means that this "else:" corresponds to the "if c == 3:".

You can change the indentation by hitting the TAB key several times on
the else line.  Each time you do this, Emacs will display the
corresponding if statement.

For example, Emacs displays "Closes if b == 2:" when the "else:" is
indented as follows:

#+begin_src python
if a == 1:
    if b == 2:
        if c == 3:
            pass
    else:
#+end_src

Of course, in this case it is easy to find the corresponding if
statement.  However, in practice, many lines can go in between the if
statements and disappear from the screen.  This feature would be
useful in such cases.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-11 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-11  6:36 bug#75486: [PATCH] Python: disable some unconditional messaging Vitaliy Chepelev via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-11  8:05 ` Eli Zaretskii
2025-01-11 12:02   ` kobarity

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.