From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.bugs Subject: cc-mode adds newlines Date: Thu, 23 Jan 2003 19:36:29 -0600 (CST) Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <200301240136.TAA26164@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1043372264 9414 80.91.224.249 (24 Jan 2003 01:37:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 24 Jan 2003 01:37:44 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18bsms-0002RZ-00 for ; Fri, 24 Jan 2003 02:37:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18bsno-0001z9-03 for gnu-bug-gnu-emacs@m.gmane.org; Thu, 23 Jan 2003 20:38:40 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18bsms-0000QR-00 for bug-gnu-emacs@gnu.org; Thu, 23 Jan 2003 20:37:42 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18bsme-0008IV-00 for bug-gnu-emacs@gnu.org; Thu, 23 Jan 2003 20:37:29 -0500 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18bsl5-0007Lo-00 for bug-gnu-emacs@gnu.org; Thu, 23 Jan 2003 20:35:51 -0500 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) by manatee.dms.auburn.edu (8.9.1a/8.9.1) with ESMTP id TAA17593; Thu, 23 Jan 2003 19:35:48 -0600 (CST) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.9.3+Sun/8.9.3) id TAA26164; Thu, 23 Jan 2003 19:36:29 -0600 (CST) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: Benjamin Riefenstahl Original-cc: Rommerskirchen Heinrich X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4294 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4294 Benjamin Riefenstahl wrote: Was there a reason to want to have invalid C source originally, or was that just an aesthetic problem? I myself have even the default value of require-final-newline set to t, so in my personal usage I have no problem with what cc-mode does. But clearly Heinrich does. He should tell you the details. I do not know whether he reads the news group or whether you included a cc to him. However, maybe I am misunderstanding things, but is cc-mode not more general than just C: CC Mode is a GNU Emacs mode for editing files containing C, C++, Objective-C, Java, CORBA IDL, and Pike code. Also do not forget that, in addition to the above, people can use cc-mode for just about any language for which no separate mode is available. Actually, the Emacs manual encourages them to do that: Ideally, Emacs should provide a major mode for each programming language that you might want to edit; if it doesn't have a mode for your favorite language, you can contribute one. But often the mode for one language can serve for other syntactically similar languages. Users who know Elisp can write their own mode, but others may just try to customize cc-mode the best they can. So, it is not clear that we are talking about invalid C source, because it is not clear we are talking about C source. Heinrich can give you the details, but essentially I do have reservations about overriding the user's global value of require-final-newline, without any notice, if one does not even knows which language the user might be programming. (Overriding nil to 'maybe is OK, because it asks for permission.) Again, CC Mode's documentation seems to suggest that it is for "C and other similar things", not just for C. Also, people might want to test what the exact effect of forgetting newlines in a language is, for whichever reason. In that case, just temporarily using the trivial hook function I suggested would be sufficient, if one knows what is going on. The problem is that people might not be aware that you are correcting the mistakes they are experimenting with. Hence, they believe that they are not mistakes at all, because everything works OK. That is also part of why I believe it is wrong to correct users's mistakes behind their back. You can do so, as long as you inform them about it. Actually, you should inform them about their mistakes, and if you do not automatically correct you should at least offer to correct them (that is exactly what the 'maybe value does). The reservation I have is not just about automatically overriding the default-value, that in itself could be OK, but about doing so without clear notice, for instance in the C-h m output. Just a small line in the mode documentation might be helpful, maybe with a one-line description of how they can override, if, for whichever reason, they feel that need. So what I am suggesting is not necessarily even changing the current situation, but "change or inform". We will have to wait for Heinrich's response to see what his concrete problem is. Sincerely, Luc.