From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#21570: 24.5; prog-mode unconditionally sets require-final-newline Date: Mon, 30 Sep 2019 00:19:00 +0200 Message-ID: References: <56066A48.5070007@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="219862"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 21570@debbugs.gnu.org, "Faye N." To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 00:20:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEhY6-000v2P-3W for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 00:20:14 +0200 Original-Received: from localhost ([::1]:42426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEhY4-0006b5-Dj for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2019 18:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33975) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEhXv-0006ay-HQ for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 18:20:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEhXu-0002oL-Az for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 18:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47200) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iEhXu-0002oD-7A for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 18:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iEhXu-0000NS-1Q for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2019 18:20:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <56066A48.5070007@gmail.com> Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Sep 2019 22:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21570 X-GNU-PR-Package: emacs Original-Received: via spool by 21570-submit@debbugs.gnu.org id=B21570.15697955591354 (code B ref 21570); Sun, 29 Sep 2019 22:20:01 +0000 Original-Received: (at 21570) by debbugs.gnu.org; 29 Sep 2019 22:19:19 +0000 Original-Received: from localhost ([127.0.0.1]:56021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEhXD-0000Lg-B1 for submit@debbugs.gnu.org; Sun, 29 Sep 2019 18:19:19 -0400 Original-Received: from mail-pg1-f194.google.com ([209.85.215.194]:36795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEhXB-0000LD-9A for 21570@debbugs.gnu.org; Sun, 29 Sep 2019 18:19:18 -0400 Original-Received: by mail-pg1-f194.google.com with SMTP id t14so6254695pgs.3 for <21570@debbugs.gnu.org>; Sun, 29 Sep 2019 15:19:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=DSAiGZlQeFvSF/5d9svWhAf645F06mCaZcpXvM/lr+s=; b=oXdD0yhXchOb4NimCp/NmYkakKUZR2QQGuKTGDW1DfQgzK+gVLJI1ceOFPQiuLQnNX yRDUm/3XhU6SO3Rr8+KT5iuFrsRgepk1nsbng3PTEYV2cQ4kK5QRAqq27TCdgZZIJ3rF 5YSQMusTHmw5AghXnmnpneBKqVVQVaizg1sqkKD4Wb/2ynlrxhwsmy1q9IjIJ8mj+8o7 UZ34Gt6Bni9Nd/dalIxdgvs3Qk7091SccHsCGPKLmRk2vSDR1xyPD15KpcOba8pel7Pj RsaSlthJ7NGkcMg9vmUFf4SyethqGPaAktjMKdLfOELUQbAV5EBxaLFl7f4FMjY/1uDY DYhg== X-Gm-Message-State: APjAAAWtZLDsZCD24/iYX1u+HRsM4IudqFGdpllbXvNhUZFpuytMLH6e Bb0tz3VNfXonyhtoWky5MG14Rgv9YYy3zW1PbH8= X-Google-Smtp-Source: APXvYqwcheplmYQRTPFj4PEntlmoFwlaj6g+yYm6FDxXIqhKrQ4xCjnQVJsWuDOgzVlggiVNMVKhHIX4coVp1ovAB7A= X-Received: by 2002:a17:90b:8d1:: with SMTP id ds17mr23536009pjb.106.1569795551458; Sun, 29 Sep 2019 15:19:11 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167760 Archived-At: tags 21570 + wontfix close 21570 thanks Dmitry Gutov writes: > On 09/26/2015 12:50 PM, Faye N. wrote: > >> While normally I don't have an issue with this sort of thing (I leave >> mode-require-final-newline on specifically for programs that have yet to >> handle the lack of final newlines in their input files), the fact that this is >> in prog-mode seems like a bug to me. prog-mode as I understand it is mainly >> for other modes to derive from as a starting point, so forcing a final newline >> in a generic major mode such as this is wrong to me. > > prog-mode is the place where the mode-require-final-newline setting takes > effect, in a centralized fashion. > > Regardless of the programming language in question, certain tools that one might > want to employ for software development interact badly with source files that > don't end on a newline. Hence it's a good idea to add them in source files. > > But when it's not the case, a major mode, or the user, can override this (in the > mode definition, or in a hook). > >> I'd suggest either not having prog-mode set this in the first place (leaving it to modes that actually need it to decide), or if prog-mode has to set it, that its doing so be configurable. > > Since it's the first such request, I think the degree of customizability > provided by our hooks facility is enough: > > (add-hook 'prog-mode-hook (lambda () (setq require-final-newline ...))) Indeed, and I'm therefore closing this as wontfix. Best regards, Stefan Kangas