(defun comment-region nil "\ Insert the proper comment characters into the region of a program. Used to comment blocks of Lisp or C code." (interactive) (byte-code "ĈŠŠÆÇ \"ˆÆ `\"ˆ È=† É=ƒ,Ê Ë#ˆÌ !b‚= Í=ƒ9Î \"‚=ÏÐ \"*‡" [start-position end-position major-mode t nil make-marker set-marker mark lisp-mode emacs-lisp-mode comment-lines comment-lisp-line marker-position c-mode c-comment-region error "Don't know how to comment %s mode."] 11)) (defun uncomment-region nil "\ Remove comment delimiters from a region of code. Works with comments created by function comment-region. Lisp or C." (interactive) (byte-code "ÅˆÆ Æ Æ ÇÈ \"ˆÇ `\"ˆÇ \"ˆ É=†$ Ê=ƒ4Ë Ì#ˆÍ !b‚E Î=ƒAÏ \"‚EÐÑ \"+‡" [start-position end-position final-position major-mode t nil make-marker set-marker mark lisp-mode emacs-lisp-mode comment-lines uncomment-lisp-line marker-position c-mode c-uncomment-region error "Don't know how to uncomment %s mode."] 13)) (defun comment-lines (start-position end-position comment-function) (byte-code "ŠÄ \" bˆÅV…$Æ ˆÇ !ˆÈZ‰ˆÉ \"ˆ‚ ))‡" [number-of-lines-to-comment start-position end-position comment-function count-lines 0 beginning-of-line funcall 1 go-to-next-line] 7)) (defun go-to-next-line (start end) (byte-code " Wƒ ÂÃ!‚ V…ÂÄ!‡" [start end next-line 1 -1] 3)) (defun comment-lisp-line nil (byte-code "À ˆÁc‡" [beginning-of-line ";;; "] 2)) (defun uncomment-lines (start-position end-position uncomment-function) (byte-code "ŠÄ \" bˆÅV…$Æ ˆÇ !ˆÈZ‰ˆÉ \"ˆ‚ ))‡" [number-of-lines-to-uncomment start-position end-position uncomment-function count-lines 0 beginning-of-line funcall 1 go-to-next-line] 7)) (defun uncomment-lisp-line nil (byte-code "À ˆÁ`!ˆÂÃ`f!Ä\"…ÅÆ!‡" [beginning-of-line delete-semicolons string-equal char-to-string " " delete-char 1] 6)) (defun delete-semicolons (point) (byte-code "ÀÁ`f!Â\"…ÃÄ!ˆ‚‡" [string-equal char-to-string ";" delete-char 1] 5)) (defun c-comment-region (start end) (byte-code " V… ‰ˆ ‰)ˆ U?…=à \"?ƒ'Ä \"‚=ÅÆÇ $…6ÅÈÉ $…=Ê \"‡" [start end temp c-comments-present-p simple-c-comment balanced-unnested-c-comments-p "/*$" "$*/" "/*" "*/" c-comment-uncommented-regions] 8)) (defun c-uncomment-region (start end) (byte-code " V… ‰ˆ ‰)ˆ U?…<à \"?ƒ&ÄÅ!‚<ÆÇÈ $…5ÆÉÊ $…<Ë \"‡" [start end temp c-comments-present-p message "No comments in region." balanced-unnested-c-comments-p "/*$" "$*/" "/*" "*/" c-uncomment-commented-regions] 8)) (defun c-uncomment-commented-regions (start end) "\ Takes two markers that delimit a region and removes any C comment delimiters involving $." (byte-code "Ä Å !bˆÆÇ Ã#…6`ÈZbˆÉÈ!ˆÆÊÅ !Ã#ƒ.`ÈZbˆÉÈ!‚2ËÌÊ\"ˆ‚ˆÅ!b)‡" [original-point start end t point-marker marker-position search-forward "/*$" 3 delete-char "$*/" error "Unbalanced C delimiters. Missing %s."] 11)) (defun c-comments-present-p (start end) (byte-code "Âà #† ÂÄ #‡" [start end first-string-occurrence "/*" "*/"] 5)) (defun first-string-occurrence (string start end) (byte-code "ÅÆ !ƒÇ !b‚ bˆÆ !ƒ$È Ç !Ä#‰‚+È Ä#‰ˆ…3`‰ˆ)‡" [string-present start end string t nil markerp marker-position search-forward] 9)) (defun c-comment-uncommented-regions (start end) (byte-code "Æ Æ Ç \"ˆÇ \"ˆ U?…XÆ Ç ÈÉ #\"ˆÊ !ƒKÇ ËZ\"ˆÌ \"ˆÇÈÍ #\"ˆÊ!?…H ‰‚SÌ \"ˆ ‰)ˆ‚*‡" [m1 m2 start end m3 t make-marker set-marker first-string-occurrence "/*" marker-position 2 simple-c-comment "*/"] 17)) (defun simple-c-comment (start end) "\ Takes two markers that delimit region. Comments a region with C comment delimiters. Assumes no comments already in region." (byte-code "Ç ÈÉÊ !bˆËÌÊ !\"ˆÍ `\"ˆ U?ƒ3 cˆÊ !bˆÎÌ!ˆ cˆ`b‚4Æ+‡" [original-point begin-comment end-comment start end t nil point-marker "/*$" "$*/" marker-position skip-chars-forward "[ ]*" set-marker skip-chars-backward] 8)) (defun balanced-unnested-c-comments-p (left right start end) (byte-code "Ä $‡" [left right start end balanced-but-unnested-aux] 5)) (defun balanced-but-unnested-aux (first second start end) (byte-code "Ë $@A@ ƒ[Ì \"ƒTË $@A@ ƒLÌ \"ƒEÍ  $‚IÎÏ \"‚PÎÐ \"+‚XÎÐ \"‚\\Ê+‡" [first-delimiter-list start end first second first-delimiter first-delimiter-location next-delimiter-list next-delimiter next-delimiter-location t find-closest-string string-equal balanced-but-unnested-aux error "Unbalanced delimiters. Extra %s." "Unbalanced delimiters. %s missing."] 10)) (defun find-closest-string (start end &rest string-list) (byte-code " Ç\\È …-É @ # …# W…# ‰ˆ @‰ˆ A‰)ˆ‚ˆÊ !ƒ8Æ‚; D*‡" [closest end current-string string-list distance start nil 1 "" first-string-occurrence null-string] 5)) (defun null-string (s) (byte-code "ÁÂ\"‡" [s string-equal ""] 3))