diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-03-01 04:24:21 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-03-01 04:24:21 +0100 |
commit | 4d06d7e13c2b1873b2de2c85333faa6b3d4b93dc (patch) | |
tree | 30df26976dc45f08c633a71dfb9966e83f7a9047 /elisp | |
parent | 8569220b3aa3312e9de80c95a28a36e7adb750c4 (diff) | |
download | geiser-chez-4d06d7e13c2b1873b2de2c85333faa6b3d4b93dc.tar.gz geiser-chez-4d06d7e13c2b1873b2de2c85333faa6b3d4b93dc.tar.bz2 |
Configurable keyword case sensitivity
By default, keywords are now not fontified in Scheme buffers unless
they have the correct (lower) case. This behaviour can be altered by
new, per-implementation customization variables.
Thanks to Diogo F. S. Ramos for pointing this out.
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-guile.el | 16 | ||||
-rw-r--r-- | elisp/geiser-impl.el | 5 | ||||
-rw-r--r-- | elisp/geiser-racket.el | 6 | ||||
-rw-r--r-- | elisp/geiser-syntax.el | 11 |
4 files changed, 29 insertions, 9 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el index 00c44d5..f8c76b7 100644 --- a/elisp/geiser-guile.el +++ b/elisp/geiser-guile.el @@ -1,6 +1,6 @@ ;; geiser-guile.el -- guile's implementation of the geiser protocols -;; Copyright (C) 2009, 2010, 2011, 2012 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -104,6 +104,11 @@ effect on new REPLs. For existing ones, use the command :type '(repeat string) :group 'geiser-guile) +(geiser-custom--defcustom geiser-guile-case-sensitive-p t + "Non-nil means keyword highlighting is case-sensitive." + :type 'boolean + :group 'geiser-guile) + (geiser-custom--defcustom geiser-guile-manual-lookup-other-window-p nil "Non-nil means pop up the Info buffer in another window." :type 'boolean @@ -323,11 +328,13 @@ it spawn a server thread." (defun geiser-guile--info-spec (&optional nodes) (let* ((nrx "^[ ]+-+ [^:]+:[ ]*") (drx "\\b") - (res (when (Info-find-file "r5rs" t) `(("(r5rs)Index" nil ,nrx ,drx))))) + (res (when (Info-find-file "r5rs" t) + `(("(r5rs)Index" nil ,nrx ,drx))))) (dolist (node (or nodes geiser-guile-manual-lookup-nodes) res) (when (Info-find-file node t) (mapc (lambda (idx) - (add-to-list 'res (list (format "(%s)%s" node idx) nil nrx drx))) + (add-to-list 'res + (list (format "(%s)%s" node idx) nil nrx drx))) '("Variable Index" "Procedure Index" "R5RS Index")))))) @@ -364,7 +371,8 @@ it spawn a server thread." (display-error geiser-guile--display-error) (external-help guile--manual-look-up) (check-buffer geiser-guile--guess) - (keywords geiser-guile--keywords)) + (keywords geiser-guile--keywords) + (case-sensitive geiser-guile-case-sensitive-p)) (geiser-impl--add-to-alist 'regexp "\\.scm$" 'guile t) diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el index 9e03251..38d22fa 100644 --- a/elisp/geiser-impl.el +++ b/elisp/geiser-impl.el @@ -1,6 +1,6 @@ ;; geiser-impl.el -- generic support for scheme implementations -;; Copyright (C) 2009, 2010, 2012 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2012, 2013 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -200,7 +200,8 @@ Here's how a typical call to this macro looks like: (display-error geiser-guile--display-error) (display-help) (check-buffer geiser-guile--guess) - (keywords geiser-guile--keywords)) + (keywords geiser-guile--keywords) + (case-sensitive geiser-guile-case-sensitive-p)) This macro also defines a runner function (run-NAME) and a switcher (switch-to-NAME), and provides geiser-NAME." diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index f7b33e6..01a7b6b 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -65,6 +65,11 @@ This executable is used by `run-gracket', and, if :type '(repeat string) :group 'geiser-racket) +(geiser-custom--defcustom geiser-racket-case-sensitive-p t + "Non-nil means keyword highlighting is case-sensitive." + :type 'boolean + :group 'geiser-racket) + ;;; REPL support: @@ -353,6 +358,7 @@ using start-geiser, a procedure in the geiser/server module." (external-help geiser-racket--external-help) (check-buffer geiser-racket--guess) (keywords geiser-racket--keywords) + (case-sensitive geiser-racket-case-sensitive-p) (binding-forms geiser-racket--binding-forms) (binding-forms* geiser-racket--binding-forms*)) diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index 46374a2..42e265e 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -1,6 +1,6 @@ ;;; geiser-syntax.el -- utilities for parsing scheme syntax -;; Copyright (C) 2009, 2010, 2011, 2012 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -61,10 +61,15 @@ "A variable (or thunk returning a value) giving additional, implementation-specific entries for font-lock-keywords.") +(geiser-impl--define-caller geiser-syntax--case-sensitive case-sensitive () + "A flag saying whether keywords are case sensitive.") + (defun geiser-syntax--add-kws () (when (not (and (boundp 'quack-mode) quack-mode)) - (let ((kw (geiser-syntax--impl-kws geiser-impl--implementation))) - (when kw (font-lock-add-keywords nil kw))))) + (let ((kw (geiser-syntax--impl-kws geiser-impl--implementation)) + (cs (geiser-syntax--case-sensitive geiser-impl--implementation))) + (when kw (font-lock-add-keywords nil kw)) + (setq font-lock-keywords-case-fold-search (not cs))))) ;;; A simple scheme reader |