Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

*Buffer List* column resizing for emacs >= 24.2.50.1

2 views
Skip to first unread message

Tom Roche

unread,
Apr 17, 2013, 7:05:29 PM4/17/13
to help-gn...@gnu.org

How to get *Buffer List* column resizing on a recent GNU Emacs?
Why I ask:

I'm running

$ cat /etc/debian_version
> wheezy/sid
$ emacs-snapshot --version
> GNU Emacs 24.2.50.1

I work with versions of similarly-named files on several hosts
(thanks, Tramp!), using rename-buffer for sanity. This works, except
for the fixed-width *Buffer List* columns, which longer buffer names
overflow.

I tried installing Buffer Menu Plus

http://www.emacswiki.org/BufferMenuPlus

by

1. downloading buff-menu+.el from the above to a folder on my load-path
(~/.emacs.d/site-lisp/)

2. byte-compile-file'ing buff-menu+.el

3. putting

> (require 'buff-menu+)

in my ~/.emacs.d/init.el

4. byte-compile-file'ing init.el

5. restarting emacs

This failed with a long *Backtrace* which I unfortunately did not
record. I assumed this was due to incompatibility with later
buff-menu.el as discussed @ tail of

http://www.emacswiki.org/BufferMenuPlus

) which I attempted to solve as also discussed there: I downloaded the
buff-menu.el from emacs-23.4

$ URI=http://ftp.gnu.org/gnu/emacs/emacs-23.4.tar.bz2
$ DIR="/tmp/emacs-23.4"
$ FN="$(basename ${URI%%\?*})"
$ mkdir -p ${DIR}
$ FP="${DIR}/${FN}"
$ curl -C - -o "${FP}" "${URI}"
$ pushd ${DIR}/
$ tar xf emacs-23.4.tar.bz2
$ popd
$ pushd ${DIR}/emacs-23.4/
$ find -type f -name 'buff-menu*'
> ./lisp/buff-menu.elc
> ./lisp/buff-menu.el
$ mv ./lisp/buff-menu.el ~/.emacs.d/site-lisp/

and then byte-compile-file'd ~/.emacs.d/site-lisp/buff-menu.el and
~/.emacs.d/init.el , getting no errors. I then restarted emacs: no
change, same startup error in *Backtrace*.

I then tried

1. changing my init.el from

< (require 'buff-menu+)

to

> (load (concat LOCAL-EMACS-LISP-DIR "/buff-menu.elc"))
> (load (concat LOCAL-EMACS-LISP-DIR "/buff-menu+.elc"))

2. byte-compile-file'ing init.el

3. restarting emacs

This still fails, but with a shorter error :-)

*Backtrace*
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
> list-buffers-noselect(nil)
> list-buffers(nil)
> call-interactively(list-buffers nil nil)

So I'm wondering: how can I get a *Buffer List* with resizeable columns?

TIA, Tom Roche <Tom_...@pobox.com>

Drew Adams

unread,
Apr 17, 2013, 11:16:33 PM4/17/13
to help-gn...@gnu.org, Tom Roche
> How to get *Buffer List* column resizing on a recent GNU Emacs?
> GNU Emacs 24.2.50.1

BTW, be aware that that is an old development snapshot, not a release. You are
likely better off with Emacs 24.2 or 24.3 - more stable.

> I tried installing Buffer Menu Plus
> http://www.emacswiki.org/BufferMenuPlus

> 4. byte-compile-file'ing init.el

