From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Indentation of ?: in C-mode (was: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".]) Date: Sun, 15 Jul 2018 22:23:49 -0400 Message-ID: References: <20180627182717.GA4625@ACM> <20180630190327.GC6816@ACM> <83tvpkkr93.fsf@gnu.org> <20180630201447.GE6816@ACM> <83o9frkmk7.fsf@gnu.org> <20180701163825.GC4697@ACM> <86bmbiceq7.fsf@stephe-leake.org> <86lgacswk8.fsf@stephe-leake.org> <83bmb8a5x0.fsf@gnu.org> <20180715184538.GC4897@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1531707762 477 195.159.176.226 (16 Jul 2018 02:22:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2018 02:22:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 04:22:38 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fet9p-0008Sw-TD for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2018 04:22:38 +0200 Original-Received: from localhost ([::1]:48545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fetBv-0006UP-6z for ged-emacs-devel@m.gmane.org; Sun, 15 Jul 2018 22:24:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fetBB-0006UK-Sg for emacs-devel@gnu.org; Sun, 15 Jul 2018 22:24:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fetB8-0005ad-GZ for emacs-devel@gnu.org; Sun, 15 Jul 2018 22:24:01 -0400 Original-Received: from [195.159.176.226] (port=55722 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fetB8-0005aC-8q for emacs-devel@gnu.org; Sun, 15 Jul 2018 22:23:58 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fet8y-0007cM-0A for emacs-devel@gnu.org; Mon, 16 Jul 2018 04:21:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:s1SyWP/kjdTW07tGKsvWtv8atbs= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227443 Archived-At: >> > + find_start_value >> > + = CONSP (state.levelstarts) ? XINT (XCAR (state.levelstarts)) >> > + : state.thislevelstart >= 0 ? state.thislevelstart >> > + : find_start_value; >> Please use parentheses here for better readability (to clearly show >> which parts belong to which condition). > Yes, it didn't indent well by itself. Maybe I should raise this with > the CC Mode maintainer. But yes, I'll put parens in. This is one of those rare cases where sm-c-mode handles it better: find_start_value = CONSP (state.levelstarts) ? XINT (XCAR (state.levelstarts)) : state.thislevelstart >= 0 ? state.thislevelstart : find_start_value; This said, I don't see either indentation as problematic and I'm not sure what would be "better for readability". Stefan