G. Milde | 1 Nov 11:45 2006
Picon

Re: Customizing ctags Behaviour

On 31.10.06, John E. Davis wrote:
> Hagemann, Robert <rhagemann <at> psipenta.com> wrote:
> >
> > 1. In several of our modes, the hyphen ('-') is part of a name, 
...

> > 2. I'd like to have the tags-file in a directory like
> > $HOME/e/develop/tags.

> You will need to patch ctags.sl.  I have appended a patch that
> addresses these issues.  The patch modifies ctags.sl to use
> the buffer-local variables Word_Chars and Tags_File when they exist
...

> To use it, create a mode-specific hook that sets buffer-local
> variables to the desired values.  For example, 

>    define c_mode_hook ()
>    {
>         .
> 	.
>       if (path_basename (buffer_filename ()) == "/some/path")
>         {
> 	   create_blocal_var ("Word_Chars");
> 	   set_blocal_var ("Word_Chars", "-A-Za-z0-9");
> 	   create_blocal_var ("Tags_File");
> 	   set_blocal_var ("Tags_File", "/path/to/tags/file");
> 	}
> 	.
> 	.
(Continue reading)

Jörg Sommer | 6 Nov 21:29 2006
Picon

read_mini leaves "" on stack

Hi,

% xjed -batch -f 'ungetkey(7); try { read_mini("ABC", "abc", "123"); } catch AnyError; _print_stack();'
ABC(default abc)^G
(0)[String_Type]:
% xjed --version
jed version: 0.99.19-17/Unix
 Compiled with GNU C 4.1
S-Lang version: 2.0.6

jed compile-time options:
 +LINE_ATTRIBUTES +BUFFER_LOCAL_VARS +SAVE_NARROW +TTY_MENUS
 +EMACS_LOCKING +MULTICLICK +SUBPROCESSES +DFA_SYNTAX +ABBREVS
 +COLOR_COLUMNS +LINE_MARKS +GPM_MOUSE +IMPORT

Using JED_ROOT=/usr/share/jed
% 

I expect, no value is left on the stack in case of the UserBreak signal.

Bye, Jörg.
--

-- 
Wenn unser Hirn so einfach wäre, dass es sich selbst
begreifen könnte, dann könnte es sich selbst nicht mehr
begreifen, weil es zu einfach wäre ;) Nur mal so als
philosophischer Denkanstoss …

John E. Davis | 7 Nov 05:28 2006
Picon

Re: read_mini leaves "" on stack

=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg <at> alea.gnuu.de> wrote:
>% xjed -batch -f 'ungetkey(7); try { read_mini("ABC", "abc", "123"); } catch
>  AnyError; _print_stack();'
>ABC(default abc)^G
>(0)[String_Type]:

I am unable to reproduce this.  In fact, in batch mode, read_mini
reads from stdin and not the internal keyboard buffer.  So the call to
ungetkey should have no effect.  

Did you press ^G at the prompt?  Also in batch mode, pressing ^G may
not send the process a SIGINT since in that mode jed makes no attempt
to setup the terminal.  Try pressing ^C instead.

Thanks,
--John

Jörg Sommer | 7 Nov 13:48 2006
Picon

Re: read_mini leaves "" on stack

Hello John,

"John E. Davis" <davis <at> space.mit.edu> wrote:
> =?UTF-8?Q?J=C3=B6rg?= Sommer <joerg <at> alea.gnuu.de> wrote:
>>% xjed -batch -f 'ungetkey(7); try { read_mini("ABC", "abc", "123"); } catch
>>  AnyError; _print_stack();'
>>ABC(default abc)^G
>>(0)[String_Type]:
>
> I am unable to reproduce this.

And without batchmode?

> Did you press ^G at the prompt?

Yes.

> Also in batch mode, pressing ^G may not send the process a SIGINT since
> in that mode jed makes no attempt to setup the terminal.  Try pressing
> ^C instead.

But ^C does not generate a UserBreak.

Bye, Jörg.
--

-- 
Der kommt den Göttern am nächsten, der auch dann schweigen kann,
wenn er im Recht ist.                         (Cato; 234–149 v. Chr.)

John E. Davis | 7 Nov 16:20 2006
Picon

Re: read_mini leaves "" on stack

=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg <at> alea.gnuu.de> wrote:
>But ^C does not generate a UserBreak.

It does if it is configured at the terminal to generate a SIGINT.  Try
this:

jed -batch -f \
 'try($1){read_mini("ABC","abc","123");}catch AnyError:message($1.message);'

At the prompt, press ^C.

Thanks,
--John

Hagemann, Robert | 9 Nov 15:54 2006

Customizing ctags Behaviour

Hi, 

thank you for the patch and sorry for answering not in time...

The patch seems to works for me, but there are to pending questions:

1. The patch uses get_blocal_var with two arguments. 
According to the documentation,
get_blocal_var expects only one variable.

