unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Comment out some lines in a c preprocessor (cpp) file will cause the comment section not to be left-aligned.
@ 2022-03-21 14:09 Hongyi Zhao
  0 siblings, 0 replies; only message in thread
From: Hongyi Zhao @ 2022-03-21 14:09 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

I opened the following c preprocessor (cpp) file in Emacs:

;;;;;;;;;;;;;;;;;;;;;;;; begin of test.cpp  ;;;;;;;;;;;;;;;;;;;;;;;;
$ gcc -E ifdef.cxx
# 1 "ifdef.cxx"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "ifdef.cxx"


#if 0
int i = 1;
#else
int i = 2;
#endif
;;;;;;;;;;;;;;;;;;;;;;;; end of test.cpp  ;;;;;;;;;;;;;;;;;;;;;;;;

When I try to comment out the following part in the above file with `M-;`:

;;;;;;;;;;;;;
$ gcc -E ifdef.cxx
# 1 "ifdef.cxx"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "ifdef.cxx"
;;;;;;;;;;;;;

I find the file will be commented into the format as shown in the
attachment. As you can see, comment out some lines in a c preprocessor
(cpp) file will cause the comment section not to be left-aligned. I am
very confused about this behavior of Emacs. Any hints will be
appreciated.

Regards
-- 
Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 70310 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-21 14:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-21 14:09 Comment out some lines in a c preprocessor (cpp) file will cause the comment section not to be left-aligned Hongyi Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).