From: Christian Neukirchen Date: 2006-08-16T03:25:49+09:00 Subject: Re: block commenting-out Chad Perrin writes: >> >> M-x comment-region >> >> >> >> Bind to every key you like (I don't use it often). >> >> >> >> C-u M-x comment-region (or M-x uncomment-region) will uncomment. >> > >> > Try M-; (comment-dwim). >> >> I knew there was an easier way, but M-; requires using transient-mark >> mode (shudder). Well, not too bad in Emacs 22, C-SPC, C-SPC. > > What do "comment-region" and "comment-dwim" mean in practical terms in > this case? comment-region: Comment or uncomment each line in the region. With just C-u prefix arg, uncomment each line in region beg .. end. Numeric prefix arg means use arg comment characters. If arg is negative, delete that many comment characters instead. By default, comments start at the left margin, are terminated on each line, even for syntax in which newline does not end the comment and blank lines do not get comments. This can be changed with `comment-style'. comment-dwim: Call the comment command you want (Do What I Mean). If the region is active and `transient-mark-mode' is on, call `comment-region' (unless it only consists of comments, in which case it calls `uncomment-region'). Else, if the current line is empty, insert a comment and indent it. Else if a prefix arg is specified, call `comment-kill'. Else, call `comment-indent'. You can configure `comment-style' to change the way regions are commented. > How many modes are there to emacs? 492 matches for "-mode$" in buffer: *Apropos* :-) -- Christian Neukirchen http://chneukirchen.org