------------------------
vile bug/enhancement/wish list
------------------------
$Header: /usr2/foxharp/src/pgf/vile/RCS/buglist,v 1.228 1995/02/24 00:48:33 pgf Exp $
----------------------
	(E means enhancement, L,M,H are low, medium, high priority)

E	add ":n file" 
	    (:n means go to the next file in a series of files.
	    :n file means go to that specific file - one can specify a
	    +<cmd> before file to indicate the vi command which should be
	    executed when entering the command.)

E	now that paragraphs, sections, and sentences are all selectable
	with regexps, they (and the tabstop value) are prime candidates for
	moving into a "mode-values" set of values.  A buffer would inherit
	either the global normal-mode values, or the global c-mode values.

E	:k, to set a mark, won't work as ":ka" or ":kb".  Must use ":k a"

E	patterns as addresses do not work, e.g. ":/str1/,/str2/d".  They're
	hard to parse the way things are set up right now.  We could accumulate
	the whole commandline, and then parse it, the way real vi does, but we'd
	lose the "prompt and display last response" behavior.

E	should add an option to support file locking, rather than the current
	ifdef stuff.  (this is only useful if we match the GNU locking
	protocol.) And it's not clear that in an NFS'ed environment that
	it's all that easy to get that style of locking right anyway.

E	the scrsearch functions could become region based -- as in "search for
	the next occurrence of the region", which would usually be a word.  And
	the ^A/ version could become "a/ (search for the contents of buffer a),
	if you know what I mean.

E	g should become a region command.  Then it could take ranges, as
	it should, and could also become an operator command.

E	collapse command execution code to as few places as possible.
	Its currently spread through execute(), operator(),
	docmd(), and usekreg().

E	mlreply line should ideally be a one line buffer, so inline editing
	can be done on it.

E	I haven't even come close to testing vile for
	memory-full conditions.  Some malloc() packages give 95%
	warnings -- perhaps something like that should be done for
	safety.

E	marks should perhaps be linked onto lines.  this would make a lot
        of things a lot easier, since a mark would travel with the
        line, instead of having to be moved when the line is
        reallocated etc.  the U line could be treated as a special
        mark.  The "copied" flag needed by undo could be a special
        sort of mark as well.  Implementation of the "tag stack"
	would be aided by this as well.

L	vile really ought to use unix-crypt if it is available.

E	can't search for a NUL in a buffer.

E	":e" and ":e!" should share the same prompt data, which should be
	editable / history.  They both should default (like vi!) to the
	current buffer.

E	for consistency, 'execute-macro-nn' should be 'execute-macro nn';
	doing this would allow modification to eliminate a fixed number of
	macro-buffers.

E	should ifdef the 'autobuffer' code for users who do not need vi-style
	buffering.

--------------

    Is it possible to get vile to prompt you if you try to exit without
    viewing all the files that were given on the command line?

--------------

    The ed 'transfer' and 'move' commands don't work.
    (to copy and move text around.  e.g., :'a,'bt$.)

--------------------------------

Though I use it, I'm still not quite satisfied with the qident stuff.  It
needs to be more flexible.  That is, I'd like to make it user defined.
For example
	find-tag $qidentifier
should be expressable as a character class like
	find-tag &anyof "a-zA-Z_0-9:"
in a macro.  Or even more generally, as a regular expression:
	find-tag &scan "[a-zA-Z_][a-zA-Z_0-9:]\\*"
A leading ^ would root the search at the current cursor position.
Absence of a leading ^ would start at the current cursor position but would
scan ahead until it found a match.  That way I can redefine ^] to pick
up the next word even if the cursor is before the start of the word (thus
better mimicking vi's behavior).

[ This can almost be done with the $match variable, e.g.
	7 store-macro
		search-forward "[a-zA-Z_][a-zA-Z_0-9:]*"
		find-tag $match
	~endm

	bind-key execute-macro-7 ^A-g
 - pgf ]
----------------------------------------------------------------------


In message <9212231610.AA27630@cuba.Cayman.COM> you write:
>
> > The rest (regexp.c) fix problems with
> > \S \w \W \d \D \p \P never matching the first character on a line.
>
>Actually, I could have sworn I put in the check against BOL to prevent some
>infinite loop or other oddness -- but I'll put certainly apply your change
>until proven otherwise...

The only remaining pieces of oddness I've seen are
1) doing ?\w when already on a \w character -- it says Only one occurrence
of pattern.

