branch: externals/polymode
commit a48648fe2b2e7ca7675ae88ddc2d197c25914eb9
Author: iskamag <[email protected]>
Commit: Vitalie Spinu <[email protected]>
Update polymode-core.el
---
polymode-core.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/polymode-core.el b/polymode-core.el
index 4c8e150d86..8f64a89004 100644
--- a/polymode-core.el
+++ b/polymode-core.el
@@ -85,7 +85,10 @@
(with-no-warnings
(eieio-object-name-string obj)))
-
+;; avoids appending random numbers to buffer name when multiple windows are
involved
+(defun pm--buffer-hiddenp ()
+ "Check whether the Emacs buffer is hidden."
+ (= ?\ (string-to-char (buffer-name))))
;; CORE EMACS COMPATS
@@ -1108,7 +1111,8 @@ switch."
(mkt (mark t))
(hlf header-line-format))
- (when pm-hide-implementation-buffers
+ (when (and pm-hide-implementation-buffers
+ (not (pm--buffer-hiddenp)))
(rename-buffer (pm--buffer-name 'hidden)))
(setq pm/current nil)
@@ -1144,7 +1148,8 @@ switch."
(deactivate-mark)
(activate-mark))
- (when pm-hide-implementation-buffers
+ (when (and pm-hide-implementation-buffers
+ (pm--buffer-hiddenp))
(rename-buffer (pm--buffer-name)))
;; avoid display jumps