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

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

Re: trouble making an indent-line function that doesn't move the point


From: Joel J. Adamson
Subject: Re: trouble making an indent-line function that doesn't move the point
Date: Wed, 12 Mar 2008 10:36:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Michael George Lerner <mglerner@gmail.com> writes:

> Hi,
>
> I wrote a very simple emacs mode to deal with highlighting/indentation
> for CHARMM files (CHARMM is a computational biology package that has
> its own input syntax). The indentation and highlighting basically do
> what I want except for the fact that calling charmm-indent-line moves
> the point to the beginning of the line. This is the first time I've
> touched lisp in 11 years, so I'm a little rusty. Can someone help me
> make this function behave?
>
> Thanks,
>
> -michael
>
> (defun charmm-continuation-line ()
>   "Returns non-nil if current line continus a previous one"
>   (eq ?- (char-before (line-end-position 0)))
> )

One note on your own indenting: put the trailing parentheses all on the
same line, it makes the code much more readable.  Emacs Lisp mode should
indent correctly to help you "parse" the s-expressions as you read them.

Check out Emacswiki, and check out "Writing GNU Emacs Extensions."  I'll
take a more detailed look at the code later.

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.







reply via email to

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