help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: conditionals in elisp


From: Drew Adams
Subject: RE: conditionals in elisp
Date: Mon, 26 Oct 2009 18:03:31 -0700

> I'm hoping someone will be kind enough to demonstrate a couple of
> brief conditionals in elisp... if and if else.

We are plenty kind enough. Kindness is not the problem.

> This may be a chintzy way to do it but I really do not want to pound
> away at elisp intro and the elisp manual for hours. 

You're exaggerating. Did you even try "pounding away" at it for the 2 minutes it
took you to write your question and mail it?

> That's when I bumped into my ignorance, realizing I had no idea how to
> write simple conditionals that would do this: (over verbosified for
> clarity)
>
>   (load-library "server")
>   (setq server-name "name")
>   if (! server-mode-enabled){  
>      (server-mode)
>   }

There's no shame in ignorance. Laziness is another matter.

1. Don't waste people's time here if you are unwilling to even look up `if' or
`conditional' in the Elisp manual. That's ridiculous.

2. Learn to find your way around Emacs _before_ trying to learn Emacs Lisp. This
means learning, at a minimum, `C-h i', then `i' in a manual to look things up in
the index.

3. There is no substitute for this. No matter how much people here try to "help"
you, you will waste your _own_ time if you don't learn how to _ask Emacs_. And
sooner or later, people here will tire of answering, if they see you making zero
effort.

Here's how hard it is:

1. `C-h i'
2. Click the link to the `Elisp' manual.
3. `i', then `if', then Enter.
4. Read one page of doc about `Conditionals'.

Can you handle that?

If you only partially understand what you read, try something based on what you
think you understand: `M-:', then type some expression you think might work,
from what you read. Emacs and Emacs Lisp are 100% interactive - you get
immediate feedback. Best way to learn.

If you don't understand what you read at all, and you need more help, ask here.
There's no shame in asking, ever. But for your _own_ sake, learn to interact
with Emacs itself. You will not regret it.

The best rule, for _you_, is this: _ask Emacs_. It's the best rule in the long
run, because it will mean that your questions here will be more informed, which
means people will be more willing to help you.

HTH.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]