jed-users mailing list

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

[0.99-15] Problems to read files into the buffer-list.


Hi,

when programming, I'd like to read all source-files in the current
directory into the buffer-list on startup. I took some code from
dired.sl and tried this:

define my_ada_fill_buffer_list ()
{
  variable my_ada_tmp_buf = make_tmp_buffer_name("my_ada_");
  variable my_ada_buf = whatbuf();
  variable s = "";

  sw2buf(my_ada_tmp_buf);
  shell_cmd (sprintf ("ls %s 2>/dev/null | grep \.ad[bs]$ | sort", "./"));
  bob();
  do
    {
      s = line_as_string();
      if (s != "")
        read_file(s);

% here I run into problems. If I replace read_file(s) with flush(s) to
% check the file-names, everything seems to be ok. But read_file(s)
% seems to change the current buffer and so text from my source-files
% is read the next time the loop is done.

      sw2buf(my_ada_tmp_buf);

% I added the line above to solve this. But then for every line in
% my_ada_tmp_buf a new buffer is created with the same content as
% my_ada_tmp_buf. I tried to solve the problem by using push_spot()
% and pop_spot() but it didn't help. Instead, it seems, as if the list
% of file-names is read in recursively. Could this be true? If yes,
% why is this so and where does it happen? Who calls my function?

    }
  while (down_1());
  sw2buf(my_ada_buf);
  delbuf(my_ada_tmp_buf);

% finally I want to delete my_ada_tmp_buf, but delbuf() asks me, if
% I really want to kill it. Is there a way to kill my_ada_tmp_buf
% without prompting me? Again I'm prompted multiple times, as if my
% function was called recursively.

}
					      
Finally I would like to have the list always sorted by name when I
call it. Is there a way to do this?

With lots of thank in advance,
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>.


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