jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Folding (was: Re: towards 1.0)


Second try. I did not notice that the new list requires List-Reply instead
of Reply (Nevertheless, I really appreciate the move from yahoo)
(Sorry Romano, and thanks for the hint)

------ Forwarded message ------

On Tue, 5 Mar 2002 11:09:01 +0100 wrote Romano Giannetti
<romano@xxxxxxxxxxxxxxxx>:

> I think that one of the problem of folding mode is that it is treated like a
> mode by itself, when it really is an orthogonal thing. So, if you enter
> latex mode, for example, and the folding mode, you loose some useful
> keystrokes, and in the menu just the latex mode functions do appear. 

Now I come to the conclusion, that "mode" is actually used for three
orthogonal things (i.e. jed is at least 3d :-)

  1. Emulation modes (_Jed_Emulation) 
       * valid for all buffers
       * set the general behaviour (global variables, common bindings
         (Global-map))
       * generally emulating the keybindings of a famous editor 
       * E.g.: emacs, ide, brief 
     
  2. "Language" modes 
       * buffer specific
       * tailored towards a type of document (c-code, Slang-code, html, ...)
       * modify the general behaviour
       * enhance the functionality of jed (new functions, new bindings
         (Modename_map) (preferabely using _Reserved_Key_Prefix))
       * the "actual" modes that set the modename to appear in the status line 
       * e.g. Text, Slang, Python, Gnuplot

  3. "feature" modes (or minor modes or auxiliary modes or additional modes 
                                  or editing modes or temporary modes ...)
       * buffer specific
       * unspecific regarding the type of document
       * enhance the functionality of jed (new functionality, new bindings
         (better not using _Reserved_Key_Prefix))
       * E.g.: folding_mode, ishell_mode
       
       (BTW: I currently think about making incremental search and marking
       temporary "feature" modes that push the actual
       keymap and pop it up when finished.)
 
> I think that folding mode should use a set of keystrokes starting with
> something different from _Reserved_Key_Prefix, and that its function should
> add to the menubar. 

On Tue, 5 Mar 2002 12:52:58 -0500 wrote "John E. Davis" <davis@xxxxxxxxxxxxx>:

> I do not see a way to use a different set of key-sequences without
> conflicting with one emulation or the other.  Since there are only a limited
> number of universally applicable key-sequences available, I do not see
> a general solution to the problem (given M keys and N functions where
> N>M).

To avoid clashes, the keybindings should be (generally) set by the emulation
modes. Language modes and feature modes _might_ help using variables:

   _Reserved_Key_Prefix (for language modes) and
   Folding_Key_Prefix, Isearch_Key_Prefix, ... (for feature modes)

It is up to the emulation mode (or the users .jedrc) to set the Key_Prefixes.

IMHO it would be better, if instead of custom variables this would be
"optional" variables: If the *_Key_Prefix is not set, no bindings occure.
This would ensure that a language or feature mode does not bind a key if not
said to do so by the emulation mode (or .jedrc). 

This would give the emulation (or the user) the choice to either make up its
own keybinding set from scratch or to choose the predefined subset to a
*_Key_Prefix while a default *_Key_Prefix will eventually lead to clashes.


On Tue, 5 Mar 2002 19:48:19 +0100 wrote Romano Giannetti
<romano@xxxxxxxxxxxxxxxx>:

> I use (although I suspect I should say _mis_use) this in my latex_mode_hook() 
> 
>         _Reserved_Key_Prefix = "\006"; % ^F
>         folding_mode();
>         _Reserved_Key_Prefix = "\003";
> 
> and I have the folding-commands mapped to ctrl-f something; it is handy for
> me because I never use the ctrl-f to do the next-char movement (I use
> arrows). It's suboptimal but it works...

A nice workaround until the implementation of the above proposal of a
Folding_Key_Prefix.
(Although I won't use it becouse I have ^F bound to Find ;-) 

On Tue, 5 Mar 2002 16:36:44 -0500 wrote "John E. Davis" <davis@xxxxxxxxxxxxx>:

> Hi,
> 
>     Here are some patches that put folding entries in the menus.  I
> think this patch illustrates a technique for adding so-called minor
> modes to the menu system.  The patch affects 3 files: popups.sl,
> folding.sl, and menus.sl.

I like it. Also, it tells me how to implement a menu support for my
ishell_mode :-)

(BTW: What is the simplest/fastest way to implement the patches when I have
opened the mail in jed? Any volunteers for a nice patch-support?)
 
> However,
> I think that it is also important for someone unfamiliar with the
> concept to read the documentation about folding.  I will see what I
> can come up with.

How about a Folding_Help topic at the end of the Folding submenu? It could
just open folding.txt in a buffer as Help>Browse_Docs>folding does but would
offer a kind of "context help" and would be a remainder that there is
something interesting to read.

Guenter


-------- End of message -------
--
G.Milde@xxxxxxxxxxxxxxxxxxxx


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]