Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #45214

Re: how can I use emacs to locate definitions in gforth

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: how can I use emacs to locate definitions in gforth
Date 2016-01-31 15:09 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2016Jan31.160920@mips.complang.tuwien.ac.at> (permalink)
References (4 earlier) <56a94f77.1280114049@news.eternal-september.org> <2016Jan28.180913@mips.complang.tuwien.ac.at> <56aaae41.1369916461@news.eternal-september.org> <2016Jan29.134254@mips.complang.tuwien.ac.at> <e0e5abac-8834-4958-988a-573165a662b6@googlegroups.com>

Show all headers | View raw


mhx@iae.nl writes:
>On Friday, January 29, 2016 at 1:55:20 PM UTC+1, Anton Ertl wrote:
>> stephen@mpeforth.com (Stephen Pelc) writes:
>> >>Instead of everyone having to configure their editor for each
>> >>application in some configuration file (or with some
>> >>application-specific commands), there is a standard way to do it,
>> >>through the EDITOR environment variable.
>> >
>> >But all this assumes that the EDITOR variable is set and that the
>> >favourite editor uses the standard command line sequence. 
>> 
>> If it isn't, sf gives me a helpful message:
>> 
>>   edit : $0: No editor defined, and $VISUAL and $EDITOR are not set.
>> 
>> So now I know that I have to set either VISUAL or EDITOR.  By
>> contrast, the VFX error message:
>> 
>> sh: 1: kate: not found
>> 
>> is not really enlightening; it does not tell me that I have to edit
>> ~/.VfxForth/VfxForth.ini nor that I should use editor-is and locate-is
>> (or whatever the commands are).
>
>It looks like SF expects that there will be trouble with 
>$EDITOR, while Vfx assumes the default error mechanism is
>good enough. 

Looking at <https://qa.debian.org/popcon-graph.php?packages=vim%2C+nano%2C+kate%2C+gedit%2C+x11-apps%2C+emacs23-bin-common%2C+emacs24-bin-common&show_installed=on&want_percent=on&want_legend=on&from_date=&to_date=&hlght_date=&date_fmt=%25Y-%25m&beenhere=1>

it looks like only about 10% of Debian systems have kate installed, so
it would be a good idea to think about what happens if kate is not
found.

>90% have nano installed (it's installed by default, but that is
probably Debian-specific).  Next after nano is xedit (package
x11-apps) at ~55%, vim (~40%), gedit (~35%), and emacs 23+24 together
are below 20% (probably closer to 10%), so making emacsclient the
default is not a good idea, either.

Note that the "vote" (recently-used) results are significantly
different from the "installed" results (all these editors below 20%),
but the "installed" results are probably more interesting for the
error discussed above.  Of course, if the editor is installed, but
offends the user, avoiding a "not found" error is not good enough; the
user then also needs to find out easily how to change the default.  It
seems to me that the SF way is very good in that respect, too.

>Now we realize the how and why, it doesn't look too difficult to
>handle this in a general way. Forth could pass an xt / data 
>address to the called word that allows informative messages or
>recovery. The lowest level routine can then say what physically
>went wrong, stating precisely what the highest level task is.
>Intermediate layers check if the xt is 0 and substitute
>something better when it is. This might even be put in the 
>form of some sort of assertion.

Interesting idea.  Somewhat contrary to the way typical Forth-94
programs handle errors: by using THROW and CATCH.  Admittedly THROW
and CATCH are weak when it comes to error reporting (you can only pass
an integer as error indicator), but why not enhance THROW and CATCH
appropriately?  What advantage does your approach offer?

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2015: http://www.rigwit.co.uk/EuroForth2015/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how can I use emacs to locate definitions in gforth Coos Haak <chforth@hccnet.nl> - 2016-01-26 00:27 +0100
  Re: how can I use emacs to locate definitions in gforth Bernd Paysan <bernd.paysan@gmx.de> - 2016-01-26 02:11 +0100
    Re: how can I use emacs to locate definitions in gforth Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-26 11:35 +0000
    Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-26 17:04 +0000
      Re: how can I use emacs to locate definitions in gforth "Elizabeth D. Rather" <erather@forth.com> - 2016-01-26 09:21 -1000
  Re: how can I use emacs to locate definitions in gforth stephen@mpeforth.com (Stephen Pelc) - 2016-01-26 20:52 +0000
    Re: how can I use emacs to locate definitions in gforth Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-26 21:24 +0000
      Re: how can I use emacs to locate definitions in gforth mhx@iae.nl - 2016-01-26 14:32 -0800
        Re: how can I use emacs to locate definitions in gforth Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2016-01-27 07:35 +0100
          Re: how can I use emacs to locate definitions in gforth mhx@iae.nl - 2016-01-27 03:26 -0800
    Re: how can I use emacs to locate definitions in gforth Bernd Paysan <bernd.paysan@gmx.de> - 2016-01-26 23:32 +0100
      Re: how can I use emacs to locate definitions in gforth stephen@mpeforth.com (Stephen Pelc) - 2016-01-27 00:17 +0000
        Re: how can I use emacs to locate definitions in gforth Bernd Paysan <bernd.paysan@gmx.de> - 2016-01-27 21:50 +0100
      Re: how can I use emacs to locate definitions in gforth Hannu Vuolasaho <vuokkosetae@gmail.com> - 2016-01-27 04:11 +0200
      Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-27 14:39 +0000
        Re: how can I use emacs to locate definitions in gforth stephen@mpeforth.com (Stephen Pelc) - 2016-01-27 23:53 +0000
          Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-28 17:09 +0000
            Re: how can I use emacs to locate definitions in gforth stephen@mpeforth.com (Stephen Pelc) - 2016-01-29 00:17 +0000
              Re: how can I use emacs to locate definitions in gforth Julian Fondren <julian.fondren@gmail.com> - 2016-01-28 17:20 -0800
                Re: how can I use emacs to locate definitions in gforth stephen@mpeforth.com (Stephen Pelc) - 2016-01-29 02:22 +0000
                Re: how can I use emacs to locate definitions in gforth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-01-29 02:24 -0600
                Re: how can I use emacs to locate definitions in gforth Julian Fondren <julian.fondren@gmail.com> - 2016-01-29 03:49 -0800
                Re: how can I use emacs to locate definitions in gforth Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-29 11:41 +0000
                Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-29 13:00 +0000
                Re: how can I use emacs to locate definitions in gforth Bernd Paysan <bernd.paysan@gmx.de> - 2016-01-29 22:50 +0100
              Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-29 12:42 +0000
                Re: how can I use emacs to locate definitions in gforth stephen@mpeforth.com (Stephen Pelc) - 2016-01-30 10:10 +0000
                Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-30 14:29 +0000
                Re: how can I use emacs to locate definitions in gforth mhx@iae.nl - 2016-01-31 02:58 -0800
                Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-31 15:09 +0000
    Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-27 14:36 +0000
      Re: how can I use emacs to locate definitions in gforth Julian Fondren <julian.fondren@gmail.com> - 2016-01-27 07:37 -0800
      Re: how can I use emacs to locate definitions in gforth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-01-27 10:35 -0600
        Re: how can I use emacs to locate definitions in gforth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-27 16:58 +0000
          Re: how can I use emacs to locate definitions in gforth "Elizabeth D. Rather" <erather@forth.com> - 2016-01-27 08:48 -1000

csiph-web