jed-users mailing list

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

Re: TODO or not TODO


On 22.12.09, Jörg Sommer wrote:
> frank <y199mp1505@xxxxxxxxx> wrote:
> > > Can you explain a little bit further what you mean by these points?
> >
> > ... folding could be done on the fly based on
> > selection or objects, e.g. functions.

> I can't follow you. Jed's folding uses the function set_line_hidden().
> This doesn't need any hardcoding in the text. 
...
> If you talk about markers {{{ and }}}, I don't like them, too. But they
> are an incapability of the ...

... standard "folding" mode.

I have an uncomplete implementation of a folding mode based on regular
expressions (pcre) that build upon the filter-buffer mode on Jedmodes,
http://jedmodes.sourceforge.net/mode/filter-buffer/


> > Of course, moving from hardcoded features like hardwrap

> The softwrap is a feature that needs to be done in jed's core.

I would like to see it as a display alternative to the HORIZONTAL_PAN
of overlong lines.

> > My mention of text mode keymap issues is just a reminder.
> > I'm neither proposing nor expecting any action on them. Most
> > jed users are xjed users and xjed does not have keymap
> > problems.

> Caution with such speculations.

Given its small footprint, Jed is an ideal editor for netbooks or the XO
laptop. I did, however, experience problems with the "archaic" font setup
for xjed. Even after heavy experimenting with font settings in my
~/.Xresources the resulting font is either too large for the small screen
or too pixly and too small for easy reading.  In contrast, many
X-terminal-emulators enable easy font selection and usage of a wide range
of fonts via the fontconfig library.

Thus I end up with the choice of either limited keybindings or limited
readabilty.

Günter

% pcre-fold.sl: fold and navigate using pcre regular expressions
%
% Copyright (c) 2007 Günter Milde
% Released under the terms of the GNU General Public License (ver. 2 or later)

% Usage
% -----
% Place in the jed library path.
%
% Versions
% --------
% 2007-11-09  0.1   * first draft.
% 2009-12-08  0.1.1 * adapt to new require() syntax in Jed 0.99.19.

% Requirements
% ------------

% modes from http://jedmodes.sf.net/
#if (_jed_version > 9918)
require("filter-buffer", "Global"); % pcre search/filter functions
#else
require("filter-buffer"); % pcre search/filter functions
#endif
autoload("get_local_var", "bufutils"); % >= 1.18

% see also extra/jedpcre.sl: pcrs search functions by PB
% TODO: use autoloads instead of require?


% Patterns
% --------

% The pcre_fold_patterns is an array or a list of regular expressions matching
% with language "tokens" with increasing verbosity.
%
mode_set_mode_info("SLang", "pcre_fold_patterns",
		   ["^(public define|custom_variable)",
		    "^(define|public variable)",
		    "^(static (define|variable)|%\\\\synopsis)",
		    "^(private (define|variable))"
		   ]);


% Functions
% ---------

private define get_fold_pattern(l_min, l_max)
{
   variable fold_patterns = get_local_var("pcre_fold_patterns");
   return strjoin(fold_patterns[[l_min:l_max]], "|");
}

% Fold the buffer according to mode-dependent tokens.

% fold buffer, leaving only lines matching the token regexp for the current
% mode visible
public define pcre_fold(level)
{
   variable pattern = get_fold_pattern(0, level-1);
   vshow("level %d, pattern: %s", level, pattern);
   set_buffer_hidden(1);
   set_matching_hidden(0, pattern);
}

% Minor mode for folding with a hierarchy of pcre patterns

public define pcre_fold_mode()
{
   % settings
   set_line_number_mode(1);

   % TODO
   % keybindings

   % mode-menu (?)

   run_mode_hooks("prce_fold_mode_hook");
}

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