all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: emacs-devel@gnu.org
Subject: scheme font-locking: (define ((foo ...) bar) ...)
Date: Fri, 09 Jul 2010 14:56:26 +0200	[thread overview]
Message-ID: <87mxu0stj9.fsf@ambire.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

In Scheme mode, Emacs font locks the form:

(define (in-vicinity-proc dir)
  (lambda (filename)
    (in-vicinity dir filename)))

with ‘define’ as a keyword and ‘in-vicinity-proc’ as a function name,
using font-lock-{keyword,function-name}-face, respectively.  That's fine.
However, for this form:

(define ((in-vicinity-proc dir) filename)
  (in-vicinity dir filename))

then Emacs font locks only ‘define’.  I have locally modified
‘scheme-font-lock-keywords-1’ to change "zero or one parens"
to "zero or more parens" and that change seems to DTRT.
Could someone please review the patch below and apply it?

thi

_______________________________________________

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Improve-Scheme-font-locking-for-define-foo.patch --]
[-- Type: text/x-diff, Size: 1452 bytes --]

From 6bdb80748bda69436d47066365e352ac909fe450 Mon Sep 17 00:00:00 2001
From: Thien-Thi Nguyen <ttn@gnuvola.org>
Date: Fri, 9 Jul 2010 14:52:48 +0200
Subject: [PATCH] Improve Scheme font-locking for (define ((foo ...) ...) ...).

* lisp/progmodes/scheme.el (scheme-font-lock-keywords-1): To find
the declared object, ignore zero or more parens, not zero or one.
---
 lisp/ChangeLog           |    6 ++++++
 lisp/progmodes/scheme.el |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b3af13b..3c6d07d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-09  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+	Improve Scheme font-locking for (define ((foo ...) ...) ...).
+	* progmodes/scheme.el (scheme-font-lock-keywords-1): To find
+	the declared object, ignore zero or more parens, not zero or one.
+
 2010-07-08  Daiki Ueno  <ueno@unixuser.org>
 
 	* epa-file.el (epa-file-error, epa-file--find-file-not-found-function)
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index ce8a342..fb5eafe 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -307,7 +307,7 @@ See `run-hooks'."
                    "\\|-module"
 		   "\\)\\)\\>"
 		   ;; Any whitespace and declared object.
-		   "[ \t]*(?"
+		   "[ \t]*(*"
 		   "\\(\\sw+\\)?")
 	   '(1 font-lock-keyword-face)
 	   '(6 (cond ((match-beginning 3) font-lock-function-name-face)
-- 
1.6.3.2


             reply	other threads:[~2010-07-09 12:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-09 12:56 Thien-Thi Nguyen [this message]
2010-07-10  9:02 ` scheme font-locking: (define ((foo ...) bar) ...) Štěpán Němec
2010-07-12  7:37   ` Thien-Thi Nguyen
2010-07-12 17:13 ` Glenn Morris
2010-07-12 20:16   ` Thien-Thi Nguyen

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

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

  git send-email \
    --in-reply-to=87mxu0stj9.fsf@ambire.localdomain \
    --to=ttn@gnuvola.org \
    --cc=emacs-devel@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.
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.