# HG changeset patch # User Gerd Moellmann # Date 957471479 0 # Node ID 4756047a4398e3c59f18e5debaac760d2addb79f # Parent 5d50c2e42c580584ddb6dd247ef685c16e570571 (glasses-convert-to-unreadable): Use `glasses-separator' instead of the hard-wired "_". (glasses-mode): Call `glasses-make-unreadable' only in a single place. diff -r 5d50c2e42c58 -r 4756047a4398 lisp/progmodes/glasses.el --- a/lisp/progmodes/glasses.el Thu May 04 19:20:37 2000 +0000 +++ b/lisp/progmodes/glasses.el Thu May 04 20:17:59 2000 +0000 @@ -213,11 +213,14 @@ recognized according to the current value of the variable `glasses-separator'." (when (and glasses-convert-on-write-p (not (string= glasses-separator ""))) - (let ((case-fold-search nil)) + (let ((case-fold-search nil) + (separator (regexp-quote glasses-separator))) (save-excursion (goto-char (point-min)) (while (re-search-forward - "[a-z]\\(_\\)[A-Z]\\|[A-Z]\\(_\\)[A-Z][a-z]" nil t) + (format "[a-z]\\(%s\\)[A-Z]\\|[A-Z]\\(%s\\)[A-Z][a-z]" + separator separator) + nil t) (let ((n (if (match-string 1) 1 2))) (replace-match "" t nil nil n) (goto-char (match-end n)))) @@ -260,17 +263,16 @@ (save-excursion (save-restriction (widen) + ;; We erase the all overlays anyway, to avoid dual sight in some + ;; circumstances + (glasses-make-unreadable (point-min) (point-max)) (if new-flag (progn - ;; We erase the all overlays to avoid dual sight in some - ;; circumstances - (glasses-make-unreadable (point-min) (point-max)) (glasses-make-readable (point-min) (point-max)) (make-local-hook 'after-change-functions) (add-hook 'after-change-functions 'glasses-change nil t) (add-hook 'local-write-file-hooks 'glasses-convert-to-unreadable nil t)) - (glasses-make-unreadable (point-min) (point-max)) (remove-hook 'after-change-functions 'glasses-change t) (remove-hook 'local-write-file-hooks 'glasses-convert-to-unreadable t))))