unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Function menu missing from top window bar!!
@ 2016-07-15 13:07 Tom Browder
  2016-07-15 13:29 ` tomas
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tom Browder @ 2016-07-15 13:07 UTC (permalink / raw)
  To: help-gnu-emacs

I'm coming from XEmacs after 20 years.  I miss two things I hope I can
get back somehow:

1.  A top bar menu button that shows the function declarations for
various languages.  Click on a desired function and point goes there.

2.  A submenu item that sorts selected text in a buffer.

Are they available in Emacs?

Thanks so much.

Best regards,

-Tom



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

* Re: Function menu missing from top window bar!!
  2016-07-15 13:07 Function menu missing from top window bar!! Tom Browder
@ 2016-07-15 13:29 ` tomas
  2016-07-15 13:44 ` Drew Adams
  2016-07-15 13:56 ` Stefan Monnier
  2 siblings, 0 replies; 12+ messages in thread
From: tomas @ 2016-07-15 13:29 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Jul 15, 2016 at 08:07:19AM -0500, Tom Browder wrote:
> I'm coming from XEmacs after 20 years.  I miss two things I hope I can
> get back somehow:
> 
> 1.  A top bar menu button that shows the function declarations for
> various languages.  Click on a desired function and point goes there.

This sounds vaguely familiar. When you have a source file in the
buffer, try "M-x speedbar" and see whether the result suits your
taste.

> 2.  A submenu item that sorts selected text in a buffer.

Don't know about this one, sorry. Do you want to sort the lines
alphabetically? Does "M-x sort-lines" do what you want?

Regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAleI5TYACgkQBcgs9XrR2kZIkQCdEOP36VzK9SGxeLIGzBVkoo4Q
4a0An1bx9obyCmVh7XGdUkN67kcW0JRA
=PFhu
-----END PGP SIGNATURE-----



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

* RE: Function menu missing from top window bar!!
  2016-07-15 13:07 Function menu missing from top window bar!! Tom Browder
  2016-07-15 13:29 ` tomas
@ 2016-07-15 13:44 ` Drew Adams
  2016-07-15 13:56 ` Stefan Monnier
  2 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2016-07-15 13:44 UTC (permalink / raw)
  To: Tom Browder, help-gnu-emacs

> 1.  A top bar menu button that shows the function declarations for
> various languages.  Click on a desired function and point goes there.

Imenu - `imenu-add-menubar-index'.

See these nodes in the Emacs and Elisp manuals:

http://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html

http://www.gnu.org/software/emacs/manual/html_node/elisp/Imenu.html

> 2.  A submenu item that sorts selected text in a buffer.

Not clear what you mean.  Sort selected text in what way?
What kind of selection?

There are several commands and other functions for sorting the
text in the region.  See these sections of the Emacs and Elisp
manual:

http://www.gnu.org/software/emacs/manual/html_node/emacs/Sorting.html

http://www.gnu.org/software/emacs/manual/html_node/elisp/Sorting.html

If you know the name or some other words that can help you find
the info you want then visit the manuals and use `i' to find
what you need.  In this case, without knowing "imenu" you might
not have found the first easily.  But `i sort TAB' finds the
second easily.



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

* Re: Function menu missing from top window bar!!
  2016-07-15 13:07 Function menu missing from top window bar!! Tom Browder
  2016-07-15 13:29 ` tomas
  2016-07-15 13:44 ` Drew Adams
@ 2016-07-15 13:56 ` Stefan Monnier
  2016-07-18 11:37   ` Tom Browder
  2016-12-31  0:07   ` Tom Browder
  2 siblings, 2 replies; 12+ messages in thread
From: Stefan Monnier @ 2016-07-15 13:56 UTC (permalink / raw)
  To: help-gnu-emacs

> 1.  A top bar menu button that shows the function declarations for
> various languages.  Click on a desired function and point goes there.

You mean XEmacs's func-menu (IIRC)?  It's called "imenu" in Emacs.
Try M-x imenu RET or M-x imenu-add-menubar-index RET

> 2.  A submenu item that sorts selected text in a buffer.

M-x sort-lines ?  I don't think there's a menu entry for it, so you'd
have to add that entry manually from your .emacs.


        Stefan




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

* Re: Function menu missing from top window bar!!
  2016-07-15 13:56 ` Stefan Monnier
