From: Milan Zamazal <pdm@zamazal.org>
To: 8524@debbugs.gnu.org
Subject: bug#8524: New glasses.el customization option glasses-separate-capital-groups-p
Date: Wed, 20 Apr 2011 08:46:58 +0200 [thread overview]
Message-ID: <871v0xju71.fsf@blackbird.nest.zamazal.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 219 bytes --]
This adds a new customization option for a feature requested by a
glasses.el user.
2011-04-20 Milan Zamazal <pdm@zamazal.org>
* progmodes/glasses.el (glasses-separate-capital-groups-p): New
customization option.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: glasses.el.patch --]
[-- Type: text/x-diff, Size: 1222 bytes --]
--- 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-p 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 @@
'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-p
+ "[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))
next reply other threads:[~2011-04-20 6:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 6:46 Milan Zamazal [this message]
2011-05-04 2:07 ` bug#8524: New glasses.el customization option glasses-separate-capital-groups-p Glenn Morris
2011-05-04 12:40 ` Stefan Monnier
2011-05-04 13:32 ` Milan Zamazal
2011-05-05 3:27 ` Glenn Morris
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=871v0xju71.fsf@blackbird.nest.zamazal.org \
--to=pdm@zamazal.org \
--cc=8524@debbugs.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.