fniessen / emacs-leuven-theme

This Emacs theme reduces eye strain with a light, high-contrast color scheme, syntax highlighting, and support for multiple modes. Enhance your coding experience! #emacs #theme #coding #orgmode
GNU General Public License v3.0
696 stars 59 forks source link

no highlighting of current line of source code buffer in gud-gdb mode #81

Closed ouonline closed 3 years ago

ouonline commented 3 years ago

Hi,

I am using gdb in emacs with leuven theme, and it does't highlight the current line in source code buffer:

old

and I find this solution: http://kousik.blogspot.com/2005/10/highlight-current-line-in-gdbemacs.html. After adding this code snippet to my .emacs

;;Add color to the current GUD line (obrigado google)
(defvar gud-overlay
  (let* ((ov (make-overlay (point-min) (point-min))))
    (overlay-put ov 'face '(:background "#F6FECD")) ;; colors for Leuven theme
    ov)
  "Overlay variable for GUD highlighting.")

(defadvice gud-display-line (after my-gud-highlight act)
  "Highlight current line."
  (let* ((ov gud-overlay)
         (bf (gud-find-file true-file)))
    (save-excursion
      (set-buffer bf)
      (move-overlay ov (line-beginning-position) (line-end-position)
                    (current-buffer)))))

I get what I want:

new

I wonder if these can be added to leuven theme.

Thanks.

fniessen commented 3 years ago

Dear @ouonline , that's for sure some good addition. However, it should not be added to a theme, as theme should only address colors -- that would be refused by the Emacs dev team... ... but I've added it to my Emacs-Leuven configuration (see commit https://github.com/fniessen/emacs-leuven/commit/af32564c749555cf90768b430fb8e7aecf8eb8b8). Thanks!