コメント内での,M-j の挙動
/* この中で M-j をかますと・・・ */
/* この中で M-j をかますと・・・ * こうなります */ // でも本当は,以下のようになってほしいです。 /* この中で M-j をかますと・・・ */ /* こうなります */
どうするかを決めているのが,comment-multi-line という変数だそうな。
以下ヘルプより。
If inside a single line comment and `comment-multi-line' is nil,
a new comment of the same type is started on the next line and
indented as appropriate for comments.
comment-multi-line を nil にすれば,解決ー!!
さらさらさらーっと。
(add-hook 'c-mode-common-hook '(lambda() ;; ... (setq comment-multi-line nil) ;; これを追加 (local-set-key "\C-c\C-c" 'smart-compile)))
あと,smart-compile を C-cC-c にしました。
C-xc では,終了してしまうことが多発するからじゃけん。
でも,リージョンをコメントアウトしたいときはどうするの?
これ,こないだ知ったのですが,`M-;' (セミコロンね) でいける。
なので,C-cC-c に smart-compile を割り当てる決心がついたんです。
こちらもヘルプから引用
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').あなたがのぞむコメントコマンドをよんだげる。
でもー,リージョンがあくちぶで,`transient-mark-mode' がオンなら,
comment-region よんだげる。(でもね,リージョン内にあるのが
コメントだけだったら,uncomment-region よんじゃうよ。)
これは便利ですね。
特に,M-x uncomment-region やるのが,
いくら mcompelete-history を導入したからといって,
大変なのには変わりないからね。