* font-locking of sexpr form broken
@ 2007-12-28 3:51 livingcosmos.org
2007-12-28 8:35 ` Tassilo Horn
0 siblings, 1 reply; 3+ messages in thread
From: livingcosmos.org @ 2007-12-28 3:51 UTC (permalink / raw)
To: help-gnu-emacs
The font-locking gets messed up on the second format because I have a
s-expr within the double quotes
(defun calc-frame (noun r)
(let* ((noun-shape (noun-shape noun))
(ls (length noun-shape))
(remaining-lead-axes (- ls r)))
(progn
(format t "noun-shape: ~A remaining: ~A~%" noun-shape remaining-
lead-axes)
(format t "
(make-frame :length ~A
:shape ~A
:noun ~A
:n-cells ~A
" remaining-lead-axes (subseq noun-shape 0 remaining-lead-axes)
noun (- ls remaining-lead-axes))
(make-frame :length remaining-lead-axes
:shape (subseq noun-shape 0 remaining-lead-axes)
:noun noun
:n-cells (- ls remaining-lead-axes)))))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: font-locking of sexpr form broken
2007-12-28 3:51 font-locking of sexpr form broken livingcosmos.org
@ 2007-12-28 8:35 ` Tassilo Horn
0 siblings, 0 replies; 3+ messages in thread
From: Tassilo Horn @ 2007-12-28 8:35 UTC (permalink / raw)
To: help-gnu-emacs
"livingcosmos.org" <metaperl@gmail.com> writes:
> The font-locking gets messed up on the second format because I have a
> s-expr within the double quotes
I think there was a closing paren missing. This corrected version is
font-locked fine here.
--8<---------------cut here---------------start------------->8---
(defun calc-frame (noun r)
(let* ((noun-shape (noun-shape noun))
(ls (length noun-shape))
(remaining-lead-axes (- ls r)))
(progn
(format t "noun-shape: ~A remaining: ~A~%" noun-shape remaining-lead-axes)
(format t "
(make-frame :length ~A
:shape ~A
:noun ~A
:n-cells ~A
)" remaining-lead-axes (subseq noun-shape 0 remaining-lead-axes)
noun (- ls remaining-lead-axes))
(make-frame :length remaining-lead-axes
:shape (subseq noun-shape 0 remaining-lead-axes)
:noun noun
:n-cells (- ls remaining-lead-axes)))))
--8<---------------cut here---------------end--------------->8---
Bye,
Tassilo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: font-locking of sexpr form broken
@ 2007-12-28 6:50 martin rudalics
0 siblings, 0 replies; 3+ messages in thread
From: martin rudalics @ 2007-12-28 6:50 UTC (permalink / raw)
To: metaperl; +Cc: help-gnu-emacs
> The font-locking gets messed up on the second format because I have a
> s-expr within the double quotes
This is a known limitation (aka "Left Margin Convention") described in
section 31.2.1 of the Emacs manual. You have two choices:
(1) Set the option `open-paren-in-column-0-is-defun-start' to nil.
(2) Escape the offending paren with a backslash like
(format t "
\(make-frame :length ~A
:shape ~A
Observe that with option (1) the paren will be still displayed with
`font-lock-warning-face' and the "help-echo" telling you
"Looks like a toplevel defun: escape the parenthesis"
is not removed. Hence, in general (and in particular in Elisp mode
where the backslash hardly ever matters) option (2) is preferable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-28 8:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-28 3:51 font-locking of sexpr form broken livingcosmos.org
2007-12-28 8:35 ` Tassilo Horn
-- strict thread matches above, loose matches on Subject: below --
2007-12-28 6:50 martin rudalics
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.