From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: Skeleton angle brackets '<' and '>' Date: Wed, 6 Jan 2016 17:59:39 +0000 (UTC) Organization: muc.de e.V. Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1452103220 11297 80.91.229.3 (6 Jan 2016 18:00:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Jan 2016 18:00:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 06 19:00:20 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 1aGsNe-0000hj-La for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jan 2016 19:00:18 +0100 Original-Received: from localhost ([::1]:55562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGsNe-00057p-2k for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jan 2016 13:00:18 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.freenet.ag!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Injection-Date: Wed, 6 Jan 2016 17:59:39 +0000 (UTC) Injection-Info: colin.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="18141"; mail-complaints-to="news-admin@muc.de" User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.2-RELEASE-p7 (amd64)) Original-Xref: usenet.stanford.edu gnu.emacs.help:216345 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:108635 Archived-At: B.V. Raghav wrote: > Hi, > There are smart tools for the purpose, but I prefer to stick to the old > school for auto pairing. > Electric Pair mode and Skeleton pair, like this: > (electric-pair-mode t) > (setq skeleton-pair t) > While in the c++ mode, (hopefully true for all c-modes) > I am able to successfully pair (), {}, and [], with a single key press, > i.e. of the preceding character of the pair. > I also want to pair the angle brackets, i.e. `<' and `>' characters. 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! > The documentation for the variable sekeleton-pair-alist says, > [...] > Each alist element, which looks like (ELEMENT ...), is passed to > `skeleton-insert' with no interactor. Variable `str' does nothing. > Elements might be (?` ?` _ "''"), (?\( ? _ ")") or(?{ \n > _ \n ?} >). > [...] > I am sorry to say, I cant make a head or tail of this cryptic value > suggested for the variable. Sorry to say this, but neither can I. I don't know what an "interactor" is, variable `str' is obscure, and it is totally unclear what the various example elements might mean. > Help solicited. Can I suggest you submit a bug report for this dreadful doc string? > Thanks, > r > -- > (B.V. Raghav) -- Alan Mackenzie (Nuremberg, Germany).