• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/progmodes/

Lines Matching defs:comment

38 ;;	comment char	place or move comment
39 ;; asm-comment-char specifies which character this is;
47 ;; 1) An asm-mode-set-comment-hook before the part of the initialization
48 ;; depending on asm-comment-char, and
58 (defcustom asm-comment-char ?\;
59 "*The comment-start character assumed by Asm mode."
77 ;; Note that the comment character isn't set up until asm-mode is called.
79 (define-key map "\C-c;" 'comment-region)
110 \\[asm-comment]\tsmart placement of assembler comments.
113 `asm-comment-char' (which defaults to `?\\;').
115 Alternatively, you may set this variable in `asm-mode-set-comment-hook',
133 (run-hooks 'asm-mode-set-comment-hook)
135 ;; so we can define our own comment character.
137 (local-set-key (vector asm-comment-char) 'asm-comment)
139 (modify-syntax-entry asm-comment-char "< b")
141 (make-local-variable 'comment-start)
142 (setq comment-start (string asm-comment-char))
143 (make-local-variable 'comment-add)
144 (setq comment-add 1)
145 (make-local-variable 'comment-start-skip)
146 (setq comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
147 (make-local-variable 'comment-end-skip)
148 (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
149 (make-local-variable 'comment-end)
150 (setq comment-end "")
175 ;; Simple `;' comments go to the comment-column.
176 (and (looking-at "\\s<\\(\\S<\\|\\'\\)") comment-column)
196 (defun asm-comment ()
197 "Convert an empty comment to a `larger' kind, or start a new one.
198 These are the known comment classes:
200 1 -- comment to the right of the code (at the comment-column)
201 2 -- comment on its own line, indented like code
202 3 -- comment on its own line, beginning at the left-most column.
204 Suggested usage: while writing your code, trigger asm-comment
205 repeatedly until you are satisfied with the kind of comment."
207 (comment-normalize-vars)
208 (let (comempty comment)
212 (setq comment (comment-search-forward (line-end-position) t)))
217 ;; Blank line? Then start comment at code indent level.
218 ;; Just like `comment-dwim'. -stef
221 (insert asm-comment-char asm-comment-char ?\ ))
223 ;; Nonblank line w/o comment => start a comment at comment-column.
224 ;; Also: point before the comment => jump inside.
225 ((or (null comment) (< (point) comment))
226 (indent-for-comment))
228 ;; Flush-left or non-empty comment present => just insert character.
229 ((or (not comempty) (save-excursion (goto-char comment) (bolp)))
230 (insert asm-comment-char))
232 ;; Empty code-level comment => upgrade to next comment level.
233 ((save-excursion (goto-char comment) (skip-chars-backward " \t") (bolp))
234 (goto-char comment)
235 (insert asm-comment-char)
236 (indent-for-comment))
238 ;; Empty comment ends non-empty code line => new comment above.
240 (goto-char comment)
244 (asm-comment)))))