logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

patch for fortran modes: msg#00044

editors.jed.user

Subject: patch for fortran modes

I recently needed to edit a fortran file and had problems with the TAB
indent key. The problem is caused by having previously used 'text-mode',
which causes the "indent_line" bind to get lost:

public define text_mode()
{
...
local_setkey ("text_indent_relative", "\t");
%set_buffer_hook ("indent_hook", "text_indent_relative");
...
}

For extra safety (and parallel to some other modes) I've added the required
key binding explicitly to fortran.sl and f90.sl

/mark

--- fortran.sl.orig 2006-08-28 12:09:09.000000000 +0200
+++ fortran.sl 2006-09-28 10:09:08.000000000 +0200
@@ -336,6 +336,7 @@
$1 = "Fortran";
!if (keymap_p ($1)) make_keymap ($1);

+definekey ("indent_line", "\t", $1);
definekey ("fortran_comment", "\e;", $1);
definekey ("fortran_uncomment", "\e:", $1);
definekey ("fortran_continue_newline", "\e\r", $1);
--- f90.sl.orig 2006-08-28 12:09:09.000000000 +0200
+++ f90.sl 2006-09-28 10:29:44.000000000 +0200
@@ -27,6 +27,7 @@
variable cs = CASE_SEARCH;
variable ch;

+% FIX: replace USER_BLOCK0 with bol_skip_white()
% goto beginning of line and skip past tabs and spaces
USER_BLOCK0
{
@@ -43,11 +44,13 @@
bol_skip_white();
if (eolp() or looking_at("!") or looking_at("&") or looking_at("#")
)
continue;
+% FIX: replace USER_BLOCK0 with bol_skip_white()
X_USER_BLOCK0 ();
goal = what_column ();

% if (goal == 1) continue;

+% FIX: replace with skip_chars ("0-9 \t");
skip_chars (" \t1234567890");
if (looking_at("do ") or looking_at("else")
or looking_at("function")
@@ -88,6 +91,7 @@
% now check current line
pop_spot ();
push_spot ();
+% FIX: replace USER_BLOCK0 with bol_skip_white()
X_USER_BLOCK0 ();

if (looking_at("end") )
@@ -123,12 +127,13 @@
switch (ch)
{
case F90_Continue_Char : % continuation character
- bol (); trim ();
+ bol_trim ();
+% FIX: insert content of USER_BLOCK1 and simplify
X_USER_BLOCK1 ();
}
{
not (bolp()) or eolp (): % general case
- bol (); trim ();
+ bol_trim ();
goal--;
insert_spaces (goal);
}
@@ -187,14 +192,14 @@

if (cont1)
{
- insert( " " );
+ insert_single_space();
insert(F90_Continue_Char);
}
newline ();
if ( cont )
{
insert(F90_Continue_Char);
- insert( " " );
+ insert_single_space();
}
insert_single_space ();
free_f90_indent ();
@@ -284,19 +289,19 @@

if (what_column () >= 6)
{
- bol (); trim ();
+ bol_trim ();
insert_single_space ();
}
X_USER_BLOCK1 ();
}
{
case F90_Continue_Char : % continuation character
- bol (); trim (); insert (" ");
+ bol_trim (); insert (" ");
X_USER_BLOCK1 ();
}
{
not (bolp()) or eolp (): % general case
- bol (); trim ();
+ bol_trim ();
goal--;
insert_spaces (goal);
}
@@ -565,6 +570,7 @@
$1 = "F90";
!if (keymap_p ($1)) make_keymap ($1);

+definekey ("indent_line", "\t", $1);
definekey ("f90_comment", "\e;", $1);
definekey ("f90_uncomment", "\e:", $1);
definekey ("f90_continue_newline", "\e\r", $1);



This e-mail message and any attachments may contain legally privileged,
confidential or proprietary Information, or information otherwise protected by
law of ArvinMeritor, Inc., its affiliates, or third parties. This notice serves
as marking of its ?Confidential? status as defined in any confidentiality
agreements concerning the sender and recipient. If you are not the intended
recipient(s), or the employee or agent responsible for delivery of this message
to the intended recipient(s), you are hereby notified that any dissemination,
distribution or copying of this e-mail message is strictly prohibited. If you
have received this message in error, please immediately notify the sender and
delete this e-mail message from your computer.





<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo