summaryrefslogtreecommitdiff
path: root/helm-buffers.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2018-04-01 08:28:21 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2018-04-01 08:28:21 +0200
commit412e85cad7ed4073152b6e339d8e7c9247ddeba4 (patch)
tree0ddb594666662ae26a2abdc8e82e7960cb32d32f /helm-buffers.el
parentf463f2156a3a439d7cab83ccd3028277d33d8828 (diff)
Avoid calling format-mode-line when possible (#2011)
* helm-buffers.el (helm-buffers-list--init): Do it, in 99% of cases mode-name is a string and don't have to be formatted, just ensure for safety it is the case and call format-mode-line if not.
Diffstat (limited to 'helm-buffers.el')
-rw-r--r--helm-buffers.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/helm-buffers.el b/helm-buffers.el
index c15e29b0..d439f1ba 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -243,7 +243,9 @@ Note that this variable is buffer-local.")
helm-source-buffers-list))
maximize (length b) into len-buf
maximize (length (with-current-buffer b
- (format-mode-line mode-name)))
+ (if (stringp mode-name)
+ mode-name
+ (format-mode-line mode-name))))
into len-mode
finally return (cons len-buf len-mode))))
(unless (default-value 'helm-buffer-max-length)