Use when-let* for safer in symbol overlay panel.

This commit is contained in:
Vincent Zhang 2018-11-28 14:43:29 +08:00
parent e7de8eef92
commit b0750259a3

View file

@ -1090,12 +1090,12 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
(when (and (bound-and-true-p symbol-overlay-keywords-alist) (when (and (bound-and-true-p symbol-overlay-keywords-alist)
(not (bound-and-true-p symbol-overlay-temp-symbol)) (not (bound-and-true-p symbol-overlay-temp-symbol))
(not (bound-and-true-p iedit-mode))) (not (bound-and-true-p iedit-mode)))
(let* ((keyword (symbol-overlay-assoc (when-let* ((keyword (symbol-overlay-assoc
(ignore-errors (symbol-overlay-get-symbol)))) (ignore-errors (symbol-overlay-get-symbol))))
(symbol (car keyword)) (symbol (car keyword))
(before (symbol-overlay-get-list symbol 'car)) (before (symbol-overlay-get-list symbol 'car))
(after (symbol-overlay-get-list symbol 'cdr)) (after (symbol-overlay-get-list symbol 'cdr))
(count (length before))) (count (length before)))
(if (symbol-overlay-assoc symbol) (if (symbol-overlay-assoc symbol)
(propertize (propertize
(format (concat " %d/%d " (and (cadr keyword) "in scope ")) (format (concat " %d/%d " (and (cadr keyword) "in scope "))