[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8524: New glasses.el customization option glasses-separate-capital-g

From: Milan Zamazal
Subject: bug#8524: New glasses.el customization option glasses-separate-capital-groups-p
Date: Wed, 04 May 2011 15:32:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

>>>>> "GM" == Glenn Morris <address@hidden> writes:

    GM> boolean options should not have names ending in `-p'

Here is a corrected patch:

--- glasses.el.orig     2011-01-08 18:45:14.000000000 +0100
+++ glasses.el  2011-04-18 21:45:03.482155846 +0200
@@ -117,6 +117,15 @@
   :group 'glasses
   :type '(repeat regexp))
+(defcustom glasses-separate-capital-groups t
+  "If non-nil, try to separate groups of capital letters.
+When the value is non-nil, HTMLSomething and IPv6 are displayed
+as HTML_Something and I_Pv6 respectively.  Set the value to nil
+if you prefer to display them unchanged."
+  :group 'glasses
+  :type 'boolean
+  :version "23.4")
 (defcustom glasses-uncapitalize-p nil
   "If non-nil, downcase embedded capital letters in identifiers.
 Only identifiers starting with lower case letters are affected, letters inside
@@ -213,8 +222,11 @@
        ;; Face + separator
        (goto-char beg)
-       (while (re-search-forward "[a-z]\\([A-Z]\\)\\|[A-Z]\\([A-Z]\\)[a-z]"
-                                 end t)
+       (while (re-search-forward
+                (if glasses-separate-capital-groups
+                    "[a-z]\\([A-Z]\\)\\|[A-Z]\\([A-Z]\\)[a-z]"
+                  "[a-z]\\([A-Z]\\)")
+                end t)
          (let* ((n (if (match-string 1) 1 2))
                 (o (glasses-make-overlay (match-beginning n) (match-end n))))
            (goto-char (match-beginning n))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]