diff options
| author | Milan Zamazal | 2011-05-04 20:26:55 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-05-04 20:26:55 -0700 |
| commit | 9c1d5ac586dbdaa42311019a4ed076d17288233a (patch) | |
| tree | 5813e5fb9822af0c6cd6b853e1973b4533eba2e2 | |
| parent | d429d8e9c3212f87077777dc94f72f33c726cade (diff) | |
| download | emacs-9c1d5ac586dbdaa42311019a4ed076d17288233a.tar.gz emacs-9c1d5ac586dbdaa42311019a4ed076d17288233a.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/glasses.el | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf120f8df8e..a862509a6e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-05-05 Milan Zamazal <pdm@zamazal.org> | ||
| 2 | |||
| 3 | * progmodes/glasses.el (glasses-separate-capital-groups): New option. | ||
| 4 | (glasses-make-readable): Use glasses-separate-capital-groups. | ||
| 5 | |||
| 1 | 2011-05-05 Juanma Barranquero <lekktu@gmail.com> | 6 | 2011-05-05 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * emacs-lisp/warnings.el (warning-level-aliases): Reflow docstring. | 8 | * emacs-lisp/warnings.el (warning-level-aliases): Reflow docstring. |
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." | |||
| 116 | :group 'glasses | 116 | :group 'glasses |
| 117 | :type '(repeat regexp)) | 117 | :type '(repeat regexp)) |
| 118 | 118 | ||
| 119 | (defcustom glasses-separate-capital-groups t | ||
| 120 | "If non-nil, try to separate groups of capital letters. | ||
| 121 | When the value is non-nil, HTMLSomething and IPv6 are displayed | ||
| 122 | as HTML_Something and I_Pv6 respectively. Set the value to nil | ||
| 123 | if you prefer to display them unchanged." | ||
| 124 | :group 'glasses | ||
| 125 | :type 'boolean | ||
| 126 | :version "24.1") | ||
| 127 | |||
| 119 | (defcustom glasses-uncapitalize-p nil | 128 | (defcustom glasses-uncapitalize-p nil |
| 120 | "If non-nil, downcase embedded capital letters in identifiers. | 129 | "If non-nil, downcase embedded capital letters in identifiers. |
| 121 | Only identifiers starting with lower case letters are affected, letters inside | 130 | 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." | |||
| 212 | 'glasses-init)) | 221 | 'glasses-init)) |
| 213 | ;; Face + separator | 222 | ;; Face + separator |
| 214 | (goto-char beg) | 223 | (goto-char beg) |
| 215 | (while (re-search-forward "[a-z]\\([A-Z]\\)\\|[A-Z]\\([A-Z]\\)[a-z]" | 224 | (while (re-search-forward |
| 216 | end t) | 225 | (if glasses-separate-capital-groups |
| 226 | "[a-z]\\([A-Z]\\)\\|[A-Z]\\([A-Z]\\)[a-z]" | ||
| 227 | "[a-z]\\([A-Z]\\)") | ||
| 228 | end t) | ||
| 217 | (let* ((n (if (match-string 1) 1 2)) | 229 | (let* ((n (if (match-string 1) 1 2)) |
| 218 | (o (glasses-make-overlay (match-beginning n) (match-end n)))) | 230 | (o (glasses-make-overlay (match-beginning n) (match-end n)))) |
| 219 | (goto-char (match-beginning n)) | 231 | (goto-char (match-beginning n)) |