1a) doing ?\W when already on a \W character -- it says Only one occurrence
of pattern.

2) doing /\s stops at the end of a line and won't go any further (because
the cursor rests on the last character of the line which is before the eol).

[ these are both tricky to fix... i tried, and started introducing problems
elsewhere. -pgf]

----------------------------------------------------------------------
Also, I encountered the following problem: I am editing foo.tex and
call latex using ^X!latex foo.tex. There is an error, so latex waits for
input -> vile sits waiting and nothing helps. I think this should
be interruptable. I will agree with you that the ^X! command was not
intended for this, but still...

But ok, the real problem is that after I kill latex and
vile comes back to life I can no longer filter parts of text using
!fmt. The text just gets deleted.

----------------------------------------------------------------------

I just grabbed a copy of xvi.  I noted some interesting tidbits while
reading the "differences between vi and xvi" document.  Some of these would
be nice in vile.


     As well as the normal named (conjugate) buffers, and the  default
     one  named @, several extra buffers named :, /, ?  and ! contain
     the last command lines entered for each of the command types.  So
     for  instance,  @: will re-execute the last colon command, or you
     can insert it into your buffer, edit it and  then re-execute  it
     (e.g. with dd@@).


     +    In insert and replace modes, ^A has the same meaning  as  ^@
          in  vi,  except  that it works at any time, not just for the
          first character.  Also, typing ^Bx, where x is the name of a
          conjugate  buffer,  inserts the contents of that buffer into
          the input stream at that point.  The buffer named  <  always
          contains the last thing inserted, so that ^B< is the same as
          ^A.


------------------------
I wish ^X-!  could execute shell commands async'ly, i.e.  I should not have
to wait/do nothing while waiting for the ouput of compiling.  I should be
able to edit stuff in other buffers or even ^X-^X to edit src codes
while compilation is still going on.

------------
similar to above -- sub-commands run from ^X-! or ":[erw] !cmd" should be
"interactive" to the extent that user's input should be sent to the cmd
at least on a line-by-line basis (i.e. we can't send raw keystrokes -- we
have to do canonical processing.  of course, we should really use pty's, and
reconnect input and capture output.)  some commands like latex prompt for
more input when partway done.

========(VMS-VILE)=============================================================
Unfinished items on vax/vms (dickey@clark.net):

	+ the response time seems a bit slow (compared with other applications
	  running on the same machine).  possible problem areas include:

		+ observed that (at least on vms) I am getting highlighting
		  attributes being reset on each line, rather than only when
		  they change.

		+ probably am making too many calls to canonpath and
		  lengthen_path (affects performance on vms).

	+ if the current directory has changed, offer to restore it on exit. 
	  (Note that if the _device_ portion has changed, the original
	  directory should be restored anyway!).

	+ add key bindings and other support to make the vt100 keypad work for
	  me (e.g., like EDT).

	+ see if I can decode ".dia" files, if so connect it to finderr.c

	+ catch exception/signals, and restore terminal settings.

	+ make write-pipes work (actually, flesh out to use 'npopen' coding
	  scheme, like the MSDOS stuff).

	+ I had a case in which I wanted to read the contents of one file into
	  another; they had the same buffer name; the target buffer got the
	  filename for the source, e.g.,

	  	:e []foo		- read and determined version # ok
		:r [-.temp]foo		- current filename reset to [-.temp]foo
------------------------------------------------------------


it would be nice if vile would fold text...

	This feature appeared in uEmacs version 3.10.23 and you can
use archie/xarchie to file fue.tar.Z (fue - folding-micro-emacs).

[ someone said they were going to fold this in, so to speak.  i'm not
real comfortable with the idea, since the uemacs code causes the LINE
struct to grow _enormously_ ]


