unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: jadamson@partners.org (Joel J. Adamson)
To: Michael George Lerner <mglerner@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: trouble making an indent-line function that doesn't move the point
Date: Wed, 12 Mar 2008 10:36:16 -0400	[thread overview]
Message-ID: <87tzjcau1r.fsf@W0053328.mgh.harvard.edu> (raw)
In-Reply-To: <2151ad8e-d9be-4f1f-b832-de1c237ef27a@e6g2000prf.googlegroups.com> (Michael George Lerner's message of "Tue, 11 Mar 2008 12:16:45 -0700 (PDT)")

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	other threads:[~2008-03-12 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 19:16 trouble making an indent-line function that doesn't move the point Michael George Lerner
2008-03-12 14:36 ` Joel J. Adamson [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87tzjcau1r.fsf@W0053328.mgh.harvard.edu \
    --to=jadamson@partners.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mglerner@gmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).