GNU bug report logs - #57042
28.1.91; c-mode autoindents cweb style lines

Previous Next

Package: emacs;

Reported by: Van Ly <van.ly <at> sdf.org>

Date: Sun, 7 Aug 2022 16:19:02 UTC

Severity: normal

Tags: notabug

Found in version 28.1.91

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van Ly <van.ly <at> sdf.org>
Cc: 57042 <at> debbugs.gnu.org
Subject: bug#57042: 28.1.91; c-mode autoindents cweb style lines
Date: Sun, 07 Aug 2022 19:31:11 +0300
> Date: Sun, 7 Aug 2022 16:16:31 +0000 (UTC)
> From: Van Ly <van.ly <at> 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.




This bug report was last modified 2 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.