1

I started to use Emacs for Python and I am using this package:

https://github.com/gabrielelanaro/emacs-for-python

After I install it, I see this:

enter image description here

There is a white line (like underscore) underneath the current line.

How can I remove this white line. it is annoying.

1

To see what modes are active in a particular buffer, type C-h m -- that is a shortcut for M-x describe-mode. If hl-line-mode is enabled, the readout will look like: Enabled minor modes: . . . Hl-Line . . ..


It looks like hl-line-mode is active, and the hl-line color is set to :underline t. In the instructions on the fist page of the link you cited, it states as follows:

Line highlighting

You may want to enable this feature with the color you prefer,
to do so, drop one of the following lines in your .emacs

(global-hl-line-mode t) ;; To enable
(set-face-background 'hl-line "black") ;; change with the color that you like
                                       ;; for a list of colors:
                                       ;; http://raebear.net/comp/emacscolors.html

hl-line-mode can also be enabled locally and/or only in specific major modes using mode-hooks -- enabled looks like (hl-line-mode 1) and disabled looks like (hl-line-mode -1).


If hl-line-mode is active in all major modes, then you are looking for (global-hl-line-mode t). If hl-line-mode is active in only specific major modes, then you are looking for (hl-line-mode 1). In either case, just remove or comment out that line of code.


It is also possible to enable a minor-mode globally, yet turn it off for specific major modes using mode hooks. In that case, the global setting would be placed in the .emacs file and a mode-hook would be used to turn it off: (hl-line-mode -1).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.