emacs-devel
[Top][All Lists]
Advanced

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

Re: dropdown-list.el


From: SAKURAI Masashi
Subject: Re: dropdown-list.el
Date: Sun, 22 May 2011 15:13:35 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/23.2 Mule/6.0 (HANACHIRUSATO)

At Fri, 20 May 2011 22:00:50 -0400,
Chong Yidong wrote:
> :
> It might be worth putting dropdown-list.el in Emacs core.  The code is
> not up to Emacs standards, but it is a relatively small library, and so
> should not be hard to clean up.  Has anyone taken a look at this before?
> Opinions welcome.

How about popup.el?
It was posted to gnu-emacs-sources on 7 March 2011 by Matsuyama san.
https://github.com/m2ym/popup-el/tree/v0.4

I compared three functions:
- dropdown-list (dropdown-list.el)
- popup-menu    (mouse.el)
- popup-menu*   (popup.el).

I attached the sample code in which the menus select from a string
list and insert a string.


* dropdown-list (dropdown-list.el)

The code is very short (about 260 lines) and easy to use.  Because the menu is 
drawn by
overlay texts, one can use this function in the terminal.

I think the library is too simple for general purposes. 
Particularly, this library can not treat many items well.

* popup-menu (mouse.el)

This function is included in the current Emacs. The menu is drawn by
the GUI menu, so one can not use in the terminal. The construction of
menu items is the same as the usual menu keymaps. But I think it is
little difficult to use for the quick selecting for transient menu
items.

* popup-menu* (popup.el)

The menu is also drawn by overlay texts, so one can use it in the terminal.
The code is not short (about 1000 lines), but it has many functions
and customization points for the general purposes.
It has following functions:

- one can scroll the menu in the case of many items
- incremental search and narrowing
- one can construct a cascading menu
- a menu item can display the summary and documentation 
  like completion menus in the Eclipse and Visual Studio.

The library popup.el is used by auto-complete 
(http://cx4a.org/software/auto-complete/).



I hope this article is helpful for discussion.

--
SAKURAI, Masashi (family, given)

Attachment: popup-test.el
Description: Binary data


reply via email to

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