diff options
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/progmodes/glasses.el | 17 |
2 files changed, 26 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9f774f8990a..f64d4b01595 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2005-09-17 Milan Zamazal <pdm@zamazal.org> | ||
| 2 | |||
| 3 | * progmodes/glasses.el (glasses-make-readable): If | ||
| 4 | glasses-separator differs from underscore, put appropriate | ||
| 5 | overlays over underscore characters. | ||
| 6 | (glasses-convert-to-unreadable): If glasses-separator differs from | ||
| 7 | underscore, try to convert glasses-separator characters to | ||
| 8 | underscores. | ||
| 9 | |||
| 1 | 2005-09-16 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2005-09-16 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * calendar/diary-lib.el (mark-diary-entries): Don't move point. | 12 | * calendar/diary-lib.el (mark-diary-entries): Don't move point. |
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el index b32c5eb6d49..2733cb407a4 100644 --- a/lisp/progmodes/glasses.el +++ b/lisp/progmodes/glasses.el | |||
| @@ -195,6 +195,16 @@ CATEGORY is the overlay category. If it is nil, use the `glasses' category." | |||
| 195 | (looking-at glasses-uncapitalize-regexp)))) | 195 | (looking-at glasses-uncapitalize-regexp)))) |
| 196 | (overlay-put o 'invisible t) | 196 | (overlay-put o 'invisible t) |
| 197 | (overlay-put o 'after-string (downcase (match-string n)))))) | 197 | (overlay-put o 'after-string (downcase (match-string n)))))) |
| 198 | ;; Separator change | ||
| 199 | (unless (string= glasses-separator "_") | ||
| 200 | (goto-char beg) | ||
| 201 | (while (re-search-forward "[a-zA-Z0-9]\\(_+\\)[a-zA-Z0-9]" end t) | ||
| 202 | (goto-char (match-beginning 1)) | ||
| 203 | (while (eql (char-after) ?\_) | ||
| 204 | (let ((o (glasses-make-overlay (point) (1+ (point))))) | ||
| 205 | ;; `concat' ensures the character properties won't merge | ||
| 206 | (overlay-put o 'display (concat glasses-separator))) | ||
| 207 | (forward-char)))) | ||
| 198 | ;; Parentheses | 208 | ;; Parentheses |
| 199 | (when glasses-separate-parentheses-p | 209 | (when glasses-separate-parentheses-p |
| 200 | (goto-char beg) | 210 | (goto-char beg) |
| @@ -227,6 +237,13 @@ recognized according to the current value of the variable `glasses-separator'." | |||
| 227 | (let ((n (if (match-string 1) 1 2))) | 237 | (let ((n (if (match-string 1) 1 2))) |
| 228 | (replace-match "" t nil nil n) | 238 | (replace-match "" t nil nil n) |
| 229 | (goto-char (match-end n)))) | 239 | (goto-char (match-end n)))) |
| 240 | (unless (string= glasses-separator "_") | ||
| 241 | (goto-char (point-min)) | ||
| 242 | (while (re-search-forward (format "[a-zA-Z0-9]\\(%s+\\)[a-zA-Z0-9]" | ||
| 243 | separator) | ||
| 244 | nil t) | ||
| 245 | (replace-match "_" nil nil nil 1) | ||
| 246 | (goto-char (match-beginning 1)))) | ||
| 230 | (when glasses-separate-parentheses-p | 247 | (when glasses-separate-parentheses-p |
| 231 | (goto-char (point-min)) | 248 | (goto-char (point-min)) |
| 232 | (while (re-search-forward "[a-zA-Z]_*\\( \\)\(" nil t) | 249 | (while (re-search-forward "[a-zA-Z]_*\\( \\)\(" nil t) |