[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: dired-sort-menu dose not work in my GNU Emacs 23.2.1

From: Drew Adams
Subject: RE: dired-sort-menu dose not work in my GNU Emacs 23.2.1
Date: Mon, 18 Jul 2011 09:40:38 -0700

Communicated to me separately:

> I am on Ubuntu 11.04 . emacs-version shows the following
> GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4)
> of 2011-04-04 on rothera, modified by Debian

OK.  You are not on Windows.  So library `ls-lisp.el' is presumably not being
used (loaded).  This means that any code that assumes an `ls-lisp*' variable or
function is defined might raise an error.

> I installed a package named 'menu-bar%2b' from 'el-get'
> which does not work.

Which one does not work: el-get or Menu-bar+?
And what does "does not work" mean in this case?

> Then I re-installed the 'menu-bar+' package correctively, then
> 'Sort By' menu item appears in 'Single' menu.

Let's see if we can figure out what you did, since you didn't say...

* Library dired-sort-menu.el puts the `Sort By' submenu in the `Immediate' menu
(a vanilla Dired menu).

* Library dired+.el renames the `Immediate' menu to `Single'.  So it seems you
loaded this library too.

* Library menu-bar+.el should have no effect on the `Sort By' submenu.

* (Library dired-sort-menu+.el moves the `Sort By' submenu from the `Immediate'
menu to the `Subdir' (aka `Dir') menu.  So it seems you did not load this.  It's
not required - just mentioning it.)

It's usually better when trying to debug a problem to reduce the complexity by
not loading lots of stuff at once.  Try, for instance, loading only
`dired-sort-menu.el', and first get that working correctly before you add more
stuff.  Much easier to debug things yourself, and easier for others to help you.

> But it still does not appear in the context menu, as shows in the
dired-sort-menu page.

First, what about the error that you reported initially, "Symbol's value as
variable is void: ls-lisp-dirs-first"?  Do you still get that?

If so, I suspect that that is a bug in `dired-sort-menu.el'.  Please report it
to the author of that library - correspond with him about this, to get that
library working on its own, first.  

I believe that `ls-lisp-dirs-first' is available only on Windows, but the
`dired-sort-menu.el' code does not seem to protect non-Windows code adequately
in this regard.

Note that library `dired-sort-menu+.el' (note the `+') does protect its own
references to `ls-lisp-dirs-first' for non-Windows use.  But it first loads
`dired-sort-menu.el, which apparently does not seem to protect this variable in
all cases.

Second, can you use the `Sort By' submenu of menubar menu `Single'?  Do you see
a `Dirs First' menu item in that submenu?

My guess is that you can use that submenu _in general_, but that you do not have
a `Dirs First' menu item in it, because `ls-lisp-dirs-first' is not defined
(because you are not on MS Windows, so library `ls-lisp.el' is not used).  But
let us know the facts.

Third, wrt the popup menu, on `S-mouse-2': What happens when you do `C-h w
dired-sort-menu-popup'?  That will tell you whether the popup menu is bound to a
key.  It should be bound (in `dired-sort-menu.el') to `S-mouse-2'.  See also
what this says: `C-h k S-mouse-2', i.e., hold Shift and click the second mouse
button, after hitting `C-h k'.

But don't worry about the popup menu until you first get the menu working in the
menu bar.

Coming back to `ls-lisp-dirs-first' being unprotected in `dired-sort-menu.el'...
While waiting for a bug fix from the author:

1. What is the value of `dired-sort-menu-saved-config'?  If non-nil, try setting
it to nil:
(setq dired-sort-menu-saved-config nil)

Really, this option's definition should take care not to let users try to
customize the `Ls-Lisp Only' parts if they do not have `ls-lisp.el' loaded.
Perhaps you tried to do that; dunno.  Anyway, for now, try setting the option to

2. Try commenting out portions of `dired-sort-menu.el' that involve `ls-lisp-*'
code.  For example, in the definition of `dired-sort-menu' (the menu), these

 ["Ignore Case" dired-sort-menu-toggle-ignore-case :style toggle
    :selected ls-lisp-ignore-case :active t
    :help "Ignore case in alphanumeric sorting"
    ;; supported only by (Emacs 21) ls-lisp library and local dired:
    :visible (ls-lisp-var-p 'ls-lisp-ignore-case)]
["Dirs First" dired-sort-menu-toggle-dirs-first :style toggle
    :selected ls-lisp-dirs-first :active t
    :help "List subdirectories first [last if reversed]"
    ;; supported only by (Emacs 21) ls-lisp library and local dired:
    :visible (ls-lisp-var-p 'ls-lisp-dirs-first)]

Likewise, you can comment out the `ls-lisp' stuff in the definition of
`dired-sort-menu-saved-config', but for now just try setting that option to nil
(see above).

Dunno whether that will help, but it might get you past an initial hurdle.  My
guess is that some code in dired-sort-menu.el is trying at some point to
evaluate an undefined `ls-lisp*' variable, and that is causing your problems.

Don't forget to correspond with the author of `dired-sort-menu.el' about this.
I don't know that my guess is correct that there might be a bug here - check
with the author, Francis J. Wright.  Be sure to tell him what version of
dired-sort-menu.el you, use etc.  My guess is that there is a trivial fix, if in
fact there is a bug and not just operator error.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]