jed-users mailing list

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

Re: Folding & Perl Mode


Hi,

I also had this problem.

Here are my changes to perl.sl and they appear to work!
It is the last two changes that really matter.
Could this be added to the next distribution ?

(first line is old, second line is new!)

56c56
< %   I changed the folding marks from the '#{{{' and '#}}}' to
---
%   I changed the folding marks from the '# {{{' and '# }}}' to
135c135
< % past the previous line containing an opening \exmp{'\{'} character.
---
% past the previous line containing an opening \var{'{'} character.
541c541
< 	{not( blooking_at("#{{") ) }	% don't match '#{{{' fold
---
	{not( blooking_at("# {{{") ) }	% don't match '# {{{' fold
1174c1174
<     mode_set_mode_info(mode, "fold_info", "#{{{\r#}}}\r\r");
---
    mode_set_mode_info(mode, "fold_info", "# {{{\r# }}}\r\r");


Regards,
         Thei Wijnen.

+-------+-------+-------+-------+-------+-------+-------+-------+---+

On Wed, 20 Jun 2007, martin@xxxxxxxxxxx wrote:


The default fold marker "#{{{" doesn't work nicely with indentation in
perl. For example:

if (1) {
   some_code();
   if (0) {
   #{{{1st fold
#indentation lost
some_more_code();
#}}}
   # indentation level restored
   more_code();
}

Changing the fold marker to "# {{{" would seem to fix the indentation
problem, but I have not been able to accomplish this.

I have read this thread (see link below) and tried the example code, but I
cannot seem to get perl mode to use anything besides the default fold
marker.

 http://207.106.6.205/jed-users/msg01903.html

This is my .jedrc :

LINENUMBERS=1;
USE_TABS=0;

Fold_Mode_Ok = 1;

% see http://207.106.6.205/jed-users/msg01903.html
define global_mode_hook (mode_hook)
{
  switch (mode_hook)
    {
     case "sh_mode_hook":
       mode_set_mode_info ("SH", "fold_info", "# {{{\r# }}}\r\r");
     case "perl_mode_hook":
       mode_set_mode_info ("PERL", "fold_info", "# {{{\r# }}}\r\r");
    }

  if (NULL == mode_get_mode_info ("fold_info"))
    mode_set_mode_info ("fold_info", "# {{{\r# }}}\r\r");
  if (mode_hook != "fold_mode_hook")
    folding_mode ();
}

Has anyone successfully change the fold marker for perl?

Martin




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


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


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