-----------

	When I execute a keyboard macro using ^X-& I cannot repeat this
	using the dot command. Instead, the last command in the macro
	is repeated.
    [ this is because '.' doesn't do @ macros either...]

------------------------------


Can you add the '>' character to the list of comment chars for paragraph
reformatting?  I would live to be able to reformat mail quotes (like shown
above).

[ pgf notes: I did this, as chris suggested, but formatregion should use
  the comments regexp to match a comment delimiter at the beginning of
  line, and should insert the comment delimiter of the _second_ line (so
  that boxed C comments work right)in subsequent reformatted lines,
  including leading but not trailing whitespace.  indentlen should be
  counted _after_ the width of such a comment delimiter.  this would make
  paragraphs that are indented way after the delimiter keep their indent. 
  commented paragraphs should end when exp->mlen for the comment regexp is
  equal to llength(DOT), i.e.  it's the whole line.  (we'll need to take
  the $ off the end of the comment regexp).  ]

--------------------


enhancement:  reimplement error finder using regexps.

------------------------------
Another enhacement.
How about a history file.  say I have been using vile and
quit and come back in later I can use the history file.

--------------------------

In a xterm window the down arrow (which sends ESC-O-B) works for individual
presses.  If you hold down the key then letter Bs get peppered through out
the file.  It appears that the ESC is occasionally being missed so that the
following OB puts a B in the file.

In my case I'm on a workstation running 4.1.3 and xterm using rlogin to
connect to a 690 server (lightly loaded) running 4.1.3 and running vile
on the 690.

I just ran vile locally and didn't see the problem.
-------------------------------


I found a bug (new with 3.59) on our Pyramid SVR4 (but not Pyramid SVR3,
SunOS 4.1.1, AIX 3.2) where
	xvile tmp &
pops up the xvile window briefly, the window dies, the xterm I started
xvile from says
	[1]  + suspended (tty input)  xvile3.59 tmp
and then after a couple seconds the xterm itself vanishes!  However,
	xvile tmp
works fine, except that the process is in the foreground.
 > The bug on the Pyramid SVR4 machine with xvile & suspending itself,
 > committing suicide, and then blowing away the xterm still exists.
 > For the time being I just remember to run xvile on a different
 > machine.

-----------------------------
apply Alistair's min/max regexp patch

-------------------------------------------------------------------------

Is there any way to use termcap to define 
all of the window parameters, but still use ANSI escapes for colors?  Elvis
allows me to do this under Linux on the terminal screen and a couple of
systems allow Elvis to change the foreground and background colors under an
xterm.  If I tell Vile to compile using ANSI instead of termcap it works
but it doesn't seem to recognize any of my termcap variables (which means
it doesn't get the right screen size or exits with incorrect colors).

-----------------------------


With vim 1.27 you can configure its behaviour regarding backspace using
the 'backspace' variable. From the help file:

backspace (bs)	    number    0     0 standard Vi, 1 delete NL, 2 delete all
i.e. if bs is non-zero, you can backup to the previous line, and if it's
a 2, you can backup past the insertion point.

i don't think this is optimal -- i think you should be able to choose
independently whether you backup past the newline or past the insertion point.

in any case, vile won't let you back up past the newline during an insert.
when _not_ in insert, you can rebind ^H to backward-character.

---------------------------

When you do a :b you should have line completion for the name.

---------------------------


How can I read the status of a shell command when I execute a
shell-command? Although the shell command has a $STATUS=1 the
status of the status variable is TRUE.

---------------------------

you can't use ! as a regular expression delimiter, as in:
	:s!pat!replace!g
because the parser treats ":s!" as if it's ":q!" or ":w!".

---------------------

the ^W and ^R commands don't work with shell-files, i.e.
	^WG!lpr
or 
    	"a^R!cat foo

this seems to be a result of ending up down in kbd_pushback() called
from hst_append().  this causes the clexec flag to be set, and that
breaks a bunch of other stuff.  

-------------------------

width of a region is kept in units of offset, not of columns.
i think this will break rectangular inserts of non-rectangular regions,
where the longest line may not extend to the furthest column, due to
tabs in other lines.


-------------------------

2) When I use the MKS "fmt" program to format a paragraph in vile, a
   tmp file (aaxxx.tmp) is always dropped out in my current working
   directory.  This was not a problem in the previous version of PCVILE
   (the one I compiled with Turbo C++).

    I.E., when I exit vile43 after using the fmt command, I've got a temp
    file called "aaac1.tmp" (for example) in my current working directory.
    It's annoying.

-----------------------------

