Hongyi Zhao <hongyi.z...@gmail.com> writes: > I want to have the feature of (Un)comment a line or several lines with > markers at an arbitrary position(s) in/spanning this/these line(s).
Use comment-line instead of comment-dwim. --8<---------------cut here---------------start------------->8--- C-x C-; runs the command comment-line (found in global-map), which is an interactive byte-compiled Lisp function in ‘newcomment.el’. It is bound to C-x C-;. (comment-line N) Comment or uncomment current line and leave point after it. With positive prefix, apply to N lines including current one. With negative prefix, apply to -N lines above. Also, further consecutive invocations of this command will inherit the negative argument. If region is active, comment lines in active region instead. Unlike ‘comment-dwim’, this always comments whole lines. --8<---------------cut here---------------end--------------->8--- Bye, Tassilo