Results 1 to 3 of 3
When Richard Stallman showed emacs to me in 1977, I wanted some of the features. But I was later stupid enough to also want to be part of the crowd ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-03-2004 #1
- Join Date
- Feb 2004
- Move into disaster areas
Can emacs easily do what textpad does?
When Richard Stallman showed emacs to me in 1977,
I wanted some of the features. But I was later stupid enough
to also want to be part of the crowd going for m$-dos and
windows 3++$$. So after shelling out $4digits++ for
multiple copies of multiple versions and seeing a never
ending mess of patches on bugs, I tried to insulate myself by
using textpad, a shareware program sort of like emacs. Now I am
using Open software most of the time now and want it exclusively
sometime near in the future. But I must do it so that my
students and readers can/will follow me.
However there are a few things textpad does which I can't figure
out how to do in emacs21. I know the smart aleck answer is use Lisp
and you can do everything. But I am a professor and author doing
most of my teaching & writing in third world countries like Indonesia
and China where nearly all students just steal m$ and use simple
minded shareware or commercial programs without paying for them.
Even the ones who could program are so mired in corruption and
theft that they rarely program anything.
In textpad, we can search an entire hard disk looking for
regexp. When results are found, textpad lists all of the
pathnames and a snip from the line containing the expression.
We can just click on the pathname and textpad will start
editing that file. If it is html, we right-click and textpad
sends a message for the default browser to show it.
In emacs21, if I start a search at / it doesn't take long to
crash. If I am crippled to do only one directory at a time
it always ends with the message that grep terminated abnormally.
Once I have pathnames, I have to mark, move, C-w, C-y, C-x C-f,
C-y and then if it is html I have to hit the browser with the
mouse then erase the default URL then C-y.
I am sure that emacs21 and Lisp can both do things textpad
can't do but will someone help me so that I can help my students
get started with this stuff that every beginner needs to do
everyday if they are going to be well organized and learn huge
systems such as GNU/debian on their own. In developed countries,
people just jump on google and find stuff. Here most poor
students don't have Internet access and those who do are on
such poor connections that they can't search as fast as
- 02-03-2004 #2
- Join Date
- Apr 2003
- London, UK
I could suggest an easy way to acheive similar results..
open up a shell, and use the grep command.
eg, if you wanted to find all files anywhere on your drive that contained the word "Emacs" for example, you could run:
grep Emacs / -rn | more
the "-r" means recursive, ie, search in subdirectories as well, and the "-n" means display the line number as well.
If you want case insensitive, use "-i". ie, it will match "Emacs", "emacs", EMACS" etc.
I dont know how helpful this is to your situation though.
Another little trick i often use is pipe it through grep again, to filter down my results.
eg, if i wanted to find all files that had the word "emacs", and that doesnt have the word "lisp" on the same line, you can use:
grep emacs / -rin | grep -v lisp | more
- 02-04-2004 #3
- Join Date
- Oct 2001
- Täby, Sweden
I guess that's already what you're doing, though, suguru, isn't it? However, what you can do instead of C-w C-y C-x C-f C-y RET is use the find-file-at-point command. Best thing is probably to bind it to a key - I already have it on C-x M-f. Use M-x global-set-key C-x M-f find-file-at-point RET or add "(global-set-key "\C-x\M-f" 'find-file-at-point)" to your ~/.emacs file.
It would be harder to make it autodetect HTML and launch a browser from it, though. You probably have to do that with LISP. The best solution is probably to make the extension and send a patch to the Emacs team - that way you'll have it in a future version of Emacs that all your students can use. ;-)
So you've met RMS in person, eh? Care to tell us more about it? =)