From: Eli Zaretskii <eliz@gnu.org>
To: Van Ly <van.ly@sdf.org>
Cc: 57042@debbugs.gnu.org
Subject: bug#57042: 28.1.91; c-mode autoindents cweb style lines
Date: Sun, 07 Aug 2022 19:31:11 +0300 [thread overview]
Message-ID: <83r11svwvk.fsf@gnu.org> (raw)
In-Reply-To: <f0e6cd3a-5d2f-53e8-6d69-de1d2a5dd3f@SDF.ORG> (message from Van Ly on Sun, 7 Aug 2022 16:16:31 +0000 (UTC))
> Date: Sun, 7 Aug 2022 16:16:31 +0000 (UTC)
> From: Van Ly <van.ly@sdf.org>
>
> C Mode autoindents CWEB style lines undesirably.
>
> Steps to reproduce
> . starting from 'emacs -Q'
> . open new file 'C-x f /dev/shm/explain.w'
> . enable mode for C 'M-x c-mode'
> . enter the C CWEB style source text below
> . Explanation}
> the last two lines autoindent but I expect them to be without
> . at line 6 below at # position c-set-offset reports 'cpp-macro'
> . at line 0 below at # position c-set-offset reports 'cpp-macro'
>
> Expected result is for lines 6, F and 0 below to be without indent.
>
> ```
> 1 @** Convert 511 decimal to octal.
> 2 @d _x_number_x_ 511
> 3 @d _x_banner_x_ "What is the value of %d in octal?"
> 4 @c
> 5 #include <stdio.h>
> 6 #include "u.h"
> 7 int@/
> 8 main(void)@/
> 9 {
> A int n = _x_number_x_;
> B printf (_x_banner_x_, n);
> C printf ("%s! %d decimal is %o octal\n", "Right", n, n);
> D }
> E @ @(u.h@>=
> F @h
> 0 #include <stdlib.h>
> ```
Sorry, I don't understand: why do you expect C Mode to DTRT for CWEB
files? The above is not valid C code, it's a different language that
needs a dedicated major mode.
next prev parent reply other threads:[~2022-08-07 16:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-07 16:16 bug#57042: 28.1.91; c-mode autoindents cweb style lines Van Ly
2022-08-07 16:31 ` Eli Zaretskii [this message]
2022-08-07 18:12 ` Van Ly
2022-08-07 21:58 ` Lars Ingebrigtsen
2022-08-08 3:50 ` Van Ly
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83r11svwvk.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=57042@debbugs.gnu.org \
--cc=van.ly@sdf.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).