all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* *buffer list* improvement
@ 2013-10-28 16:33 Rockefeller, Harry
  2013-10-29 19:29 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Rockefeller, Harry @ 2013-10-28 16:33 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

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

Harry Rockefeller * Senior Staff Engineer
FlightSafety International * Simulation * 700 North 9th Street * Broken Arrow, OK 74012
Tel: 918.259.4273
Harry.Rockefeller@flightsafety.com * flightsafety.com <http://www.flightsafety.com/> * A Berkshire Hathaway company

Please consider the environment before printing this email and if you received this message by mistake, please let us know and treat the contents confidentially.

[-- Attachment #2: Type: text/html, Size: 3433 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: *buffer list* improvement
  2013-10-28 16:33 *buffer list* improvement Rockefeller, Harry
@ 2013-10-29 19:29 ` Thien-Thi Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Thien-Thi Nguyen @ 2013-10-29 19:29 UTC (permalink / raw)
  To: Rockefeller, Harry; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1775 bytes --]

() "Rockefeller, Harry" <Harry.Rockefeller@flightsafety.com>
() 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 ‘directory-abbrev-alist’ to achieve 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 
                                                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/ ‘buffer-menu’ at the core instead of ‘list-buffers’.

Initially i played w/ ‘(setq directory-abbrev-alist ...)’ globally, but
was disuaded by some uninvestigated weirdness involving emacsclient and
"git rebase -i" and phase of moon...

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-29 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-28 16:33 *buffer list* improvement Rockefeller, Harry
2013-10-29 19:29 ` Thien-Thi Nguyen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.