I'm using the DOS version and I prefer to use 80x28 or even higher res like
80x50 by setting set sres=80x50 in vile.rc.  The problem is that when a
command is executed with :!<shell-command> the mode switches back to 80x25.
It switches back to 80x25 permanently. I think it's acceptable that it
switches to 80x25 when it's in shell command execution.  However, technically
it should switch back to the preferred mode when it's done.

[ can anyone confirm or deny this is still true? ]

---------------------------

the borland console driver won't display the cursor on blank lines until
after you've refreshed the screen at least once, e.g. with ^L.  must
be something to do with color initialization, or something like that...

---------------------------

running a SunOS4.1.3 binary of vile on Solaris2.3 causes the "interrupted
system call" problem, no doubt due to the differing BSD/SysV signal()
semantics.  [ probable workaround:  ":set noworking" ]

----------------------

Another thing that would be really helpful would be a description of the
$debug variable, and what it does, how it works.

-------------------------------

the docs for the &right function disagree, in vile.hlp and macros.doc.  the
code seems to do what vile.hlp says.  the macros.doc behavior seems more
rational, since the current behavior can i think be duplicated more easily
with &mid than the macros.doc-style behavior.  (vile.hlp says that we take
the substring starting at the given position.  macros.doc says we take the
substring starting the given number of chars from the end.)

---------------------------------

there should be better support in vile for reading bits of shell output
into a buffer -- ":r !foo" is a little primitive when trying to insert a
single word into a line.

---------------------------------

autoindent skips blank lines when looking for the
indent value.  apparently real vi doesn't?

----------------------

currently can't pop/untag from within macro
[really?  why is this?]

------------------

are there still reentrancy problems in xvile when mousing around during
long-running operations.

----------------------

could the attribute selection logic be used to emulate vi's behavior
of replacing the last char of a change operation to '$'?  (but only for
text which does not span a line)

---------------------------

 Another problem with '1 shell-command '
 With the option '1' vile don't prompt for [Return] but the
 screen always 'hops'.  (scrolls 1 line forward and backward)

-------------------------

there should be a way to reference both the global and local values
of modes from within macros, so that values can be saved and restored.

-------------------------

there should be a way to reference buffer attributes of the currently-
executing macro (or stack of macros).

-------------------------

[regarding the ^X^X find-error code (from tom)]
Rather than have the long if-then-else-if sequence, we could have a table
of structs something like

        struct  {
                int     file;
                int     line;
                int     msg;
                REGEX   *pattern;
        } ERR_PATTERN;

where the int-members correspond to the \1 through \9 special symbols.
If we use a meta character such as '%', we can define something like

        "\"\([a-z]%f\)\" Line \([0-9][0-9]*%l\)"

to substitute as a regular expression

        "\"\([a-z]\1\)\" Line \([0-9][0-9]*\2\)"

I believe that I suggested a few months ago that the expressions be put
into a special buffer as well, rather than trying to make a mode out
of them.

-------------------------

[ how do i test this? ]
In xvile, when the load is high and the machine stalls for a while
and I key in several keystrokes ahead, it takes the first of those keystrokes
and replaces the later keys by it i.e. when several events simultaneously
arrive, it doesn't do the right thing (process them in order).

-----------------

when motion keys or pasting is used during an insertion, we should
break the insertion into multiple undoable chunks.
-----------------

pasting to a view-only buffer does not generate an error message.
----------------------------

some folks would like to see smooth-scrolling enforced.  it seems they
have keyboards that repeat just a little faster than their screen can keep up,
and they'd like vile to scroll rather than jump with the typahead.