@ 2016-07-18 11:37   ` Tom Browder
  2016-12-31  0:07   ` Tom Browder
  1 sibling, 0 replies; 12+ messages in thread
From: Tom Browder @ 2016-07-18 11:37 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

On Fri, Jul 15, 2016 at 8:56 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
...

Thanks Tomas, Drew, and Stefan!  Very helpful.

Best regards,

-Tom



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

* Re: Function menu missing from top window bar!!
  2016-07-15 13:56 ` Stefan Monnier
  2016-07-18 11:37   ` Tom Browder
@ 2016-12-31  0:07   ` Tom Browder
  2017-01-03 15:25     ` Tom Browder
  1 sibling, 1 reply; 12+ messages in thread
From: Tom Browder @ 2016-12-31  0:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

On Fri, Jul 15, 2016 at 8:56 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>
> > 1.  A top bar menu button that shows the function declarations for
> > various languages.  Click on a desired function and point goes there.
>
> You mean XEmacs's func-menu (IIRC)?  It's called "imenu" in Emacs.
> Try M-x imenu RET or M-x imenu-add-menubar-index RET

Okay, I have that working.  Now I just need to sort the entries.  Here
is the fragment of code that does the menu entry:

;;=======================================
(defvar perl6-imenu-generic-expression
  `(
    ;; the names are in reverse desired order since they are evaluated
here last first
    ("Classes" ,perl6-classes-regex 1)
    ("Variables" ,perl6-vars-regex 1)
    ("Subs/Methods" ,perl6-subs-regex 1)
    )
      "Define interesting points in the Perl 6 buffer for `imenu'.

This is used to set `imenu-generic-expression' when Perl 6 mode is
entered.  Subsequent changes to `perl6-imenu-generic-expression' will
not affect existing Perl 6 buffers because imenu-generic-expression is
a local variable.")
;;============================================

Now, how do I get each submenu sorted by name?

I see reference to a sort option, but not clear on how to add it to what I have.

Thanks.

Best regards,

-Tom



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

* Re: Function menu missing from top window bar!!
  2016-12-31  0:07   ` Tom Browder
@ 2017-01-03 15:25     ` Tom Browder
  2017-01-03 17:01       ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Browder @ 2017-01-03 15:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

On Fri, Dec 30, 2016 at 6:07 PM, Tom Browder <tom.browder@gmail.com> wrote:
...
> ;;============================================
>
> Now, how do I get each submenu sorted by name?
>
> I see reference to a sort option, but not clear on how to add it to what I have.

Ping.

-Tom



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

* Re: Function menu missing from top window bar!!
  2017-01-03 15:25     ` Tom Browder
@ 2017-01-03 17:01       ` Stefan Monnier
  2017-01-03 17:12         ` Drew Adams
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2017-01-03 17:01 UTC (permalink / raw)
  To: Tom Browder; +Cc: help-gnu-emacs

>> Now, how do I get each submenu sorted by name?
>> I see reference to a sort option, but not clear on how to add it to
>> what I have.

> Ping.

I can't remember how it's supposed to work, but when you do M-x imenu
the *Completions* should be sorted by virtue of the normal sorting
performed by the completion UI.  If you like your GUI menu to be sorted
when selecting with the mouse, there's imenu-sort-function which you can
set via M-x customize-variable.  It's supposed to be a user-preference
rather than being imposed by the author of the major mode.


        Stefan



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

* RE: Function menu missing from top window bar!!
  2017-01-03 17:01       ` Stefan Monnier
@ 2017-01-03 17:12         ` Drew Adams
  2017-01-03 18:51           ` Tom Browder
  0 siblings, 1 reply; 12+ messages in thread
From: Drew Adams @ 2017-01-03 17:12 UTC (permalink / raw)
  To: Stefan Monnier, Tom Browder; +Cc: help-gnu-emacs

> I can't remember how it's supposed to work, but when you do M-x imenu
> the *Completions* should be sorted by virtue of the normal sorting
> performed by the completion UI.  If you like your GUI menu to be sorted
> when selecting with the mouse, there's imenu-sort-function which you can
> set via M-x customize-variable.  It's supposed to be a user-preference
> rather than being imposed by the author of the major mode.

Set the option value to `imenu--sort-by-name'.  The option doc
tells you:

  "Set it to `imenu--sort-by-name' if you want alphabetic sorting."



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

* Re: Function menu missing from top window bar!!
  2017-01-03 17:12         ` Drew Adams
@ 2017-01-03 18:51           ` Tom Browder
  2017-01-03 18:58             ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Browder @ 2017-01-03 18:51 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Stefan Monnier

On Tue, Jan 3, 2017 at 11:12 AM, Drew Adams <drew.adams@oracle.com> wrote:
>> I can't remember how it's supposed to work, but when you do M-x imenu
>> the *Completions* should be sorted by virtue of the normal sorting
>> performed by the completion UI.  If you like your GUI menu to be sorted
>> when selecting with the mouse, there's imenu-sort-function which you can
>> set via M-x customize-variable.  It's supposed to be a user-preference
>> rather than being imposed by the author of the major mode.
>
> Set the option value to `imenu--sort-by-name'.  The option doc
> tells you:
>
>   "Set it to `imenu--sort-by-name' if you want alphabetic sorting."

Yes, Drew, I read that, but I need to know EXACTLY how to do that?
Where does the option value go?  That's what's confusing about the
emacs manual: fragments that assume you know all about everything
lisp!  I need a recipe here!

Thanks.

-Tom



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

* Re: Function menu missing from top window bar!!
  2017-01-03 18:51           ` Tom Browder
@ 2017-01-03 18:58             ` Stefan Monnier
  2017-01-03 19:10               ` Tom Browder
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2017-01-03 18:58 UTC (permalink / raw)
  To: Tom Browder; +Cc: help-gnu-emacs

> emacs manual: fragments that assume you know all about everything
> lisp!  I need a recipe here!

That's why I gave you the recipe M-x customize-variable ;-)


        Stefan



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

* Re: Function menu missing from top window bar!!
  2017-01-03 18:58             ` Stefan Monnier
@ 2017-01-03 19:10               ` Tom Browder
  0 siblings, 0 replies; 12+ messages in thread
From: Tom Browder @ 2017-01-03 19:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

On Tue, Jan 3, 2017 at 12:58 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> emacs manual: fragments that assume you know all about everything
>> lisp!  I need a recipe here!
>
> That's why I gave you the recipe M-x customize-variable ;-)

Sorry, Stefan--that works.  I didn't read all your help thoroughly
since I wanted to put in my mode file with the indent description.

Your method works fine!

Best regards,

-Tom



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

end of thread, other threads:[~2017-01-03 19:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-15 13:07 Function menu missing from top window bar!! Tom Browder
2016-07-15 13:29 ` tomas
2016-07-15 13:44 ` Drew Adams
2016-07-15 13:56 ` Stefan Monnier
2016-07-18 11:37   ` Tom Browder
2016-12-31  0:07   ` Tom Browder
2017-01-03 15:25     ` Tom Browder
2017-01-03 17:01       ` Stefan Monnier
2017-01-03 17:12         ` Drew Adams
2017-01-03 18:51           ` Tom Browder
2017-01-03 18:58             ` Stefan Monnier
2017-01-03 19:10               ` Tom Browder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).