Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103771 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74633 invoked from network); 20 Jan 2019 00:31:59 -0000 Received: from unknown (HELO mail-ot1-f51.google.com) (209.85.210.51) by pb1.pair.com with SMTP; 20 Jan 2019 00:31:59 -0000 Received: by mail-ot1-f51.google.com with SMTP id u16so17474773otk.8 for ; Sat, 19 Jan 2019 13:08:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=3cUVZ8EyUvLbCvrpBqs/gvi7IpY51eNTsHpJC0UXEqQ=; b=ZgXhjK1DmgMkBY/f1U8P065QjNyRAC7bio+8gGdtzVrKxqxXE5PXmaKMyeYxau8+m3 Rh1SjZXFGHCwFtJ44867wG64XoPdDnZKS2mkMrkHSfUCNPTkPpjOgYhSkFRrmvWMxbp8 Yx37kNedGitY7+6Lxm7xz6lCwKuizFBhfRujDfQqxnl9Wrs4vxCRccgKc48EZeEFEaZp 243P5G+8A7cAWz/ZQG1NyWnZUJKhFUOta2ne26y0HEPZ8kDdi4j4g58wmYTYIpseJZci T+OQX2LY9MuNXdYDP/0MWe1Yuj7mxoyLYlbPbEh06OdbPuNCI9lQ2IzAXzAg2xY91WRl 3WIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=3cUVZ8EyUvLbCvrpBqs/gvi7IpY51eNTsHpJC0UXEqQ=; b=mPh47FxTC7j/naBEt8nB8T1+FsgiQ9Phl/3gywlIJ8ghvcOJ1a5H2D5rKTvLNTzXhR GikWhKc/BdsnRJRoE5oP6/lfMLZ/iffh4f/c6UdUC5vnWNSCEpoYLjqBP08MIweZK6eS sAYztfsPWCcp9ujKIpaXuSJ1dCsM7yObfeh1mtv38xDr9IKZxwaUOJwBhe/TdNRD/OAc 4doKIB6lVcLy3Qfy+tAjUvFlFm7AvZn5L/PKgboFCSVPPhM4lyflKlKXenhn/5zkgCvs rK5HjUmAoVSoNQNNCtu/bk6sIHMAlhx1pC7wrEjuvC8zZHulKEZve56ICKDAo2xK/OWV S4fw== X-Gm-Message-State: AJcUukdt3+AbogqRLcOpQ+9M6fWf6NQUYJMBK/EiAYwFBYKDnMhtEdgH tS0x1FUeby496gH3IorDHUK/yf4dCFyicTqJHrbzJzQg X-Google-Smtp-Source: ALg8bN6Hmqr8CLUkgbbDtbncvIT2ZmdracZuovIYw+RJBDF71fafAfIDVz2IA8XxN4GuGy+WmHG6s9thIg9haXyt+iw= X-Received: by 2002:a9d:a48:: with SMTP id 66mr15350747otg.308.1547932136480; Sat, 19 Jan 2019 13:08:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 19 Jan 2019 22:08:45 +0100 Message-ID: To: Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: Local variables for editors From: peterkokot@gmail.com (Peter Kokot) On Wed, 29 Nov 2017 at 22:53, Peter Kokot wrote: > > Hello, > > I'm not sure if this has been discussed before, but I find these local > variables in C, H and other files a bit strange and bloated: > > /* > * Local variables: > * tab-width: 4 > * c-basic-offset: 4 > * End: > * vim600: noet sw=4 ts=4 fdm=marker > * vim<600: noet sw=4 ts=4 > */ > > Is there any chance to start omitting them and use a single > .editorconfig file instead or is this something that is a must have in > C projects of today? > > Thank you for some clarification on this :) Hello, I'm bumping this question since it was brought up also in the pull request for fixing the code style of the libmbfl [1]. Going through these editor settings: - tab-width: 4 is already set in the .editorconfig file - c-basic-offset: 4 is emacs setting for indentation level [2] - noet is setting for vim to not expand tabs to spaces - sw means setting the shift width in vim - ts means tabstop - fdm=marker means folding method [3] Since these are specific for the C code, we should instead set other ways of code style fixes methods for this task. For example, Clang format and Clang tidy can fix existing code quite nicely from what the settings they have available. And EditorConfig mostly can do all that what is set above - set the indentation style and its width. Not to mention that with the default Vim configuration (tested on latest Ubuntu), this doesn't work as it should anymore. So, the main question here, can we start removing these comment blocks from the *.c and *.h files together with the footer file [4]? [1] https://github.com/php/php-src/pull/3754 [2] https://www.emacswiki.org/emacs/IndentingC [3] http://vim.wikia.com/wiki/Folding [4] http://git.php.net/?p=php-src.git;a=blob;f=footer;hb=HEAD -- Peter Kokot