2. (Not in the patch itself):
The suggested c_mode_hook shuffles the arguments for set_blocal_var.
Anyways, in our environment, the tags-file is the same 
for several programming languages,
so IMHO, a mode dependent setting is not the way to go, 
I'd rather use the startup script
for the tags file location and the Word-Chars setting in 
the mode definition itself.

Thank you again for your help,

Bye,

Robert Hagemann  

> -----Ursprüngliche Nachricht-----
> Von: owner-jed-users-l <at> mailman.jtan.com
> [mailto:owner-jed-users-l <at> mailman.jtan.com] Im Auftrag von 
> John E. Davis
> Gesendet: Dienstag, 31. Oktober 2006 18:17
(Continue reading)

John E. Davis | 9 Nov 19:00 2006
Picon

Re: Customizing ctags Behaviour

Hagemann, Robert <rhagemann <at> psipenta.com> wrote:
>1. The patch uses get_blocal_var with two arguments. 
>According to the documentation,
>get_blocal_var expects only one variable.

The documentation needs to be updated as noted previously by another
email.

>2. (Not in the patch itself):
>The suggested c_mode_hook shuffles the arguments for set_blocal_var.
>Anyways, in our environment, the tags-file is the same 
>for several programming languages,
>so IMHO, a mode dependent setting is not the way to go, 
>I'd rather use the startup script
>for the tags file location and the Word-Chars setting in 
>the mode definition itself.

If you want to use the same file and word-definition for all buffers,
then you can use a global mode hook:

   define global_mode_hook (mode)
   {
      define_blocal_var ("Word_Chars", "-A-Za-z0-9_");
      define_blocal_var ("Tags_File", "/path/to/tags/file");
   }

If you want to do this on a buffer-by-buffer basis, then you will have
to add the appropriate if-statements to the above hook.  Also, if the
use of "Word_Chars" is too limiting, then it may be necessary to
modify ctags.sl to a ctags-specific version of word characters.
(Continue reading)

G. Milde | 10 Nov 12:09 2006
Picon

Re: Looking for C/C++ (and S-Lang) programmers for testing

On 29.09.06, Olesen, Mark wrote:
> ... I'm looking for input, and for testers and of the modified c-mode. 

> In adjusting the c-mode code, I also streamlined it a bit and add
> comments (so I could understand what it is doing).

> I believe that the changes are an general improvement, and shouldn't break
> any existing styles, but of course this must be (critically) tested on real
> code.  Please let me know what works or doesn't work so that it can get
> fixed before 'proper' submittal.

All this changes look nice to me, so I put the file into my private
library (~/.jed/lib) and did some "road testing" (i.e. simply waiting
for things to happen).

The only bug I could spot until now is a missing documentation block
start marker that broke the autogeneration of online documentation with
tmtools.sl.

Here is the patch:

--- /home/milde/.jed/lib/cmode.sl~	2006-10-10 11:57:55.000000000 +0200
+++ /home/milde/.jed/lib/cmode.sl	2006-11-10 12:03:12.000000000 +0100
 <at>  <at>  -150,6 +150,8  <at>  <at> 
 %!%-
 custom_variable ("C_Autoinsert_CPP_Comments", 1);
 custom_variable ("C_Switch_Offset", 0);
+
+%!%+
 %\variable{C_Namespace_Offset}
(Continue reading)

Olesen, Mark | 10 Nov 14:00 2006

RE: Looking for C/C++ (and S-Lang) programmers for testing

Servus Günter,

Thus far, the only other reported problems seem to be the following two
constructs, which I personally never use:
{
    if ( expr1
	  || expr2 )
    foo();  /* WRONG */

    if ( expr1 || expr2 )
	foo();  /* OKAY */

    if ( expr1
	  || expr2
       )
	foo();  /* OKAY */

    if (expr)
    (void) foo();  /* WRONG */

    if (expr) {
	(void) foo();  /* OKAY */
    }    
}

It anyone else has time to look at these, I would be very thankful.
It looks like I'll be swamped with other work until New Year's.

/mark

(Continue reading)

Jörg Sommer | 10 Nov 15:30 2006
Picon

Re: read_mini leaves "" on stack

Hello John,

"John E. Davis" <davis <at> space.mit.edu> wrote:
> =?UTF-8?Q?J=C3=B6rg?= Sommer <joerg <at> alea.gnuu.de> wrote:
>>But ^C does not generate a UserBreak.
>
> It does if it is configured at the terminal to generate a SIGINT.  Try
> this:
>
> jed -batch -f \
>  'try($1){read_mini("ABC","abc","123");}catch AnyError:message($1.message);'
>
> At the prompt, press ^C.

OK. Nice to know. But back to my problem: Run ispell for a wrong word and
press ^G at the prompt. At me, it leave a empty string on the stack. IMO
it's a problem of read_mini().

Bye, Jörg.
--

-- 
“Perl—the only language that looks the same
 before and after RSA encryption.”           (Keith Bostic)


Gmane