Re: Why cluehunting ?



>  After browsing through the document I still have the same questions.
>  
>  1. Why does this have anything to do with the Gnome-UI

The widgets in the UI would implement the completion functionality.
Since this is expected to be present in as many places as possible, it
is of concern to the GNOME UI.

>  2. Why must all programs have this function.

It is generally convenient to be able to do string completion.  Some
of the proposed extensions (i.e. browse through lists of words to
complete) could be useful as well.

>  3. Why should I want autocompletion (I for one hate it)

There should be an option to enable/disable autocompletion.  I am not
sure I like it myself.  As for user-requested completion, I think it
presents no problems.

>  4. How should it be possible to implement?

Some things have to be done:

	- Glib already has a low-level string completion facility; I
          assume this would be the foundation of the cluehunting
          stuff.

	- Implement an API on top of Glib's GCompletion to make using
          different completion contexts easy.  This is the "big" part.

	- We can easily modify the GnomeEntry widget to use the
          cluehunting API, so all GNOME applications that use the
          GnomeEntry widget would get at least the most basic
          cluehunting functionality for free.

The API mentioned in the second point could later be used by
programmers to extend their own widgets with the completion contexts
that are relevant to their application -- a word processor could
implement a spell-checking context, or a programmer's editor could
implement symbol completion (like Emacs tags), for example.

I have not thought much about it, but off the top of my head I can see
two completion behaviors:

	- Dynamic completion, like in Emacs "dabbrevs".  This lets you
          type the first characters of a word, hit a hot key, and have
          the program look for words that start with the same
          characters and complete the word for you.  If there are
          several possible completions, you can hit the key again and
          iterate through them.  Emacs uses the M-/ key to do this;
          since it does not conflict with any of the existing
          keybindings for GnomeEntry, it could be put in without
          problems.

	  I guess a first implementation could store a global list of
	  pointers to the GnomeEntries in the program.  When the user
	  hits the dabbrev-expand hot key, the program goes through
	  all the GnomeEntries in the list trying to look for strings
	  that match the requested completion.

	  I am not sure how this can be extended to work among
	  different processes (ideally, I would assume you would want
	  dynamic completion among all the strings you have typed in
	  your open programs).  This can be tricky, and is not
	  indispensable for a first implementation.

	- Application-defined completion.  This is the "check spelling
          of this word" or "complete code symbol" or "complete this
          phone number from my addressbook" functionality.  Emacs uses
          M-Tab for this to complete program symbols (it uses plain
          Tab to complete possible choices in minibuffer entries; it
          does not use plain Tab in editing buffers since that is used
          to insert a tab character or auto-indent the current line,
          depending on the mode's bindings).

	  This needs some design work, and it is not indispensable for
	  a first implementation.

Implementing dynamic completion for all GnomeEntries (a la M-/ in
Emacs) can be done in a day's work.

>  5. Why should a word processor ask something other than ispell about
>     how to spell a certain word?

Spell checking of a word is one of the possible functions.  Another
function could be "complete this guy's name from my addressbook", or
"complete this phone number".  It is up to the program to decide what
functionality is appropriate for it.

>  6. Have you tried flyspell.el with emacs? (http://kaolin.unice.fr/~serrano/)

Sounds like a cool thing to have in Emacs.  I'll give it a try.

  Federico



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