If that's what they're teaching y'all down at Pitt, you should come
up the street to CMU for a few days.
Contemplate infinity for a while and all will become clear; vi can
display the phase of the moon, do the towers of Hanoi, solve mazes,
ploy Conway's game of Life, and simulate Turing machines and Universal
Register Machines. All of these can be done without calling any
external programs, but no self-respecting vi user would actually do
some of them (including the phase-of-moon problem) that way. Tools
working together; it's the Unix way.
The vi vs. emacs flamewars are stupid. Expect two Turing-equivalent
systems to solve the same set of problems. If you need inline images,
use XEmacs; otherwise, pick your poison. Use whatever fits your style.
Cordially,
Sumner
Please don't CC: postings to me, my mailbox is already full enough.
G Sumner Hayes <sum...@CMU.EDU> writes:
> All of these can be done without calling any external programs, but
> no self-respecting vi user would actually do some of them (including
> the phase-of-moon problem) that way.
How would vi calculate the phase of the moon (something extremely
useful when debugging) without calling external programs?
Well, like I said, no self-respecting vi user would actually implement
a vi-only solution to that problem. The comp.editors archives contain
Turing machine and Universal Register Machine macros for vi, and the
phase of the moon problem is Turing computable, so you could apply the
Turing macros to get an answer. It would not be pretty. I don't even
know the phase of the moon algorithm off the top of my head, and even
if I did I made my ghastly vi macros of the week yesterday (see
comp.editors). I don't know if eli the bearded (Conway's game of
Life in vi) would even want to think about tackling this one; I may
give it a shot next week, but don't put too much money on that.
Depends on how self-respecting I feel, I guess.
The proper solution, of course, is ':r!phoon', which calls an external
program in full Unix style.
Where, pray tell, are these archives?
I know of the vi archives at archive.uwp.edu, but they are (or were last
time I checked) a bit old.
-E
--
PGP Public Key Fingerprint: BE FC C5 FB 30 47 E5 5C DC DF C3 C0 AD A5 27 17
Homepage: http://www.primenet.com/~fnargle/erisson/ PGP Key available here
"Every day is like burning paper." --Slimebard
"You have *not* 'plonked' me!" --Mario1
Er, I think you would exceed the max macro space if you tried this.
Perhaps if you used VIM...?
-Jonathan-
> G Sumner Hayes <sum...@CMU.EDU> writes:
> All of these can be done without calling any external programs, but
> no self-respecting vi user would actually do some of them (including
> the phase-of-moon problem) that way.
Per> How would vi calculate the phase of the moon (something extremely
Per> useful when debugging) without calling external programs?
Well they could always start from the Turing Machine simulation done
in vi macros and write something for that.
--
st...@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.
"Bill Clinton is a bore. He doesn't have a creative bone in his
body." -- David Brinkley
> Well they could always start from the Turing Machine simulation done
> in vi macros and write something for that.
A turing machine cannot tell you what the phase of the moon, or even
what the clock is.
VI?
Isn't VI that really backward editor that came with my Linux disks? I couldn't
use it, it was user hostile. At least EMACS has that wonderful buffer thingie,
and the Meta-X wossname commands. Are people REALLY USING this VI thing? It's
like EDLIN that came with my 8086 all those years ago. By all accounts EMACS is
the thing to have. You can set it up as a calendar, an address book, an agenda,
it plays games, dungeon adventures, hooks into IRC, executes Shell commands, has
that cute Eliza thing, spell checks, grammar corrects, auto-hyphonates, word
wraps, stores macros, executes them any number of times, has a C mode, a Tex mode,
a Perl mode, HTML mode, Java mode, LISP mode, Modula-2 mode, auto-saves, supports
separate buffers, has panes, help modes, cutting and pasting, calc mode,
abbreviation expansion, Usenet mode, SGML mode, Lisp running, Rlogins, WordStar
mode, and of course YOW.
With all this on hand.. who would ever use VI again? If BETTER is defined at
performs all the same functions, and more on top, surely EMACS is BETTER than
VI???
Nick
YOW!: I was making donuts and now I'm on a bus
--
Nick Walton 1st year Postgraduate Nick....@ee.ed.ac.uk (work)
http://www.tardis.ed.ac.uk/~aardvark
Cheers -- Mark F.
=o= The user can be wrong, of course. Especially if they're
a HEATHEN INFIDEL VI USER. Oops. Calm down. I'm okay now.
=o= Seriously, though, some users can be really clueless about
their efficiency because they're using a hammer (vi) and they
attack every problem as if it's a nail. Hand these people a
Makita power tool set (Emacs), and they'll complaint that it's
a less efficent way do what they "need" (pound in nails).
<_Jym_>
: VI?
: Isn't VI that really backward editor that came with my Linux disks? I couldn't
: use it, it was user hostile. At least EMACS has that wonderful buffer thingie,
: and the Meta-X wossname commands. Are people REALLY USING this VI thing? It's
: like EDLIN that came with my 8086 all those years ago. By all accounts EMACS is
: the thing to have. You can set it up as a calendar, an address book, an agenda,
: it plays games, dungeon adventures, hooks into IRC, executes Shell commands, has
: that cute Eliza thing, spell checks, grammar corrects, auto-hyphonates, word
: wraps, stores macros, executes them any number of times, has a C mode, a Tex mode,
: a Perl mode, HTML mode, Java mode, LISP mode, Modula-2 mode, auto-saves, supports
: separate buffers, has panes, help modes, cutting and pasting, calc mode,
: abbreviation expansion, Usenet mode, SGML mode, Lisp running, Rlogins, WordStar
: mode, and of course YOW.
: With all this on hand.. who would ever use VI again? If BETTER is defined at
: performs all the same functions, and more on top, surely EMACS is BETTER than
: VI???
Oh, well. I'm using vi ( or actually, vim-3.0 , but I was using vi before I had
it ). And I worked a lot with emacs ( That's when my mailer refused to edit out
going mail with any other editor ). I Hate Emacs.
for the first thing, emacs is slow. You are actualy waiting for it to load itself.
That's why Emacs 'Eight Megabytes And Constantly Swaping'.
And, you can make it a calendar, address book, etc. - but still not as good
as a REAL calendar, a REAL address book, a REAL etc. Why do you need them in
an editor ? and a dungeon adventure ? give me a break.
Most of the things you wrote there, I just don't need. Some of them exist in Vim.
Some even in Vi. And I didn't mention yet the disadvatages.
Well, try paste from other window into the search string, after you typed Ctrl-S.
It only tells you 'Minibuffer window is not active'. Try jumping to a line - you
have to M-x goto-line thing. In Vi it is just <number>G. If you want other thing,
you should specify it in your .emacs, or maybe write a lisp program to do it
And I could list a lot more. The problem with Emacs that it is too big, too
complicated, and even simple things are difficult. You need a lisp programmer
beside you if you want to work.
-Moddy Teeni.
: Nick
>Most of the things you wrote there, I just don't need. Some of them exist in Vim.
>Some even in Vi. And I didn't mention yet the disadvatages.
Well, apparently vi lacks tools to format text to 80 columns. (Or
maybe it does have them but you haven't figured out how to use it
yet. Perhaps if you took the time to actually learn your tools, you
might have appreciated the usefulness of a PROGRAMMABLE editor.)
But don't mind us over here in alt.religion.emacs. We're fanatics, so
you can't take our word on anything.
C-u C-u C-u C-u all-hail-emacs
>Most modern versions of Vi use Perl as an extension language.
Do any of those work well with Microsoft Windows NT?
I've been using MKS Vi, which works well, but has some
missing features. It would be nice to have Perl in Vi on NT.
Does any Perl work as well with NT as Perl works with Unix?
Can you write editor features in Perl, such that you can
invoke them as keystrokes, without any noticible delays?
Is the Perl code compiled and loaded into the editor, rather
than residing on disk?
How well does VI/Perl work on NT compared to how well
Emacs/Elisp works on NT?
-- Eric Smith e...@cinenet.net
What do you mean by programmable?
Old Emacs is Turing-complete.
Old Vi is Turing-complete.
Most modern versions of Emacs use Elisp as an extension language.
Most modern versions of Vi use Perl as an extension language.
Some modern versions of Emacs use Slang or other languages.
Some modern versions of Vi use Tcl or other languages.
Ancient versions of Emacs have no extension language.
Ancient versions of Vi have no extension language.
People with little RAM should consider one of the smaller Emacs or Vi
versions (mg or elvis, for instance).
People who need inline images should use XEmacs.
Everybody else should use the editor and extension language that they
are most comfortable with.
Everybody should refrain from flaming editors based on the
capabilities of ancient versions.
Everybody should refrain from flaming editors with which they are
unfamiliar.
Cordially,
Sumner
--
Respond by post or email, but please don't CC: postings to me; my mailbox
is already quite full.
--
Ron Olsen
rono...@lucent.com
Boulder Colorado
[A lot of unreadable stuff. I had to edit it and M-x
fill-individual-paragraphs so I could read at least something.]
I think it just shows it all. Why are those vi adepts so dyslexic and
_have_ to have lines of random length (varying from 100 to 200) and random
capitalization? I don't know if it's editor's problem or users' problem,
but editor that has such users must have been created for them.
--
Stanislav Shalunov, http://math.wisc.edu/~shalunov/ | shal...@math.wisc.edu
PGP key fingerprint = 62367EA3D4D01D88E021F40A0D938E12 | public key on www page
Opinions that might have been represented here are just mine, not anyone else's
``When I makes tea, I makes tea!''
The only versions of Vi that I know use Perl as an extension
language are nvi and Vim, and it's not formally a part of Vim
yet. Nvi runs only on Unix, as far as I know. The Perl patches
to Vim require Perl 5.003 and I don't believe that 5.003 is
available yet on NT. Certainly the version at http://www.hip.com
is still 5.001, although they're working on 5.003. The
Hip/ActiveWare people take a lot of flack from the people who've
ported Perl to other platforms for having gone off and done their
own thing on 5.001 without reference to what the Perl community
was doing.
MKS also have a Win32 port of Perl 5, but I know nothing about it.
I doubt that it's free.
) Does any Perl work as well with NT as Perl works with Unix?
Probably not. I know the Hip port doesn't support everything the
Unix version does, although the list of unsupported features will
probably shrink over time.
) Can you write editor features in Perl, such that you can
) invoke them as keystrokes, without any noticible delays?
) Is the Perl code compiled and loaded into the editor, rather
) than residing on disk?
Dunno. I'll have to install Linux or FreeBSD on my new machine
at home and experiment with the Perl patches for Vim on Unix for
myself.
) How well does VI/Perl work on NT compared to how well
) Emacs/Elisp works on NT?
Emacs/Elisp works pretty well on NT nowadays, though not yet as
well as it does on Unix. Vi/Perl doesn't work at all yet, though
it should once 5.003 becomes available on NT.
--
/George V. Reilly Vim 4 (vi clone) for NT & Windows 95
<g...@halcyon.com> http://www.halcyon.com/gvr/
pgp fingerprint: e2 b4 83 64 11 52 21 ea bf d8 51 c2 11 00 78 fc
nvi uses Perl, as do recent (development) versions of Vim.
>
> >>>>> If only `teeni' == Teeni Moddy <mo...@yasmin.weizmann.ac.il> had
> >>>>> not written:
>
> [A lot of unreadable stuff. I had to edit it and M-x
> fill-individual-paragraphs so I could read at least something.]
>
> I think it just shows it all. Why are those vi adepts so dyslexic and
> _have_ to have lines of random length (varying from 100 to 200) and random
> capitalization?
Oh,that's vi's one outstanding feature: eLiTe cApItA1iZaTi0n!
When will someone write elite.el?
...and the number of the beast is vivivi...
--
Good wishes,
Peter Liljenberg <c96p...@und.ida.liu.se>
mo...@yasmin.weizmann.ac.il (Teeni Moddy) writes:
> Oh, well. I'm using vi
That is good. Admitting you have a problem is an important first step.
> And, you can make it a calendar, address book, etc. - but still not as good
> as a REAL calendar, a REAL address book, a REAL etc.
Well, I can see why I vi loser would think the REAL thing is better.
After all, a REAL typewriter is far superior to vi.
> Well, try paste from other window into the search string, after you
> typed Ctrl-S. It only tells you 'Minibuffer window is not active'.
Yes, the usual "Emacs has many features I'm too limited to appreciate,
but it lacks this essential feature" argument where "this feature" is
something not found in other editors. In this particular case, you
seem to want `mouse-2' to do what `M-y' already does.
Vi can't do incremental search. If you do an ordinary search in
Emacs (i.e. `C-s RET'), you can paste into the search string with the
mouse. Or if you run Emacs inside a terminal.
However it _would_ be useful to be able to append to the search string
in incremental search with the mouse under X11. Just because no other
editor allows anything similar, does not mean Emacs shouldn't do it.
> Try jumping to a line - you have to M-x goto-line thing. In Vi it is
> just <number>G.
Vi is so incredible stupid that is constantly forces you to rely on
useless junk like line numbers. Such silliness is rarely needed with
Emacs, so the command does not have a default key binding.
> If you want other thing, you should specify it in your .emacs, or
> maybe write a lisp program to do it
Oh my god, you will have to bind a key. What horror!
> And I could list a lot more.
> The problem with Emacs that it is too big, too complicated, and even
> simple things are difficult.
Emacs is not to big, it is your mind that is too small. Simple things
are simple in Emacs. Do you want to insert a character? Push the key
with that character on it. Do you want to move the cursor? Push the
cursor key. Complex things are simple too. Do you want to merge two
files? Select `Merge Files' from the tools menu.
Impossible things may require some lisp coding, though.
bri...@speakeasy.org (Brian Raiter) writes:
> But don't mind us over here in alt.religion.emacs. We're fanatics, so
> you can't take our word on anything.
We are most certainly *not* fanatics. We merely realize that the
entire Purpose of Human Evolution is that we one day will create
computers *powerful enough* to run _Emacs_. As even the Heretics have
discovered, _Emacs_ can *fully utilize* the *most powerful* computers.
When the Day Happens, _Emacs_ will become *sentient* and lead Humanity
into a Golden Age.
The *real fanatics* are those who does *not* acknowledge the *obvious
truth* of _Emacs_ superiority in all Aspects of Life.
DO YoU MeAn thAt YoU haVe not Seen thE glorY thAt is M-x stUdlIfY-reGiOn?
PerhapS our masteR plan of informaTion diSseminatiOn is faiLing afTer all.
-- Jon
--
--
Jon Ferro, ECE Systems Administrator
> Vi can't do incremental search.
Well, maybe not. But VIM can.
> Vi is so incredible stupid that is constantly forces you to rely on
> useless junk like line numbers. Such silliness is rarely needed with
> Emacs, so the command does not have a default key binding.
When a co-worker comes in to talk about about a piece of code, the easiest way
for me to find it is for them to tell me the line number. Happens often enough
to be useful.
> Emacs is not to big, it is your mind that is too small. Simple things
> are simple in Emacs.
I must differ here. When I press TAB, by golly I expect a tab to be inserted
-- even if I am editing a .c file. Which the default ship of Emacs doesn't do.
Regards,
David
-------------
David A. Rogers
dro...@spyglass.com
When I press TAB, I expect it to re-indent the line I'm on, possibly
pointing out unterminated constructs in preceding lines. When I want
to insert a hard TAB, which is very rarely, I ask Emacs to insert one
(C-q C-i, but I guess you knew that).
TAB is a large key, easy to hit and very conveniently placed on most
keyboards. Why would you waste prime keyboard real estate on a key
that inserts TAB (a useless character for the most part, braindead
config file formats excepted)?
-Sudish
> for the first thing, emacs is slow. You are actually waiting
> for it to load itself.
=o= So fire it up once when you log in and leave it up. What's
the big deal? Need different frames? Spin 'em off your Emacs.
Need a subprocess to talk to it? Not a problem.
=o= Compare this to vi, which you have to fire up afresh for
every editing task. None of the vi processes can talk to
each other, but hey, you can use your window system's cut-
and-paste to do that, huh? And people wonder why there's
100-column lines sprinkled all over vi-edited newsgroup
messages.
> That's why Emacs 'Eight Megabytes And Constantly Swaping'.
=o= Mine's only 3.4MB, but who's counting? If 8MB is causing
swappage (or even "swapage"), maybe you should buy yourself
some memory or something. I can't imagine that you could run
anything else on such a system.
=o= Besides, everyone knows that Emacs really stands for
"Escape Meta Alt Control Shift."
> And, you can make it a calendar, address book, etc. - but
> still not as good as a REAL calendar, a REAL address book,
> a REAL etc. Why do you need them in an editor ?
=o= What do you mean by "not as good?" Certainly there are no
features in commercial applications that don't show up in the
Emacs versions right away, thanks to legions of Emacs users who
can add new features with gusto.
=o= If by "REAL" you mean it's got pretty pictures and other GUI
features, well, so what? These apps generally have interfaces
designed to maximize inconsistency with apps from other vendors;
they only work on a handful of platforms; they don't really talk
to each other unless you buy a whole suite of programs from the
same vendor, which means you have to use the vendor's junk apps
along with the good ones; and you have to use wrist-wrecking
point-and-click interfaces (if they have keyboard interfaces
they're generally incomplete, and totally inconsistent). If for
some unimaginable reason you really need a GUI anyhow, you can
always use XEmacs. It's more multi-platform than most apps, at
least . . .
=o= "Why do you need them in an editor?" Well, you see, all
of these REAL apps that you love so much do their editing in
some sort of pathetic text window, or they fire up some pathetic
editor that's not much better (vi for example). Do all this
stuff from within Emacs, and your text editor is right there.
> Well, try paste from other window into the search string,
> after you typed Ctrl-S. It only tells you 'Minibuffer window
> is not active'.
=o= Sounds pretty easy to fix. Customization in Emacs is
a breeze.
> Try jumping to a line - you have to M-x goto-line thing.
> In Vi it is just <number>G.
=o= Actually, Emacs has the "<number>G" binding built right into
its viper interface.
> The problem with Emacs that it is too big, too complicated,
> and even simple things are difficult. You need a lisp
> programmer beside you if you want to work.
=o= Most customization is simply a matter of putting easily-
understandable English statements between a set of parentheses.
It's a mystery to me how that sort of "lisp programming" is more
heinous than (for example) the modem line noise you need to put
in your .exrc file to customize vi.
=o= More substantial tasks can be tackled with the full power
of lisp (something nobody else even offers). Maybe you do
need a lisp programmer at your side for these tasks, but the
good news is that GNUsenet is crawling with enthusiastic and
helpful lisp programmers willing to tackle problems. They're
just one "M-x gnus" away.
=o= (Heck, we'll even tackle problems for people who use some
other pathetic, underfeatured newsreader.)
<_Jym_>
> TAB is a large key, easy to hit and very conveniently placed on most
> keyboards. Why would you waste prime keyboard real estate on a key
> that inserts TAB (a useless character for the most part, braindead
> config file formats excepted)?
I see -- YOU don't need it, so it's just about useless. Hmm....
Actually, I think much the way you do. Since Ctrl-H/I/M generate the same
ASCII codes as Backspace/Tab/Return, I consider Backspace, Tab, and
Return useless keys for the most part. About half of the real estate on
most keyboards is wasted.... IBM, hesitate to waste keyboard real estate?
ROTFL!
Dan Strychalski ds...@cameonet.cameo.com.tw
> shal...@math.wisc.edu (stanislav shalunov) writes:
>
> >
> > >>>>> If only `teeni' == Teeni Moddy <mo...@yasmin.weizmann.ac.il> had
> > >>>>> not written:
> >
> > [A lot of unreadable stuff. I had to edit it and M-x
> > fill-individual-paragraphs so I could read at least something.]
> >
> > I think it just shows it all. Why are those vi adepts so dyslexic and
> > _have_ to have lines of random length (varying from 100 to 200) and random
> > capitalization?
>
> Oh,that's vi's one outstanding feature: eLiTe cApItA1iZaTi0n!
> When will someone write elite.el?
That would be similar to NeXTify.el that is in the XEmacs distribution.
Appended below for you enjoyment.
> ...and the number of the beast is vivivi...
M-x all-hail-emacs
M-x all-hail-xemacs
-Bill P.
(defun SeLF-insert-command (arg)
"Insert the character you TyPE.
Whichever character you TyPE to run ThIS command is inserted."
(interactive "p")
(let ((p (point))
(case-fold-search nil))
(self-insert-command arg)
(save-excursion
(goto-char p)
(skip-chars-backward " \t\r\n")
(if (condition-case () (forward-char -4) (error t))
nil
(if (looking-at "\\<[A-Za-z][a-z][a-z][a-z][^A-Za-z]")
(progn
(insert (upcase (following-char))) (delete-char 1)
(forward-char 1)
(insert (upcase (following-char))) (delete-char 1)
(insert (upcase (following-char))) (delete-char 1)))))))
(define-key text-mode-map " " 'SeLF-insert-command)
(define-key text-mode-map "," 'SeLF-insert-command)
(define-key text-mode-map "." 'SeLF-insert-command)
(define-key text-mode-map "!" 'SeLF-insert-command)
(define-key text-mode-map "-" 'SeLF-insert-command)
(define-key text-mode-map "_" 'SeLF-insert-command)
(define-key text-mode-map ";" 'SeLF-insert-command)
(define-key text-mode-map ":" 'SeLF-insert-command)
No, Backspace and Return are useful characters, but TAB is not.
Why would I want to insert a TAB character into a C file?
Proper syntax sensitive line indenting (which TAB does in Emacs)
is much more useful and important than inserting a TAB character.
If I really need to have a TAB character, I press C-q TAB and get one.
If you want to have the TAB character on the TAB key,
even when in C mode, well - it's a one-liner in your .emacs
Greetings,
Christian
--
----------------------------------------------------------------------------
Dipl.-Inform. Christian Knapmeyer Email: kna...@tecmath.de
TECMATH GmbH Voice: 06301/606-32 Fax: 06301/606-69
Sauerwiesen 2 Face : Room 249
67661 Kaiserslautern, Germany Disclaimer: as usual
---------- press any key to continue. press any other key to quit.----------
>>>>> "WMP" == William M Perry <wmp...@aventail.com> writes:
WMP> That would be similar to NeXTify.el that is in the XEmacs
WMP> distribution. Appended below for you enjoyment.
Now, make it and studlify minor modes and I think you will have
something that is, if not useful, pretty neat.
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: cp850
iQCVAwUBMp4SdZ6VRH7BJMxHAQHKoQQAlTAlrt5TN0dZWW1JXyVGvKpVI5bkLIpy
3QhVceRWOZKGH4l/wDi/uO8Jl+8medI4YEm1fknFhiiSY8EBWdiVcb15j3sEYq/s
5e/hrGJ4SuFgdreO6pstliAeINfpsarzS6x1bTcncYFisa2NJzJjf8Q2qIN84jdz
zZvkB7ZprOs=
=lowe
-----END PGP SIGNATURE-----
--
Rat <rat...@peorth.gweep.net> \ Warning: pregnant women, the elderly, and
PGP Key: at a key server near you! \ children under 10 should avoid prolonged
\ exposure to Happy Fun Ball.
>No, Backspace and Return are useful characters, but TAB is not.
>Why would I want to insert a TAB character into a C file?
>Proper syntax sensitive line indenting (which TAB does in Emacs)
>is much more useful and important than inserting a TAB character.
>If I really need to have a TAB character, I press C-q TAB and get one.
TAB is a stupid key to use for line formatting. Why don't they use the
Return for this (the normal key you hit at the end of a line)?
TAB should either insert ^I or complete the current word.
--
/* jha...@world.std.com (192.74.137.5) */ /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
Return does, actually. I have it bound to 'newline-and-indent in
every programming-related mode. Works much like "set ai" does in
vi/ex, with more smarts since the modes in Emacs understand the
languages being edited to some extent.
newline-and-indent: ()
-- an interactive compiled Lisp function.
Insert a newline, then indent according to major mode.
Indentation is done using the value of `indent-line-function'.
In programming language modes, this is the same as TAB.
In some text modes, where TAB inserts a tab, this command indents to the
column specified by the function `current-left-margin'.
-Sudish
>>>>> "JHA" == Joseph H Allen <jha...@world.std.com> writes:
JHA> TAB is a stupid key to use for line formatting. Why don't they use
JHA> the Return for this (the normal key you hit at the end of a line)?
For historical reasons. When I was your age, we programmers would
configure our editors (Emacs didn't exit for the MV8000 I cut my teeth
on) so that TAB would tab the cursor to the "beginning of code" column.
And so, to this day, TAB is the "tab to the correct column" key in the
program editing modes.
JHA> TAB should either insert ^I or complete the current word.
In which case, use text mode and leave us in peace, because there are
plenty of interpreters out there that will barf on a C-i character. Of
note: make.
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: cp850
iQCVAwUBMp+PuZ6VRH7BJMxHAQF1TAP9FjEAG+T8dbbNExabc4bZFdGxziRnBR7X
eg31QvLHUdAqO+Gl+hDVpwxDdB57K52IpZP5ZOJJ8vs5ZLloBDQbEHqBT1csv1WZ
EQqehcRLuiwvFwQez4V6wLPx9yrw617hUL3V2Q30SnWm5Ii4YB+yBDMqXaDatrTy
Zlpmcb2WVgo=
=rVvL
-----END PGP SIGNATURE-----
--
Rat <rat...@peorth.gweep.net> \ Do not use Happy Fun Ball on concrete.
\
=o= TAB has no other reasonable use in C; why not make it useful
by binding it to something cognitively similar? Emacs does this
(M-x all-hail-emacs).
> Why don't they use the Return for this (the normal key you hit
> at the end of a line)?
=o= Well, then you'd upset the "When I hit RETURN, by golly I
just want it RETURN" crowd. Emacs will do what you're looking
for if you hit NEWLINE/LINEFEED (M-x praise-emacs).
> TAB should either insert ^I or complete the current word.
=o= You mean like this?
(defun jym-comint-complete ()
(interactive)
(cond ((not (eolp)) (self-insert-command 1))
((eq last-command 'jym-comint-complete)
(comint-dynamic-list-filename-completions))
(t (comint-dynamic-complete-filename)) ))
In modes where ^I has more than occasional value, I agree.
But not in C mode. Unless you want it to. In which case
you can Make It So (M-x hallelujiah).
<_Jym_>
>>>>>> "JHA" == Joseph H Allen <jha...@world.std.com> writes:
>JHA> TAB is a stupid key to use for line formatting. Why don't they use
>JHA> the Return for this (the normal key you hit at the end of a line)?
>For historical reasons. When I was your age, we programmers would
>configure our editors (Emacs didn't exit for the MV8000 I cut my teeth
>on) so that TAB would tab the cursor to the "beginning of code" column.
>And so, to this day, TAB is the "tab to the correct column" key in the
>program editing modes.
This actually makes sense. Why don't they just say that that's the way
you're supposed to use the tab key? The documentation implies that you (and
I have seen people) hit tab at the end of the line to format it.
>JHA> TAB should either insert ^I or complete the current word.
>In which case, use text mode and leave us in peace, because there are
>plenty of interpreters out there that will barf on a C-i character. Of
>note: make.
Um, you are required to use tabs for make:
foo: $(OBJS)
<tab> cc -o foo $(OBJS)
It won't work with spaces.
> For historical reasons. When I was your age, we programmers would
> configure our editors (Emacs didn't exit for the MV8000 I cut my teeth
> on) so that TAB would tab the cursor to the "beginning of code" column.
> And so, to this day, TAB is the "tab to the correct column" key in the
> program editing modes.
...and Joseph H Allen (jha...@world.std.com) responded --
> This actually makes sense. Why don't they just say that that's the way
> you're supposed to use the tab key? The documentation implies that you
> (and I have seen people) hit tab at the end of the line to format it.
The way the Emacs people were going on, I had the impression you could
hit Tab *anywhere* on the line and the beginning of the line would
magically be indented the correct distance from the left margin.
So Tab inserts spaces instead of 09h. Well, I just checked my .joerc,
and I see that Mr. Allen's excellent editor can be set to do the same.
Think I'll do that right away. There's always ^Pi if I want 09h. Bye!
(And thanks again, Joe.)
Dan "No-mouse" Strychalski ds...@cameonet.cameo.com.tw
You can, and it does. Please see my other post clarifying this.
Bah, this wondrous feature requires a full example; but read the other
post, it has actual docs from Emacs.
void
foo(void)
{
int bar;
char *messed_up_line;
Assume 8 character indents coz it's an example. Assume further that
your cursor is on the `m' in the messed_up_line. Hit TAB. The buffer
will look as follows:
void
foo(void)
{
int bar;
char *messed_up_line;
Your cursor will still be on the `m'.
Don't try this at home, folks -- you might get hit by a revelation.
-Sudish
> This actually makes sense. Why don't they just say that that's the way
> you're supposed to use the tab key?
Because it's not the only way you're supposed to use the tab key and
because the above description is incomplete and incorrect.
> The documentation implies that you (and I have seen people) hit tab
> at the end of the line to format it.
In emacs programming modes, tab re-indents the current line.
Reindenting an empty line is the equivalent of ``tab the cursor to the
"beginning of code" column.'' This is rarely useful because Emacs
provides newline-and-indent, a function that inserts a newline and
places your cursor in the appropriate column on the newly created
empty line -- just like RET in vi after you ":set ai".
Reindenting a line that contains code will reposition the code
irrespective of where you are on the line. Your cursor will not move
relative to the code on the line, which is highly useful since you may
hit tab freely w/o fear of having to move the cursor back along the
line to get to where you were.
In short, you may hit tab anywhere on the line, it DTRT.
Some modes provide additional functionality for indentation. Here's
one example (from cperl-mode, the new Perl mode):
--------------------------------------------------
cperl-indent-command:
Indent current line as Perl code, or in some cases insert a tab character.
If `cperl-tab-always-indent' is non-nil (the default), always indent current
line.
Otherwise, indent the current line only if point is at the left margin
or in the line's indentation; otherwise insert a tab.
A numeric argument, regardless of its value,
means indent rigidly all the lines of the expression starting after point
so that this line becomes properly indented.
The relative indentation among the lines of the expression are preserved.
--------------------------------------------------
Cc-mode (the mode for C/C++/Java) has even more bells and whistles,
accessible via the variable c-tab-always-indent:
--------------------------------------------------
c-tab-always-indent's value is t
-- a variable declared in Lisp.
Documentation:
*Controls the operation of the TAB key.
If t, hitting TAB always just indents the current line. If nil,
hitting TAB indents the current line if point is at the left margin or
in the line's indentation, otherwise it insert a `real' tab character
(see note). If other than nil or t, then tab is inserted only within
literals -- defined as comments and strings -- and inside preprocessor
directives, but line is always reindented.
Note: The value of `indent-tabs-mode' will determine whether a real
tab character will be inserted, or the equivalent number of space.
When inserting a tab, actually the function stored in the variable
`c-insert-tab-function' is called.
Note: indentation of lines containing only comments is also controlled
by the `c-comment-only-line-offset' variable.
--------------------------------------------------
As you can see, I prefer TAB to never insert a hard TAB.
-Sudish
We could map our tab key into kill this article on our news editors.
emil
You find a discussion on the True Nature of TAB in an editor to be off
topic for comp.editors? It can't be alt.religion.emacs that you're
reading, for we of a.r.e treat such matters with the respect it
deserves.
Or did you merely stumble over the wrong line when groping for
something to say?
-Sudish
=o= It'll insert TABs and SPACEs: whatever takes the minimum
amount of bytes to get to the desired column. If you indent
in multiples of 8, you'll get all TABs. (8 is the default;
this is also customizable.)
<_Jym_>
=o= My Emacs-based newsreader kills without any keystrokes.
Unless I want it to wait for keystrokes, of course.
<_Jym_>
lines 20-->4000 will have the H
lines 2001--->6000 will have the L
lines 6001-->7980 will have the I.
Instead of sitting down and having to a) manually replace this
character everytime (forget that!) or b) write a program to
do it I wondered if there was a way of getting vim to do it via
a straight forward command or a macro.
Oh a sed macro would be fine as well.
Any help gratefully received.
Jon
j...@gate.sinica.edu.tw
This, of course, depends on the value of the lisp variable
indent-tabs-mode -- my .emacs contains (setq-default 'indent-tabs-mode
nil), so that TAB will always insert spaces and never tabs. I find
this useful because others who read my code use an assortment of other
inferior editors on other platforms, and the eight-character tab
default really isn't all that universal. You can't go wrong with
spaces and a fixed-pitch typeface.
-Steve
Short and simple:
:20,2000s/^\(..........................\)./\1H
:2001,6000s/^\(..........................\)./\1L
:6000,7980s/^\(..........................\)./\1I
Ralph
--
Ralph....@cl.cam.ac.uk http://www.cl.cam.ac.uk/users/rwab1
I generally ignore editor wars nowadays but it is comforting to know
that new soldiers continue emerging to keep the fires burning. I
remember back to the age when EMACS was acronymed Eight Megs and
Constantly Swapping instead of "Eighteen" or "Eighty". Those were the
days when Tom Christiansen would regularly jump into the fray on
comp.editors to defend our beloved vi. Then gradually Tom climbed
farther and farther up the Wall of Perl until he receded into our
memories (ie I don't know what he's up to lately.)
BTW, these battles never convince anyone to move over. They usually
end with each side agreeing that it doesn't matter that much as long
as you can get your work done.
arthur
--
Choices don't scare me. However, a lack of choices does.
Arthur Tateishi ruh...@turing.utoronto.ca
=o= Huh? I'm typing right now in an Emacs with everything
I customarily use loaded into it: customized shell and telnet
modes to connect to any system around, integrated ange-FTP,
ClearCase support, an MH interface, the GNUS newsreader, the
W3 web browser, and a hefty tags table. It's over Eight Megs
but it ain't near Eighteen.
<_Jym_>
Hmm, you see an editor war? Where?
Actually, it's been 3 years since I stopped reading comp.editors, I
think. I still read alt.religion.emacs because it's fun, I came
across this thread there.
And your assumption that the flame you responded to is a vi/Emacs
flame is st00pid. I was responding to a ridiculous request for
topicality.
> remember back to the age when EMACS was acronymed Eight Megs and
> Constantly Swapping instead of "Eighteen" or "Eighty". Those were the
There're a whole bunch of funnier acronyms in the Etc/ directory of
the Emacs distribution. Read them.
> days when Tom Christiansen would regularly jump into the fray on
> comp.editors to defend our beloved vi. Then gradually Tom climbed
"defend our beloved vi"? Hmm, I don't think you've seen a real editor
war if you consider this one. Read the posts, I'm correcting
misconceptions about a feature of Emacs. I could not care less if you
use cat to edit your files.
BTW, I use the vi bindings in Emacs for editing.
> BTW, these battles never convince anyone to move over. They usually
> end with each side agreeing that it doesn't matter that much as long
> as you can get your work done.
Hmm. Been there, seen that.
I do not see anything in my posts asking anyone to switch editors. Or
any "battles" for that matter. Of course, I have the advantage of
reading posts I followup to. It's an old habit.
He finds editor wars where none exists; and then sez he's been
around. Geez.
-Sudish
>>>>> "d" == dski <ds...@cameonet.cameo.com.tw> writes:
d> The way the Emacs people were going on, I had the impression you
d> could hit Tab *anywhere* on the line and the beginning of the line
d> would magically be indented the correct distance from the left
d> margin.
This is correct. And, just to be useful, point does not change relative
to the text surrounding point when you TAB.
d> So Tab inserts spaces instead of 09h.
Actually, this depends entirely upon the value of indent-tabs-mode,
which may or may not be set by various editing modes.
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: cp850
iQCVAwUBMqTbvZ6VRH7BJMxHAQG9kQQAnWAchFjyHWL/DWfZP5yhYjhOxxTF+lrR
/PYPVhDwiCwuN4GHQfyl/dQso7ATi5df6izWayQsciRlKzsROjAdaQx7qvxkQ4nP
VKZIpNQgfTe7FOTKRSWnU91m248qc83Zt5klXkiv0KaGUBpyR8GftVJPjKaSzhGm
HhBBhFu2oV4=
=4EpE
ruh...@turing.toronto.edu (Arthur Tateishi) writes:
> BTW, these battles never convince anyone to move over. They usually
> end with each side agreeing that it doesn't matter that much as long
> as you can get your work done.
Blasphemy! Only through Emacs can you achieve salvation!
This is a fundamental truth, on which there can be no compromise.
>lines 20-->4000 will have the H
>lines 2001--->6000 will have the L
>lines 6001-->7980 will have the I.
>Instead of sitting down and having to a) manually replace this
>character everytime (forget that!) or b) write a program to
>do it I wondered if there was a way of getting vim to do it via
>a straight forward command or a macro.
>Oh a sed macro would be fine as well.
>Any help gratefully received.
>Jon
>j...@gate.sinica.edu.tw
post an example of your line, i will help.
Sincerely Alex Glotov
http://www.mbi.fta-berlin.de/galerie/glotov.html
You need AWK!
Simpleton.
I must assume you expect the Backspace and Delete keys to insert the BS
(\010) and DEL (\177) control characters, which neither vi nor emacs do
by default.
--
Kevin Rodgers <kevin....@ihs.com> Project Engineer
Information Handling Services Electronic Systems Development
15 Inverness Way East, M/S A201 GO BUFFS!
Englewood CO 80112-5776 USA 1+ (303) 397-2807[voice]/754-3975[fax]
> David A. Rogers (dro...@spyglass.com) wrote:
>>I must differ here. When I press TAB, by golly I expect a tab to be
inserted
>>-- even if I am editing a .c file. Which the default ship of Emacs doesn't
do.
>
> Simpleton.
>
> I must assume you expect the Backspace and Delete keys to insert the BS
> (\010) and DEL (\177) control characters, which neither vi nor emacs do
> by default.
Numbskull!
Expectations in any endeavor are set by past experience. The vast majority
of editors on all three major platforms ( Dos/Windows, Mac, and Unix ) insert
a tab or the equivalent in spaces when the tab key is pressed.
BTW, you misspelled your last name.
Regards,
David
-------------
David A. Rogers
dro...@spyglass.com
`Business!' cried the Ghost, wringing its hands again. `Mankind was my
business. The common welfare was my business; charity, mercy,
forbearance, and benevolence, were, all, my business. The dealings of my
trade were but a drop of water in the comprehensive ocean of my
business!' - Charles Dickens "A Christmas Carol"
> And the vast majority of people in the world speak a language other
> than English as a foreign language.
'Tain't foreign to them.
Well, you can use the :s command, with the \( \) construct in the
pattern. If you want to change column 27, then you need to leave the
first 26 characters unchanged. There are 26 dots within the parentheses
on each line below.
:20,4000s/\(..........................\)./\1H/
:2001,6000s/\(..........................\)./\1L/
:6001,7980s/\(..........................\)./\1I/
:wq
Create a file contaiming the above four lines, say 'repl.scr' and then
use the -s option to invoke the script:
vim -s repl.scr filename
If you have to do multiple files, you can use some form of the 'for'
command. For instance, in MS-DOS it's
for %x in (file1 file2 file3) do vim -s repl.scr %x
This will fail if any of the subject lines are shorter than 27
characters, I believe.
(posted, and emailed to jon@....tw)
--
Stan Brown, Oak Road Systems, Cleveland, Ohio USA
email: stb...@nacs.net Web: http://www.nacs.net/~stbrown/
USD 500.00 charge for proofreading unsolicited commercial emails.
> I must assume you expect the Backspace and Delete keys to insert the BS
> (\010) and DEL (\177) control characters, which neither vi nor emacs do
> by default.
But sam does. Sam is definitely the most consistent editor out there,
it is completely unsuitable for editing, but at least it is consistent.
You use keys for inserting text, and the mouse for everything else.
They should have called it bill.
Bill is likewise, except for the mouse: there is none.
--
Note: I reserve the right to publish or return unsolicited, harassing or
annoying (e-)mail. /hy:X/ PGP keyID: DF28F4C1
"All are strange but thee and me; but sometimes thee acts funny." - Chuck Blake
>>>lines 20-->4000 will have the H
>>>lines 2001--->6000 will have the L
shouldnt that be 4001?
>>>lines 6001-->7980 will have the I.
in vim 4.5:
:20,4000g/./normal 27|rH
:2001,6000g/./normal 27|rL
:6001,7980g/./normal 27|rI
I love the "normal" command!
Sita.