Function: glasses-convert-to-unreadable

glasses-convert-to-unreadable is a byte-compiled function defined in glasses.el.gz.

Signature

(glasses-convert-to-unreadable)

Documentation

Convert current buffer to unreadable identifiers and return nil.

This function modifies buffer contents, it removes all the separators, recognized according to the current value of the variable glasses-separator.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/glasses.el.gz
(defun glasses-convert-to-unreadable ()
  "Convert current buffer to unreadable identifiers and return nil.
This function modifies buffer contents, it removes all the separators,
recognized according to the current value of the variable `glasses-separator'."
  (when glasses-convert-on-write-p
    (let ((case-fold-search nil)
	  (separator (regexp-quote glasses-separator)))
      (save-excursion
	(unless (string= glasses-separator "")
	  (goto-char (point-min))
	  (while (re-search-forward
		  (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))))
	  (unless (string= glasses-separator glasses-original-separator)
	    (goto-char (point-min))
	    (while (re-search-forward (format "[a-zA-Z0-9]\\(%s+\\)[a-zA-Z0-9]"
					      separator)
				      nil t)
	      (replace-match glasses-original-separator nil nil nil 1)
	      (goto-char (match-beginning 1)))))
	(when glasses-separate-parentheses-p
	  (goto-char (point-min))
	  (while (re-search-forward "[a-zA-Z]_*\\( \\)(" nil t)
            (unless (glasses-parenthesis-exception-p (line-beginning-position)
                                                     (1+ (match-end 1)))
	      (replace-match "" t nil nil 1)))))))
  ;; nil must be returned to allow use in write file hooks
  nil)