Subject: bug#23355: list-buffers should also show directories using ~

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 28 Jul 2019 17:30:48 +0200

積丹尼 Dan Jacobson <[email-masked]> writes:

> C-x C-b runs the command list-buffers, which is an interactive
> compiled Lisp function in `buff-menu.el'.
>
> It seems to me it shows things inconsistently,
>
>     minimal_data_usage/Makefile              1664 GNUmakefile      ~/android/minimal_data_usage/Makefile
>  %  minimal_data_usage                        598 Dired by date    /home/jidanni/android/minimal_data_usage/
>     s.cgi                                    1088 Shell-script[... ~/android/minimal_data_usage/s.cgi
>     other/Makefile                            494 GNUmakefile      ~/facebook/messages/other/Makefile
>  %  other                                     263 Dired by name    /home/jidanni/facebook/messages/other/
>
> Directories are not shown with ~/, only files are.

Let's see...  it's this slightly cryptic little function:

(defun Buffer-menu--pretty-file-name (file)
  (cond (file
	 (abbreviate-file-name file))
	((bound-and-true-p list-buffers-directory))
	(t "")))

The second clause there returns this:

"/home/larsi/src/emacs/trunk/lisp/"

which, as we can see, is not abbreviated.  I've now changed it on the
trunk to abbreviate these, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no