Function: pascal-comment-area

pascal-comment-area is an interactive and byte-compiled function defined in pascal.el.gz.

Signature

(pascal-comment-area START END)

Documentation

Put the region into a Pascal comment.

The comments that are in this area are "deformed":
*) becomes !(* and } becomes !{.
These deformed comments are returned to normal if you use C-c C-u (pascal-uncomment-area) to undo the commenting.

The commented area starts with pascal-exclude-str-start, and ends with pascal-exclude-str-end. But if you change these variables, C-c C-u (pascal-uncomment-area) won't recognize the comments.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/pascal.el.gz
(defun pascal-comment-area (start end)
  "Put the region into a Pascal comment.
\\<pascal-mode-map>
The comments that are in this area are \"deformed\":
`*)' becomes `!(*' and `}' becomes `!{'.
These deformed comments are returned to normal if you use
\\[pascal-uncomment-area] to undo the commenting.

The commented area starts with `pascal-exclude-str-start', and ends
with `pascal-exclude-str-end'.  But if you change these variables,
\\[pascal-uncomment-area] won't recognize the comments."
  (interactive "r")
  (save-excursion
    ;; Insert start and endcomments
    (goto-char end)
    (if (and (save-excursion (skip-chars-forward " \t") (eolp))
	     (not (save-excursion (skip-chars-backward " \t") (bolp))))
	(forward-line 1)
      (beginning-of-line))
    (insert pascal-exclude-str-end)
    (setq end (point))
    (newline)
    (goto-char start)
    (beginning-of-line)
    (insert pascal-exclude-str-start)
    (newline)
    ;; Replace end-comments within commented area
    (goto-char end)
    (save-excursion
      (while (re-search-backward "\\*)" start t)
	(replace-match "!(*" t t)))
    (save-excursion
      (while (re-search-backward "}" start t)
	(replace-match "!{" t t)))))