Antonio Diaz Diaz scripsit:

> What do other users of ed think about this?

I call it a bug.  POSIX is very clear:

If changes have been made in the buffer since the last w command that
wrote the entire buffer, ed shall warn the user if an attempt is made
to destroy the editor buffer via the e or q commands. The ed utility
shall write the string:

"?\n"

(followed by an explanatory message if help mode has been enabled via the
H command) to standard output and shall continue in command mode with
the current line number unchanged. If the e or q command is repeated
with no intervening command, it shall take effect.

Reading in a file certainly counts as a change in the buffer, so a
q command in that circumstance should be rejected.  I suppose a
case could be made that if the read-in file is empty, the modified
flag should not be set, but I think that would be more confusing.

-- 
Knowledge studies others / Wisdom is self-known;      John Cowan
Muscle masters brothers / Self-mastery is bone;       co...@ccil.org
Content need never borrow / Ambition wanders blind;   http://ccil.org/~cowan
Vitality cleaves to the marrow / Leaving death behind.    --Tao 33 (Bynner)

_______________________________________________
bug-ed mailing list
bug-ed@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-ed

Reply via email to