[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to get syntax information in batch mode?
From: |
Davin Pearson |
Subject: |
How to get syntax information in batch mode? |
Date: |
18 May 2006 22:58:13 -0700 |
User-agent: |
G2/0.2 |
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?
If there is no such function, then could Emacs be modified so that
text properties are online in batch mode?
Here is an example of a function that always prints nil when invoked
noninteractively.
(defun test ()
(find-file "~/a.java")
(font-lock-mode)
(goto-char (point-min))
(while (< (point) (point-max))
(message "%s\n" (get-char-property (point) 'face))
(forward-char 1)))
- How to get syntax information in batch mode?,
Davin Pearson <=