Skip to content

Commit

Permalink
Check that we found a mode lighter entry before setting it.
Browse files Browse the repository at this point in the history
It is possible that a mode lighter is not in the mode line, for
example when the mode name changes upstream or the user removed
the mode from the mode line themselves. Guard against this so we
do not throw an error.

Fixes the error described at the end of #477.
  • Loading branch information
jorgenschaefer committed Feb 7, 2015
1 parent 148a20f commit 5b4e5f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions elpy.el
Original file line number Diff line number Diff line change
Expand Up @@ -3005,8 +3005,10 @@ time. Honestly."
((eq mode-name 'eldoc-minor-mode)
(setq eldoc-minor-mode-string nil))
(t
(setcdr (assq mode-name minor-mode-alist)
(list "")))))
(let ((cell (assq mode-name minor-mode-alist)))
(when cell
(setcdr cell
(list "")))))))

;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Module: Sane Defaults
Expand Down

0 comments on commit 5b4e5f6

Please sign in to comment.