all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jason Earl <jearl@notengoamigos.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Open Hypspec with w3m
Date: Sat, 29 Jan 2011 22:06:12 -0700	[thread overview]
Message-ID: <87mxmjx9ob.fsf@notengoamigos.org> (raw)
In-Reply-To: 87r5bvb9u1.fsf@puma.rapttech.com.au

On Sat, Jan 29 2011, Tim X wrote:

> Jason Earl <jearl@notengoamigos.org> writes:
>
>> On Fri, Jan 28 2011, Stefan Monnier wrote:
>>
>>>> within my grasp.  You do realize, of course, that you are essentially
>>>> volunteering to look over some potentially very bad Elisp.  The only
>>>
>>> There's no worse Elisp than the one that's not yet written.
>>> And believe me, I've seen my share of bad Elisp,
>>
>> Thank you very much for the encouragement then.
>>
>
> The things I've found with lisp generally and elisp in particular
> (because I use it more and more)
>
> * Lisp and elisp are actually very easy to learn. Very little syntax,
>   no difficult to remember operator precedence and consistent form.

The more I learn about Lisp the more I wish I had become curious about
Lisp years ago.  I have been *using* Emacs to write software for years.
I can not believe that it never occurred to me to spend more time
actually hacking Emacs.  When I think of all of the tiny throwaway
Python scripts I have written over the years to mangle text files
(usually so that I could edit them in Emacs) it makes me want to cry.

> * Mastering lisp is an on-going process. I suspect this can take years.
>   Its actually one of the aspects I like about it as I am always seeing
>   new bits of code or ways of expressing various common idioms. I find
>   this keeps things 'fresh' and interesting. 

Any skill worth mastering is an on-going process.

> * Really search the manual. Many times I've been trying to implement
>   some extension or customization and am struggeling with how to
>   implement some feature only to find, after searching the elisp manual,
>   that either it already exists or most of the hard work has been done
>   and all I need to do is glue the bits together. 

Yes, if I would have gotten all the way to defadvice in the manual I
would not have needed to ask my questions.  Although, I will admit that
getting sucked into /Practical Common Lisp/ did not help my study of the
Emacs Lisp Reference.

I realize that I need to study harder, but I am still grateful to you
and to Stefan for pointing me in the right direction.

> * Have a go. Just get in there and do it. At first, it will probably be
>   slow and sometimes frustrating, but it gets much easier as the various
>   pennies drop into place. While everyone is a bit different, many find
>   (including me) that writing lisp is almost like a flow of
>   consciousness - as I'm working out the solution, I'm jotting down
>   these notes/rough draft and it just turns out that my notes are lisp.
>   Often, once the basic outline is written down, all I need to do is go
>   through refining and editing "the story".  

One thing is certain, the parentheses no longer bother me.  That's
certainly progress.

> * Use the scratch buffer and IELM (M-x ielm) to experiment and try out
>   ideas. I find 'exploring' a problem this way really helps cement a
>   solution. Also useful when learning. 

The *scratch* buffer is pretty handy.  I have been using it for
experimentation, and with company-mode on it is a pretty good tool.
However, I was wondering why there wasn't something like Slime's REPL
for Emacs Lisp.  As I mentioned above, I have been working through
/Practical Common Lisp/ using w3m to read the HTML version and Slime to
experiment in a REPL as I read.  If you ask me that is the most
brilliant way to learn a language imaginable.  I am going to buy the
actual book, as I believe that Peter Seibel and Apress richly deserve my
money.  But that setup is *way* better than reading a book.  I have done
most of my studying on my netbook, and so the whole thing is even more
portable than the book.

Anyway, it turns out that there was something like Slime's REPL for
Emacs Lisp.  I just did not know what that something was called.

Thank you.

> * Read/browse the source code. You will learn various techniques and
>   'tricks' and get to see how to do many common tasks. This is an
>   excellent way of understanding a new mode and gives you insight into
>   how you can tweak it for yourself. 

