From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Newsgroups: gmane.emacs.bugs Subject: bug#45160: 27.1; [C] wrong indent for knr-style arguments declaration Date: Thu, 10 Dec 2020 16:02:02 +0100 Message-ID: <87h7otr9g5.fsf@lorien.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14458"; mail-complaints-to="usenet@ciao.gmane.io" To: 45160@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 10 16:03:22 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knNTW-0003d2-5M for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 16:03:22 +0100 Original-Received: from localhost ([::1]:52548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knNTV-00049E-6o for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 10:03:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knNTD-00048L-Dz for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 10:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knNTC-0002sz-1e for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 10:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1knNTB-0006hl-V6 for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 10:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bruno Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Dec 2020 15:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45160 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160761256825752 (code B ref -1); Thu, 10 Dec 2020 15:03:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Dec 2020 15:02:48 +0000 Original-Received: from localhost ([127.0.0.1]:39006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knNSy-0006hI-F7 for submit@debbugs.gnu.org; Thu, 10 Dec 2020 10:02:48 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knNSw-0006h9-G6 for submit@debbugs.gnu.org; Thu, 10 Dec 2020 10:02:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knNSw-0003uo-9T for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 10:02:46 -0500 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:34853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knNSq-0002j4-Mv for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 10:02:46 -0500 Original-Received: by mail-wm1-x336.google.com with SMTP id e25so5648113wme.0 for ; Thu, 10 Dec 2020 07:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=NS5VNg+DagIMDB6CxNlUPKaeFMfa6WP3vvBDBxaIELo=; b=nGG7cGIH7x4VST3PKW5cOC7jZaZVNF3iw3KBJUQWRfvJnWrIKxpoY2NFARYzu2eQRe q3JqOiVFCTnZtDN5uMhJO41CKmv6mPNthZKn6qiBZpXPor+OUvOetwwlrye7+YXOhVmx 3XdrnNQKxw8qtMLPSZmbgDebzvn1iB5XwIEptfSUniAO/4GLncB+ZDxMfk1wBkikLR58 pTmVMHnunUVDtNaHxbVtgPMDLarUNBLXqsGgiWbxLJXE4gPz0xdjs16iIKalKjXZVE90 4f6Cu/T+zx1yVYTP67TVfYiFq3JGW+ZQ1DUGJ8jbn7mrXNBiT2XlgC5ZrESS1bHPIl4z E/Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=NS5VNg+DagIMDB6CxNlUPKaeFMfa6WP3vvBDBxaIELo=; b=hziMc8lmIhvTbX4yfn3my2sVpvk1OUzjRzo9VxZxLPE0pePKMIA9bubVGCFfU4RkbO aOb41mCjoaF/iK4BJBmjgj+HjH0Gx3hC7rCybylm6IHia/Tzd3ld6FbBo9JVn8Ns+Hd+ DsvfKUZAmas4xrzTIhcH+yxO4DZTrsnTZywo6bEhOtm56enjkuZ6ZMQ2HppQjLjfqOA1 Sj0zOJ7gP0Fn9xEd50uq96z2Q/q2SVw1M0Un7cEiKQuGsk4a4MCBzHom2bJu8ayBNvdh oCbYFUe/vJMK+YliOuPMObIrF1YVS5XPGcprxmodafAaWX030d8StXymKAaS9s+6mRz/ C9Rg== X-Gm-Message-State: AOAM533BzUNLThZhcwDdYDPlbn2OtLUiXO+3oWurGURJ1dhkYYGJKm5l MUdrMMdm5Kkd2dCn5Y86h7Era1ogALk= X-Google-Smtp-Source: ABdhPJxUTpZxsJ8ZgQ1xQ9LHHmfGDXOCJTS/OHY33g2lOYNJIc7Fe3V6OIQl0rwHpvFeIQxVAPcJXQ== X-Received: by 2002:a1c:2605:: with SMTP id m5mr8762942wmm.111.1607612558766; Thu, 10 Dec 2020 07:02:38 -0800 (PST) Original-Received: from lorien (home.raoult.com. [78.214.78.108]) by smtp.gmail.com with ESMTPSA id b9sm9613892wmd.32.2020.12.10.07.02.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 07:02:38 -0800 (PST) Original-Received: from lorien (localhost [127.0.0.1]) by lorien (Postfix) with ESMTPS id 3971D1425C5 for ; Thu, 10 Dec 2020 16:02:37 +0100 (CET) Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=braoult@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:195657 Archived-At: Within "emacs -Q" session, open the following C source file: ------------------------------ foo.c int f(i, j, k) int i; int j; int k; { return 1; } int g(i, j, k) int i; int j, k; { return 1; } ------------------------------ Then, do "C-c ." (c-set-style) to "k&r", and "c-c c-o" (c-set-offset), and set "knr-argdecl-intro" to "+". We have now the following values in c-offsets-alist : knr-argdecl-intro : + (First line of a K&R C argument declaration) knr-argdecl : 0 (Subsequent lines in a K&R C argument declaration) re-indent foo.c. At this stage we expect the following indentation for arguments declarations. ------------------------------ expected indentation int f(i, j, k) int i; int j; int k; { return 1; } int g(i, j, k) int i; int j, k; { return 1; } ------------------------------ But we get the following result (please note line 11). ------------------------------ emacs indentation int f(i, j, k) int i; int j; int k; { return 1; } int g(i, j, k) int i; int j, k; { return 1; } ------------------------------ It should be noted that if we separate each argument on separate lines (function f), indentation is correct. It is incorrect if multiple variables are in same declaration (function g). Also, multiple variables on first arguments declaration line seems to have correct indentation. Regards, Bruno. In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2020-10-29 built on lorien Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Ubuntu 20.04.1 LTS Recent messages: End of buffer [3 times] Beginning of buffer [3 times] Making completion list... Beginning of buffer [3 times] previous-line: Beginning of buffer user-error: No further undo information C-x C-g is undefined previous-line: Beginning of buffer [10 times] scroll-up-command: End of buffer command-execute: Buffer is read-only: # Quit Configured features: XPM JPEG TIFF GIF PNG SOUND GSETTINGS GLIB NOTIFY INOTIFY LIBSELINUX GNUTLS FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 XDBE XIM MODULES THREADS PDUMPER GMP Important settings: value of $LC_MESSAGES: C value of $LC_MONETARY: en_IE.UTF-8 value of $LC_NUMERIC: en_IE.UTF-8 value of $LC_TIME: en_IE.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (pp shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt help-fns radix-tree help-mode cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 70553 13929) (symbols 48 8643 2) (strings 32 22665 2290) (string-bytes 1 841592) (vectors 16 13093) (vector-slots 8 166207 22348) (floats 8 23 93) (intervals 56 501 6) (buffers 1000 17))