From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luca Ferrari Newsgroups: gmane.emacs.help Subject: Re: c-auto-newline question Date: Fri, 11 Jan 2013 09:51:04 +0100 Message-ID: References: <50ee8139$0$2271$426a74cc@news.free.fr> <50ee8d0f$0$21944$426a74cc@news.free.fr> <50eeecbf$0$2026$426a74cc@news.free.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1357894279 4714 80.91.229.3 (11 Jan 2013 08:51:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2013 08:51:19 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Damien Wyart Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 11 09:51:36 2013 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 1TtaKq-0005RW-0T for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2013 09:51:32 +0100 Original-Received: from localhost ([::1]:50695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtaKa-00034y-6H for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2013 03:51:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtaKS-00034q-Lq for help-gnu-emacs@gnu.org; Fri, 11 Jan 2013 03:51:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtaKQ-0006LW-0t for help-gnu-emacs@gnu.org; Fri, 11 Jan 2013 03:51:08 -0500 Original-Received: from mail-wi0-f172.google.com ([209.85.212.172]:52936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtaKP-0006LN-R9 for help-gnu-emacs@gnu.org; Fri, 11 Jan 2013 03:51:05 -0500 Original-Received: by mail-wi0-f172.google.com with SMTP id o1so1785967wic.11 for ; Fri, 11 Jan 2013 00:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=2HNjtLirF/bwkLrt41RXrJPjquw4HhG2aYm5mOcIdh4=; b=pzWoW7MAaGqNUF0RNGL/lpqh8pTjRWjx/5KIs884LzJWJyOjwHRLGTfiyXPtpmuFUM 8ChNuHfmMXJQ66FmjbEC9azU5Ex3PdIgGp87hENUBTpVGpiXlov08UnEqu2mRUr1zTRZ djFmQsi3JBQW7NSjbALcSpPJ230J/HvMA/xoB5VXvEMi6ryDhq+Mpvww8h3nogQwjuoV xVLcRHyqCxLfXVGqL0DIN4W0hgY9NlpMiwHv2ReFycCuROq0i+r/YSOC5w0ruz7RSkrR gHBXDbuT3wj7c1rQEgOuNHBgsVfywaeur0hjObPEmp43T6bQWjt32gsIz8c525BluIqP daow== Original-Received: by 10.180.82.170 with SMTP id j10mr13984322wiy.2.1357894264408; Fri, 11 Jan 2013 00:51:04 -0800 (PST) Original-Received: by 10.194.39.1 with HTTP; Fri, 11 Jan 2013 00:51:04 -0800 (PST) In-Reply-To: <50eeecbf$0$2026$426a74cc@news.free.fr> X-Google-Sender-Auth: ZlwIFejTXdvjc8ATGzVFPIyBvWE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.172 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:88576 Archived-At: At last I got it: 1) I was using add-to-list in a wrong way, and therefore now the auto-newline works as I want 2) the autocomplete problem with RET is not tied to auto-state but to the autopair minor mode as reported also here: http://code.google.com/p/autopair/issues/detail?id=8 So far, I've disabled autopair, since autocomplete is much more important for my workflow. Luca On Thu, Jan 10, 2013 at 5:30 PM, Damien Wyart wrote: > * Luca Ferrari in gnu.emacs.help: >> Anyway, even with your suggestion the feature is not working properly >> and I've got still Emacs inserting a new blank line every time. > > I tested my snippet before posting it and it worked on my side (no blank > line when following line is not empty), so this might depend on many > other factors (Emacs version, other elisp packages, other .emacs > settings...). > >> Moreover, now the RET does not completes the autocomplete suggestion >> but works as a "bare" return. Could it be therefore something that >> clashes among autocomplete and auto-state? > > No idea, and I have to say I can't go further in debugging this, you > have to investigate on your side (cc-mode is not too hard to debug with > the elisp debugguer and breakpoints on the functions you want to trace, > then checking why the line gets inserted or not/removed or not after > typing ';'). Check if removing the two "add-to-list" statements in my > snippet brings back the autocomplete on RET, then you will now this > comes from this part... This is quite basic debugging, so I think you > will learn more by doing it by yourself. > > Maybe if you want to tune more fully your cc-mode you need to define > your own style (it is easy to find lots of examples on the Web, for > example : > http://google-styleguide.googlecode.com/svn/trunk/google-c-style.el). > > -- > DW