From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: *buffer list* improvement Date: Tue, 29 Oct 2013 20:29:01 +0100 Message-ID: <8761sfdgg2.fsf@zigzag.favinet> References: <3185EFAF9C8F7B4E9DBDF56829BF7C782A5D498AAF@srv060ex01.ssd.fsi.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1383074760 18398 80.91.229.3 (29 Oct 2013 19:26:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2013 19:26:00 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: "Rockefeller\, Harry" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 29 20:26:04 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VbEvU-0005jo-2r for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 20:26:04 +0100 Original-Received: from localhost ([::1]:49031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbEvT-00034K-G8 for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 15:26:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbEvL-000333-CH for emacs-devel@gnu.org; Tue, 29 Oct 2013 15:26:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbEvD-0003q1-Ij for emacs-devel@gnu.org; Tue, 29 Oct 2013 15:25:55 -0400 Original-Received: from smtp207.alice.it ([82.57.200.103]:38902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbEvC-0003pN-Hd for emacs-devel@gnu.org; Tue, 29 Oct 2013 15:25:47 -0400 Original-Received: from zigzag.favinet (79.24.37.2) by smtp207.alice.it (8.6.060.28) id 5251568506EDACEE; Tue, 29 Oct 2013 20:25:42 +0100 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1VbEyY-0007WY-VC; Tue, 29 Oct 2013 20:29:15 +0100 In-Reply-To: <3185EFAF9C8F7B4E9DBDF56829BF7C782A5D498AAF@srv060ex01.ssd.fsi.com> (Harry Rockefeller's message of "Mon, 28 Oct 2013 12:33:18 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.103 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164652 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () "Rockefeller, Harry" () Mon, 28 Oct 2013 12:33:18 -0400 Problem: buffer list mode is too wide for my screen. Conclusion: If buffer named '~' exists then Substitute absolute path of buffer '~' everywhere with '~'. end if You can dynamically bind =E2=80=98directory-abbrev-alist=E2=80=99 to achiev= e this, something like (lightly tested): (defun list-buffers-compactly (&optional arg) "Like `list-buffers', but with filenames abbreviated (maybe). If a buffer \"~\" exists, its `default-directory' is substituted in the buffer list as \"~\"." (interactive "P") (let* ((tilde (get-buffer "~")) (directory-abbrev-alist (if tilde (acons (file-name-as-directory (expand-file-name (with-current-buffer tilde=20 default-directory))) (file-name-as-directory "~") directory-abbrev-alist) directory-abbrev-alist))) (list-buffers arg))) Personally, i do something similar, but substituting env vars instead, and w/ =E2=80=98buffer-menu=E2=80=99 at the core instead of =E2=80=98list-b= uffers=E2=80=99. Initially i played w/ =E2=80=98(setq directory-abbrev-alist ...)=E2=80=99 g= lobally, but was disuaded by some uninvestigated weirdness involving emacsclient and "git rebase -i" and phase of moon... =2D-=20 Thien-Thi Nguyen GPG key: 4C807502 (if you're human and you know it) read my lisp: (responsep (questions 'technical) (not (via 'mailing-list))) =3D> nil --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlJwDIEACgkQZwMiJEyAdQLkUACfYD+PCa7I/CHBTqk1/biKss5e 10oAnRuVD4ByCXqnRffSmktT/9mUzdgk =UAK4 -----END PGP SIGNATURE----- --=-=-=--