help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to highlight block end in Python-mode indentation


From: Joost Kremers
Subject: Re: how to highlight block end in Python-mode indentation
Date: Sat, 20 May 2017 10:49:20 +0200
User-agent: mu4e 0.9.19; emacs 25.2.4


On Sat, May 20 2017, Krishnakant wrote:
I tryed indent-gide and it sutes perfectly.
Just one question.
How can I have it work for every block and not just for class and function in
Python?
It is not effective for if, while try: catch etc.
I am sure it can be made to work because the screenshot on the github page has
it there.

Well, the only customisation I have regarding `indent-guide' is this:

(setq indent-guide-char "│")

And for me, it does work with if and other blocks.

Are you sure it doesn't work? Note that indent-guide doesn't show indentation if point is on the line that begins the block. So if you have:

```
def some_fun(arg):
 print("Hi!")
 if arg = 1:
   print("How are you?")
 elif arg = 2:
   print("How do you do?")
 else:
   print("I don't want to know you.")

Now if point is on the line `def...`, no indentation markers are shown. They appear when you move point down. Similarly, if point is on the line `if...`, it doesn't show the indentation of the if block but of the def block. Once you move down to the line `print("How are you?")`, it'll show the indentation of the if block.

HTH


--
Joost Kremers
Life has its moments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]