unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Davin Pearson" <davin.pearson@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to get syntax information in batch mode?
Date: Sun, 21 May 2006 18:55:02 +1200	[thread overview]
Message-ID: <8d7d1e6d0605202355r20bf3d8emb908432ef23372ec@mail.gmail.com> (raw)
In-Reply-To: <446F18E0.2090102@gmx.at>

On 21/05/06, martin rudalics <rudalics@gmx.at> wrote:
>  > I have written an automatic code indentation function in ELisp and I
>  > want to be able to invoke this function from Emacs' batch mode so that
>  > it can be invoked from a Makefile, without needing to start Emacs
>  > interactively.
>  >
>  > However the function get-char-property always seems to return nil when
>  > noninteractive is set to t.  Am I correct about this deduction?
>  >
>  > I use get-char-property to tell the automatic indentation function
>  > whether or not we are currently inside a string or a comment.  Is
>  > there a different function for telling whether or not we are currently
>  > inside a string or a comment?
>
> By default, Emacs doesn't fontify text that is not displayed.  Hence, in
> general, your function might not work interactively either.
>
> You have two basic ways to achieve what you want:
>
> Use font-lock and text-properties: A brute force approach is to call
> `font-lock-fontify-buffer' before doing the indentation.

That works for me!

Thank you very much for your helpful advice!


-- 
Davin Pearson    http://www.davinpearson.com

  reply	other threads:[~2006-05-21  6:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-20 13:25 How to get syntax information in batch mode? martin rudalics
2006-05-21  6:55 ` Davin Pearson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-05-19  5:58 Davin Pearson
2006-05-19 11:19 ` andlind

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=8d7d1e6d0605202355r20bf3d8emb908432ef23372ec@mail.gmail.com \
    --to=davin.pearson@gmail.com \
    --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.
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).