From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B.V. Raghav" Newsgroups: gmane.emacs.help Subject: Re: Skeleton angle brackets '<' and '>' Date: Thu, 07 Jan 2016 09:33:49 +0530 Message-ID: <8737uaxcgq.fsf@think.bvr.lan> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452139464 23825 80.91.229.3 (7 Jan 2016 04:04:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jan 2016 04:04:24 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Alan Mackenzie Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 07 05:04:18 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aH1o9-0003CO-OE for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jan 2016 05:04:17 +0100 Original-Received: from localhost ([::1]:56785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aH1o5-00005P-PE for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jan 2016 23:04:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aH1nv-00005J-Ah for help-gnu-emacs@gnu.org; Wed, 06 Jan 2016 23:04:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aH1ns-0003IA-4m for help-gnu-emacs@gnu.org; Wed, 06 Jan 2016 23:04:03 -0500 Original-Received: from mail3.iitk.ac.in ([202.3.77.190]:60687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aH1nr-0003HC-OR for help-gnu-emacs@gnu.org; Wed, 06 Jan 2016 23:04:00 -0500 Original-Received: from smtp.cc.iitk.ac.in (smtp.cc.iitk.ac.in [172.31.1.22]) by mail3.iitk.ac.in (Postfix) with ESMTP id 37A2310000AB; Thu, 7 Jan 2016 09:33:50 +0530 (IST) Original-Received: from think (unknown [172.20.220.29]) (Authenticated sender: bvraghav) by smtp.cc.iitk.ac.in (Postfix) with ESMTPA id 2E59B48; Thu, 7 Jan 2016 09:33:50 +0530 (IST) In-Reply-To: (Alan Mackenzie's message of "Wed, 6 Jan 2016 17:59:39 +0000 (UTC)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 202.3.77.190 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108640 Archived-At: Hi Alan, Alan Mackenzie writes: > > Be careful what you want! Do you also want automatically to pair up > "less than" with "greater than"? It could get pretty tedious if, every > time you wanted to write "i < 10", you got "i <>", forcing you to delete > the ">" before writing in the "10". > > This overloading of < and > with two meanings (actually, three when you > count "#include ", but that causes few problems) causes great > difficulties for C++ Mode. Only after extensive analysis can the mode > determine that a < and a > are a pair of template delimiters, and even > then, can't do it with 100% certainty. > > For example, how many parameters are passed to foo in the following: > > foo (a < b, c > d); > > ? It might be a function call with two relational expressions, it might > be a declaration with the single parameter d of templated type a . > Such was the wisdom of C++'s designers. > > When it is determined there is a pair of delimiters, they are marked as > such with syntax-table text properties, but this marking is always done > on both delimiters at once. > > In short, there is little chance of ever being able to insert angle > brackets as a pair in C++ Mode. Sorry! Oh my, my! I totally forgot about the relational operator part! And the elaborate explanation was highly insightful---a brilliant recap of the C++ basics. Thanks, r -- (B.V. Raghav)