(You probably do not need to byte-compile your init file, but that should be
irrelevant here. It is generally not recommended to byte-compile it - see
(emacs) `Init File'.)

> This failed... I assumed this was due to incompatibility
> with later buff-menu.el as discussed @ tail of
> http://www.emacswiki.org/BufferMenuPlus

Yes. Emacs Dev rewrote buff-menu.el in Emacs 24.2 to use tabulated list mode.
I have not yet updated buff-menu+.el (and might never get around to it) to adapt
to that change.

> I attempted to solve as also discussed there
...
> $ mv ./lisp/buff-menu.el ~/.emacs.d/site-lisp/

While that's not necessarily bad to do, you can also just put the Emacs 23
buff-menu.el in some other directory that is in your `load-path' - it need not
be site-lisp. The important thing is that wherever it is, it be in your
`load-path' before any other buff-menu.el[c].

> and then byte-compile-file'd ~/.emacs.d/site-lisp/buff-menu.el and
> ~/.emacs.d/init.el, getting no errors. I then restarted emacs: no
> change, same startup error in *Backtrace*.

What you describe should have worked. My guess is that the Emacs 24.2+
buff-menu.el[c] is being picked up, not the Emacs 23 buff-menu.el[c].

You can check whether that is the case using any of these commands:

`locate-library'
`list-load-path-shadows'
`find-library buff-menu'

Whichever buff-menu.el[c] is loaded first, based on your `load-path', will
prevent the other from ever being loaded and thus used.

If that is in fact the problem, then either change your `load-path' order or put
the Emacs 23 buff-menu.el[c] in the right directory, so it gets picked up first.

The simplest, and probably the best, approach is to put files that you gather
here and there in your own Lisp directory somewhere, and put that first in your
`load-path'.

E.g., put the Emacs 23 buff-menu.el and buff-menu+.el files in directory
/some/where/my-lisp/, and do this in your init file:

(add-to-list 'load-path "/some/where/my-lisp/")
(require 'buff-menu+)

That should be all you need. That `add-to-list' sexp puts your directory first.

> I then tried changing my init.el from (require 'buff-menu+)
> to (load (concat LOCAL-EMACS-LISP-DIR "/buff-menu.elc"))
> (load (concat LOCAL-EMACS-LISP-DIR "/buff-menu+.elc"))

Don't bother with absolute file names for this. Try to rely on `load-path' and
`require'. (Anyway, it is better to use `expand-file-name' than `concat' when
fiddling with file names.)

> This still fails, but with a shorter error :-)
> So I'm wondering: how can I get a *Buffer List* with
> resizeable columns?

See above. My guess is that you just have to help Emacs find the right
buff-menu.el[c]. And the answer to that is `load-path'.

You can follow up with me off list, if you like.


Tom Roche

unread,
Apr 19, 2013, 1:53:57 PM4/19/13
to help-gn...@gnu.org

Thanks to Drew Adams' assistance, and after updating to emacs-24.3.50.1,
I now have the ability to resize column=Buffer in the *Buffer List* from
Buffer Menu Plus. The fix was:

1. Download an emacs-23 buff-menu.el to a directory on one's load-path.
I did

URI='http://ftp.gnu.org/gnu/emacs/emacs-23.4.tar.bz2'
DIR="/tmp/emacs-23.4"
FN="$(basename ${URI%%\?*})"
mkdir -p ${DIR}
FP="${DIR}/${FN}"
curl -C - -o "${FP}" "${URI}"
pushd ${DIR}/
tar xf emacs-23.4.tar.bz2
popd
pushd ${DIR}/emacs-23.4/
find -type f -name 'buff-menu*'
> ./lisp/buff-menu.elc
> ./lisp/buff-menu.el
mv ./lisp/buff-menu.el ~/.emacs.d/site-lisp/

2. Download the latest buff-menu+.el to a directory on one's load-path.
I did

URI='http://www.emacswiki.org/emacs-en/download/buff-menu%2b.el'
DIR="${HOME}/.emacs.d/site-lisp"
FN="$(basename ${URI%%\?*})"
FP="${DIR}/${FN}"
curl -C - -o "${FP}" "${URI}"

3. Start emacs, and do

M-x load-file ~/.emacs.d/site-lisp/buff-menu.el
M-x load-file ~/.emacs.d/site-lisp/buff-menu+.el
C-x C-b

4. If that gets Buffer Menu Plus, you can resize column=Buffer with
the '+' and '-' keys.

5. If that works, add the load lines to your init.el (directly or
indirectly), and restart emacs to retest.

HTHOP, Tom Roche <Tom_...@pobox.com>

Drew Adams

unread,
Apr 19, 2013, 4:17:28 PM4/19/13
to help-gn...@gnu.org, Tom Roche
Thanks, Tom.

- Drew

> Thanks to Drew Adams' assistance, and after updating to
> emacs-24.3.50.1, I now have the ability to resize
> column=Buffer in the *Buffer List* from
> Buffer Menu Plus. The fix was:
...


0 new messages