On Mon, Feb 21, 2011 at 4:31 AM, Milan Vancura <[email protected]> wrote: > Hello, > > I don'd advocate for either the change or no-change in vim. I just want to > clarify the UNIX behavior: > >> I understand that this is before the plugin is invoked, but why the >> difference? >> >> If 'bar' is a directory, >> >> ls foo/bar >> >> and >> >> ls foo/bar/ >> >> produce the same result -- the directory listing. No complaints about > > This is not exactly true. > > Firstly: even if it would be true for ls - it's a matter of 'ls' maintainers > decision, nothing more. Especially it does not say "foo/bar" and "foo/bar/" > are > same, in any manner. Only it says is ls shows them in the same way, sometimes.
That's true. But it's like saying that 3.14159 isn't exactly pi, which is also true. But it's a good enough approximation in many, many cases. The ls behavior I cite is seen by users in a the vast majority of cases. > > Secondly: even ls does not show "foo/bar" and "foo/bar/" in the same way, not > always. Only if it "thinks" it does not matter. In the other words, there is > some heuristics prepared for users of ls, for their convenience. Nothing more. > > Example: > $ mkdir -p foo/tralala > $ ln -s tralala foo/bar > $ touch foo/tralala/test > $ ls -l foo/bar > lrwxrwxrwx 1 milan users 7 Feb 21 10:20 foo/bar -> tralala/ > $ ls -l foo/bar/ > total 0 > -rw-r--r-- 1 milan users 0 Feb 21 10:20 test True, but a relatively unusual case. (What fraction of files in a random Unix filesystem are symlinks to a directory?) And you ignore the examples I gave using mkdir and cd. Together ls + mkdir + cd (and I'm sure there are others I haven't bothered to try to think of) establish a convention in the mind of the user. The Vim :e command violates that convention (but not the :E command). > > So even we still may discuss how much the current error messages in vim are > ergonomic (helpful for users, not confusing etc.), they are surely right from > technical point of view. Really? So :ed / --> "Illegal file name" is technically correct? And that Vim treats the trailing slash issue differently in :e and :E is technically correct? And we should think about those messages from the > perspective of vim users, regardless of ls users. I couldn't disagree more. Vim is part of a larger system. There are conventions that exist for that system, so that equivalent situations are treated equivalently in different contexts. Those conventions are important; without them, you have a bunch of special cases producing a confusing and difficult to learn/remember user-interface. /Don > > Just to make things more clear, > > Milan > > -- > Milan Vancura, Prague, Czech Republic, Europe > > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
