Jens Wahnes | 2 Jul 2009 15:29
Picon
Favicon

Re: Trouble with mail_mode (email.sl et al.)

On Mon, Jun 29 2009, at 11:42:38 +0200, Jens Wahnes wrote:

> However, the other problem I mentioned before remains: Even if I start
> wjed with "-f mail_mode", mail_mode is not activated (quotes are the
> same color as other text).  I have to do Esc x mail_mode to activate it
> every time.

That seems to have something to do with the file name.  The files I'm
using have got an .txt extension, and in this case, text mode is
automatically selected instead of mail mode.  The code responsible for
selecting the proper mode in site.sl seems quite complicated to me.  Is
there an easy way to override this mode selection for certain files?

Jens
Swithun Crowe | 2 Jul 2009 16:06
Favicon
Gravatar

Re: Trouble with mail_mode (email.sl et al.)

Hello

JW That seems to have something to do with the file name.  The files I'm 
JW using have got an .txt extension, and in this case, text mode is 
JW automatically selected instead of mail mode.  The code responsible for 
JW selecting the proper mode in site.sl seems quite complicated to me.  
JW Is there an easy way to override this mode selection for certain files?

There are a couple of things I can think of:

1. put '-*- mail -*-' at the top of files that you want opened with 
mail_mode

2. create a new extension ('.email' for example) and add this to site.sl

In site.sl, there should be 2 long lines. One has a list of extensions, 
and the other has a corresponding list of modes. Add 'email' (or whatever 
extension you choose) to the list of extensions, and add 'mail' to the 
list of modes.

If a file site.slc exists, then you may need to byte compile your new 
site.sl.

There are probably some other ways of achieving what you want, given the 
flexibility of jed.

Swithun.

G. Milde | 3 Jul 2009 23:32
Picon

Re: Trouble with mail_mode (email.sl et al.)

On  2.07.09, Swithun Crowe wrote:

> There are probably some other ways of achieving what you want, given the 
> flexibility of jed.

Indeed.

1. You can call Jed with the mode.

In my muttrc, I have:

   set editor="xjed %s -tmp --mail_mode"

2. You can set the mode on any test that is possible with S-Lang in a
   function you add to _jed_set_mode_hooks.

In my jed.rc, I have:

% set modes based on filename or more complicated patterns
static define set_modes_hook(ext)
{
   switch (path_basename(buffer_filename()))
     { case ".pycmailrc":  python_mode(); return 1; }
     { case "Makefile":    make_mode();   return 1; }
     { case ".bashrc":     sh_mode();  return 1; }
   return(0);
}

append_to_hook("_jed_set_mode_hooks", &set_modes_hook);

(Continue reading)

Jens Wahnes | 4 Jul 2009 11:24
Picon
Favicon

Re: Trouble with mail_mode (email.sl et al.)

On Fri, Jul 03 2009, at 23:32:42 +0200, G. Milde wrote:

> 1. You can call Jed with the mode.
> 
> In my muttrc, I have:
> 
>    set editor="xjed %s -tmp --mail_mode"

Ah!  So that's where my mistake was.  In my attempts to turn on
mail_mode, I'd always put "-f mail_mode" or "--mail_mode" *before* the
name of the file to be edited instead of after.  I guess I'm just so
much used to putting parameters first and file name(s) last (as it is
common with most programs) so I didn't try it the other way around. 
But as I think about it, doing it "the usual way" probably wouldn't
work well with jed as one can open multiple files at once, and if all
parameters were to be put first, it would be difficult to tell which
file was to be opened in which mode.

> % set modes based on filename or more complicated patterns
> static define set_modes_hook(ext)
> {
>    switch (path_basename(buffer_filename()))
>      { case ".pycmailrc":  python_mode(); return 1; }
>      { case "Makefile":    make_mode();   return 1; }
>      { case ".bashrc":     sh_mode();  return 1; }
>    return(0);
> }
> append_to_hook("_jed_set_mode_hooks", &set_modes_hook);

Well, it seems I don't need to do something like this now, as the above
(Continue reading)

Peter Bengtsson | 6 Jul 2009 11:00
Favicon
Gravatar

"recent_file_goto_point is undefined" after upgrading to latest Ubuntu

--------(Jed 0.99.18U) Emacs: *scratch*    ()  1/1
---------------------------------------------
recent_file_goto_point is undefined

TRACEBACK:

/home/peterbe/.jedrc:245:<top-level>:Undefined Name
Traceback: evalfile
/usr/share/jed/lib/site.sl:3076:command_line_hook:Undefined Name
  Local variables for command_line_hook:
        Integer_Type n = 1
        Integer_Type i = 1
        String_Type file = "zpt/invoices/company-invoices.zpt"
        Integer_Type depth = 0
        Undefined_Type next_file = Undefined_Type
        Undefined_Type tmp = Undefined_Type
        String_Type init_file = "/home/peterbe/.jedrc"
        Undefined_Type next_file_arg = Undefined_Type
