summaryrefslogtreecommitdiff
path: root/lisp/progmodes/glasses.el
diff options
context:
space:
mode:
authorMilan Zamazal <pdm@zamazal.org>2011-05-04 20:26:55 -0700
committerGlenn Morris <rgm@gnu.org>2011-05-04 20:26:55 -0700
commit9c1d5ac586dbdaa42311019a4ed076d17288233a (patch)
tree5813e5fb9822af0c6cd6b853e1973b4533eba2e2 /lisp/progmodes/glasses.el
parentd429d8e9c3212f87077777dc94f72f33c726cade (diff)
downloademacs-9c1d5ac586dbdaa42311019a4ed076d17288233a.tar.gz
Small addition to glasses.el (bug#8524)
* lisp/progmodes/glasses.el (glasses-separate-capital-groups): New option. (glasses-make-readable): Use glasses-separate-capital-groups.
Diffstat (limited to 'lisp/progmodes/glasses.el')
-rw-r--r--lisp/progmodes/glasses.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el
index 0d9359caa77..6792e861888 100644
--- a/lisp/progmodes/glasses.el
+++ b/lisp/progmodes/glasses.el
@@ -116,6 +116,15 @@ parenthesis expression starts."
: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 "24.1")
+
(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
@@ -212,8 +221,11 @@ CATEGORY is the overlay category. If it is nil, use the `glasses' category."
'glasses-init))
;; 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))