That is definitely one of the real advantages of Emacs.  Today I decided
I would "port" one of my small test CL programs to Emacs Lisp.  This
seemed like an easier first Elisp project than figuring out how to patch
browse-url.el so that browse-url can use different browsers depending on
the URL.

Baby steps.

I needed a function that returned the list of files in a directory.
Firing up ielm I was quickly able to find directory-files (simply by
starting to type directory hitting TAB and seeing what showed up).
Unfortunately, that returned the '.' and '..' entries as well as the
files I actually wanted.

My first impulse was to simply special case those entries, but I was
curious to see what actual Emacs hackers did.  So I poked around in
files.el and came across directory-files-no-dot-files-regexp.

This:

(directory-files "/home/jearl/" t directory-files-no-dot-files-regexp)

was precisely what I needed.

Emacs not only has a ridiculously comprehensive manual, easy access to
all of the docstrings in all of the Elisp (and C) code, and tools like
the *scratch* buffer and ielm, but it also comes with piles and piles of
the actual Elisp source that makes up the program.

I hate to admit it, but I basically use Emacs because it was basically
the only tool around when I first started using Linux.  I got used to
it, and even for pure end users it is a pretty impressive tool.  Now
that I am beginning to see it as a learning tool/development environment
I am a little surprised it is not more popular ;).

> As you get more comfortable with elisp, you will likely be surprised
> how often you crank out a simple rough emacs function to automate some
> task your doing - even just one-offs that were maybe a little too
> complicated for just a macro. However, just one warning. It can become
> addictive. f your not careful, you may find yourself spending too many
> hours hacking out bits of elisp or re-inventing features which already
> exist. Not really a problem unless it starts cuasing negative impact
> on the rest of your life!

Everyone needs a hobby.  Hacking Emacs at least is potentially useful.

Thanks again.

Jason


  parent reply	other threads:[~2011-01-30  5:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28 19:29 Open Hypspec with w3m Jason Earl
2011-01-28 23:00 ` Tim X
2011-01-28 23:33   ` Jason Earl
2011-01-28 23:58     ` [SOLUTION] " Jason Earl
2011-01-29  2:36       ` Stefan Monnier
2011-01-29 17:04         ` Jason Earl
2011-01-28 23:05 ` Stefan Monnier
2011-01-29  0:29   ` Jason Earl
2011-01-29  2:37     ` Stefan Monnier
2011-01-29 17:06       ` Jason Earl
2011-01-29 22:53         ` Tim X
2011-01-30  4:05           ` rusi
2011-01-30 14:47             ` Perry Smith
     [not found]             ` <mailman.10.1296398854.11759.help-gnu-emacs@gnu.org>
2011-01-30 15:11               ` Krzysztof Bieniasz
2011-01-30 15:45                 ` Open Hypspec with w3m (morphed into keyboards, etc) Perry Smith
     [not found]                 ` <mailman.15.1296402359.11759.help-gnu-emacs@gnu.org>
2011-01-30 16:34                   ` Krzysztof Bieniasz
2011-01-30 16:35                   ` Krzysztof Bieniasz
2011-01-30 16:38                   ` Krzysztof Bieniasz
2011-01-30  5:06           ` Jason Earl [this message]
2011-01-30  8:44             ` Open Hypspec with w3m Tim X
2011-02-01  4:15               ` Jason Earl
2011-02-01 12:33                 ` rusi
2011-02-01 21:15                   ` Tim X
2011-02-01 22:44                     ` Current Emacs Development (was: Open Hypspec with w3m) Jason Earl
2011-02-02  4:25                       ` Current Emacs Development Stefan Monnier
2011-02-02  5:58                         ` Jason Earl
2011-02-04 23:33 ` Open Hypspec with w3m Andy Moreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxmjx9ob.fsf@notengoamigos.org \
    --to=jearl@notengoamigos.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.