***string***:-1:<top-level>:Undefined Name
Traceback: called from eval: .()command_line_hook

MY .JEDRC:

243| % % Load recent.sl (assuming it is in the jed library path)
244| require("recent");
245| add_to_hook("_jed_find_file_after_hooks", &recent_file_goto_point);

--

-- 
Peter Bengtsson,
work www.fry-it.com
(Continue reading)

John E. Davis | 14 Jul 2009 16:45
Picon
Favicon

Re: "recent_file_goto_point is undefined" after upgrading to latest Ubuntu

Peter Bengtsson <mail <at> peterbe.com> wrote:
> --------(Jed 0.99.18U) Emacs: *scratch*    ()  1/1
> ---------------------------------------------
> recent_file_goto_point is undefined

Perhaps you were using a version of recent.sl from the jed modes
repository.  I have no record of such a function in the stock version
of recent.sl.

Thanks,
--John

Peter Bengtsson | 17 Jul 2009 11:51
Favicon
Gravatar

Re: "recent_file_goto_point is undefined" after upgrading to latest Ubuntu

2009/7/14 John E. Davis <davis <at> space.mit.edu>:
> Peter Bengtsson <mail <at> peterbe.com> wrote:
>> --------(Jed 0.99.18U) Emacs: *scratch*    ()  1/1
>> ---------------------------------------------
>> recent_file_goto_point is undefined
>
> Perhaps you were using a version of recent.sl from the jed modes
> repository.  I have no record of such a function in the stock version
> of recent.sl.
>
Thanks John,
For some reason recent.sl was the one from April 2001. An ubuntu
upgrade must have somehow got things wrong.
I think I've fiddled with this before and maybe names things wrongly
to confuse Ubuntu.
Now I've got the latest from jedmodes and it works.

> Thanks,
> --John
>
> --------------------------
> To unsubscribe send email to <jed-users-request <at> jedsoft.org> with
> the word "unsubscribe" in the message body.
> Need help? Email <jed-users-owner <at> jedsoft.org>.
>

--

-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
(Continue reading)

Cesar Romani | 17 Jul 2009 16:35
Picon

Search and other functions don't work

I've installed jed 0.99.19.195 based on slang 2.2.0-121 on Windows XP.
with mingw and I've got jed.exe and wjed.exe
Whenever I search on a file using the menu or with CTRL-S, it appears:
Unable to open require. Check the value of the S-Lang load path

And whenever I open a file using CTRL-X CTRL-F, the file gets loaded but
with the message:
Directory <directory> is invalid

And when I edit a file and save it, I cannot edit it next time because
the file has become read-only.

Many thanks in advance,
Cesar

John E. Davis | 17 Jul 2009 20:57
Picon
Favicon

Re: Search and other functions don't work

Cesar Romani <cesar.romani <at> gmail.com> wrote:
> I've installed jed 0.99.19.195 based on slang 2.2.0-121 on Windows XP.
> with mingw and I've got jed.exe and wjed.exe
> Whenever I search on a file using the menu or with CTRL-S, it appears:
> Unable to open require. Check the value of the S-Lang load path

jed picks up require.sl from slsh.  What is reported when you run slsh
via:

   slsh --help

It should tell you what the default search path is--- this is where
require.sl should be.

I suspect that windows-specific modifications will be required.

If I find time this weekend, I will try to dust off a windows 95
machine and compile both slang-2.2 and jed.  I need to do that anyway
for the upcoming slang-2.2 release scheduled for the end of the month.

Thanks,
--John

Tom Culliton | 18 Jul 2009 01:21
Picon

Re: Search and other functions don't work

Having been bitten by a similar non-obvious dependency slsh on Ubuntu back
in October, has me wondering if there is some way we can add a check to
the Slang modules that need this, and an error message that makes it more
explicit.  Nothing all that fancy, just a simplistic "I need foo" check
and an, error("Could not find foo");

I understand that this is what require is for, but hopefully we're only
talking about two or three lines of boilerplate that would occur in a few
places...

> Cesar Romani <cesar.romani <at> gmail.com> wrote:
>> I've installed jed 0.99.19.195 based on slang 2.2.0-121 on Windows XP.
>> with mingw and I've got jed.exe and wjed.exe
>> Whenever I search on a file using the menu or with CTRL-S, it appears:
>> Unable to open require. Check the value of the S-Lang load path
>
> jed picks up require.sl from slsh.  What is reported when you run slsh
> via:
>
>    slsh --help
>
> It should tell you what the default search path is--- this is where
> require.sl should be.
>
> I suspect that windows-specific modifications will be required.
>
> If I find time this weekend, I will try to dust off a windows 95
> machine and compile both slang-2.2 and jed.  I need to do that anyway
> for the upcoming slang-2.2 release scheduled for the end of the month.
>
(Continue reading)


Gmane