From: Lars Ingebrigtsen Date: Thu, 28 Apr 2016 16:51:51 +0000 (+0200) Subject: Make ibuffer not break on newline-embedded buffer names X-Git-Tag: emacs-26.0.90~2124 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f078ef90cbcf479053efd81e1d95e50e64da2e99;p=emacs.git Make ibuffer not break on newline-embedded buffer names * lisp/ibuffer.el (name): When buffer names contain newlines, quote those newlines before displaying (bug#12378). --- diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index b2ec073dc16..704907a79f7 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1740,7 +1740,13 @@ If point is on a group name, this function operates on that group." (cond ((zerop bufs) "No buffers") ((= 1 bufs) "1 buffer") (t (format "%s buffers" bufs)))))) - (propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark))) + (let ((string (propertize (buffer-name) + 'font-lock-face + (ibuffer-buffer-name-face buffer mark)))) + (if (not (seq-position string ?\n)) + string + (replace-regexp-in-string + "\n" (propertize "^J" 'font-lock-face 'escape-glyph) string)))) (define-ibuffer-column size (:inline t