-----------

   XVILE BUG:

      - If I click on the "maximize" gadget, it gets _really_ big.
        Like, many times bigger than the screen big; I suspect that
        it is maximizing to a number of *characters* equal to the number
        of *pixels* available or something.  If I click on the same 
        gadget (after dragging that part of the window onto the screen),
        which does a normalize, it crashes.
	I am use vile 4.5 and xvile on HP/UX 9.01.
	I use vuewm as my window manager (a motif variant).

      [I would guess that the suspicion of the person reporting the bug
       is correct concerning the behavior of the window manager during
       maximization.  I don't have this problem with fvwm. pgf's changes
       to eliminate the hardcoded maximum width and height will probably
       fix the core dumps.  I'll look into seeing if there is some protocol
       which we're not observing with regard to maximization.  -kev]

------------------
      - I would like an option whereby if I have more than one file on
        the command line, the display opens with one window per buffer,
        so I can visibly see all the files available.
----------------------


if you have lines like
	123
	1234
	12
it's impossible to select them as a rectangle, since the middle line is
longest.


----------------


It would be useful to have a search that is constrained to a certain
movment.  For example, I might want to look for the string "foo" over the
next paragraph, not the whole document.  This would really be useful to
programmers who want to look for the instance of a variable or a function
call only within the current scope (or #if).

----------------
xvile:
 Is it possible to have an optional horizontal scrollbars ?
   (just for maniac users)

----------------------------

on the first attempt to insert a quoted ^C (i.e. ^V^C) it works, but also
quotes the next character (e.g. the ESC).  after the first time, ^C doesn't
work anymore.  (this seems to be linux-specific, and i'm running an old
(pre 1.0) kernel.  so i'll check it on a newer system. it's not getting the
later SIGINT's at all, and it returns ^V a _second_ time, after getting
the first SIGINT.  very strange.)

------------------------

under DOS, ^P character turns on the printer.   argh.
actually, this only happens if compiled with borland.  it uses getch()
instead of intdos() to get the char.  (see ttgetc())  that's probably
at least part of the answer.

---------------
how about a mode that supports autosaving to the backup-file,
instead of to the original file -- useful for system crashes.

-----------------

rectangular operations don't work right if there are control characters
to the left of the rectangle.  (physically they work, but the visual
effect is wrong.  i'm not sure what the right thing to do is.)

-------------------------
double quote characters (and probably other special chars) are interpreted
incorrectly on the lhs of a map command.  for instance:
	map ^K" WBi"^[Ea"^[
will result in 
	^K WBi
as the lhs, leaving
	^[Ea"^[
as the rhs.  the workaround is to escape the " in the lhs:
	map ^K\" WBi"^[Ea"^[

(this map surrounds the current word in double quotes)

-----------------------------

It should be fine if the tabulate key (to have the file completion)
understands the SHELL variables.  For example, if I type $HOME<TAB>, xvile
gives the choice.

-----------------------------

Would you please add another hook: modify-hook.  I thought this is useful,
for example, if I attempt to insert, delete (in general, modify) text
in a read-only file, I like it to prompt if the user wants to PVCS-lock it.
A message would look something like this:
	File is read-only, check out?

-----------------------------

contrary to the vile.hlp text, binding to the interrupt{} terminal
character does not fully change intrc and the user's interrupt character.

-----------------------------

We use xvile with french characters (8 bit).
And the change/delete word (cw, dw) does not work with a word
including 8 bit character. The substitution/delete is done up to
the 8 bit character not including it.

-----------------------------------------------------------------
VMS6.0 on VAXstation 4000/90.  DEC C for OpenVMS VAX compiler
version V4.0-000.  Shared library (specified in VMSSHARE.OPT)
is DECC$SHR.EXE instead of the default VAXCRTL.EXE.

symptoms:
	vile can't read vile.rc, or vile.hlp.

reason:
	on this setup, the access() library routine seems broken.
	my test program showed that it returned -1 for existant
	and non-existant files.

solution:
	I had to add a
#define HAVE_ACCESS 0
	in estruct.h (actually, I just put it in fileio.c).
[ there's a fix in estruct.h, but untested ]

-----------------------------------------------------------------

it sure looks like flush_line() in x11.c should take (char *) as arg 1
rather than (uchar *).  i don't want to change it for 5.2 though.

-----------------------------------------------------------------

DOS:  wildcarding in the top directory:
   c:
   cd \
   vile a*.bat             (will not open autoexec.bat)
does not work, because Watcom's opendir() routine only succeeds on the root
directory if it is specified as '\'.  no other name for it seems to work.
stat won't work on it either.  (we try to open it as ".", not an unreasonable
thing to do.)

sigh.  i hate DOS.

-----------------------------------------------------------------

 Mips RISCos5.0 machines:
    Error: random.c, line 625: 'SIG_BLOCK' undefined, ...
    Error: random.c, line 637: 'SIG_SETMASK' undefined, ...
 [ i thought i could provide fallback definitions of those, but
   the values are different on sunos and linux, and are probably
   different again on Mips RISCos5.0, bless it's broken little heart. ]

