Lines Matching defs:comment

71 ;; though comment-region with "C" doesn't do the right thing.
86 (defcustom gmpasm-comment-start-regexp "\\([#;!@*|C]\\|//\\)"
87 "*Regexp matching possible comment styles.
144 (define-key map "\C-c\C-c" 'comment-region)
145 (define-key map "\C-c\C-d" 'gmpasm-comment-region-dnl)
166 '#' and '\n' aren't set as comment syntax. In m4 these are a comment
172 '*', '!' or '|' aren't setup as comment syntax either, on CPUs which use
209 The right assembler comment regexp is added dynamically buffer-local (with
227 `comment-start' and `comment-end' are set buffer-local to assembler
229 `gmpasm-comment-start-regexp' at the start of a line, or \"#\" is used if
230 there's no match (if \"#\" isn't what you want, type in a desired comment
234 `comment-start' and dnl added. If filladapt.el has been loaded it similarly
235 gets `comment-start' and dnl added as buffer-local fill prefixes.
238 and assembler commenting (based on the `comment-start' determined).
240 Note that `gmpasm-comment-start-regexp' is only matched as a whole word, so
242 to start with `C'. Also it's only the particular `comment-start' determined
243 that's added for filling etc, not the whole `gmpasm-comment-start-regexp'.
257 (setq comment-column 40)
263 ;; The first match of gmpasm-comment-start-regexp at the start of a line
264 ;; determines comment-start, or "#" if no match.
265 (set (make-local-variable 'comment-start)
269 (concat "^\\(" gmpasm-comment-start-regexp "\\)\\(\\s-\\|$\\)")
273 (set (make-local-variable 'comment-end) "")
275 ;; If comment-start ends in an alphanumeric then \b is used to match it
279 (let ((comment-regexp
280 (concat (regexp-quote comment-start)
281 (if (string-match "[a-zA-Z0-9]\\'" comment-start) "\\b"))))
283 ;; Whitespace is required before a comment-start so m4 $# doesn't match
284 ;; when comment-start is "#".
285 (set (make-local-variable 'comment-start-skip)
286 (concat "\\(^\\|\\s-\\)\\(\\<dnl\\>\\|" comment-regexp "\\)[ \t]*"))
288 ;; Comment fontification based on comment-start, and always with dnl.
289 ;; Same treatment of a space before "#" as in comment-start-skip, but
293 comment-regexp
295 2 'font-lock-comment-face))
305 ;; comment-start.
307 (concat "[ \t\f]*\\(\\(" comment-regexp "\\|dnl\\)[ \t]*\\)*$"))
317 ;; Adaptive fill gets dnl and comment-start as comment style prefixes on
321 comment-regexp
343 ;; "%" as a comment prefix interferes with register names on some
346 '("%+" postscript-comment))
349 '(gmpasm-comment gmpasm-comment))
351 '(gmpasm-comment . exact)))
360 ;; Add dnl and comment-start as fill prefixes.
364 (list (concat "dnl[ \t]\\|" comment-regexp)
365 'gmpasm-comment))))
370 (defun gmpasm-comment-region-dnl (beg end &optional arg)
371 "(gmpasm-comment-region-dnl BEG END &optional ARG)
375 This is `comment-region', but using \"dnl\"."
378 (let ((comment-start "dnl")
379 (comment-end ""))
380 (comment-region beg end arg)))