From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 26 14:25:33 2015 Received: (at submit) by debbugs.gnu.org; 26 Sep 2015 18:25:33 +0000 Received: from localhost ([127.0.0.1]:45180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfuA8-0003U6-9V for submit@debbugs.gnu.org; Sat, 26 Sep 2015 14:25:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43425) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zfm7W-0003kw-MR for submit@debbugs.gnu.org; Sat, 26 Sep 2015 05:50:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zfm7U-0001bJ-Ti for submit@debbugs.gnu.org; Sat, 26 Sep 2015 05:50:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfm7U-0001bE-RP for submit@debbugs.gnu.org; Sat, 26 Sep 2015 05:50:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfm7T-0007Zf-Fs for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 05:50:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zfm7O-0001ZL-BC for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 05:50:15 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:36460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zfm7O-0001ZA-3t for bug-gnu-emacs@gnu.org; Sat, 26 Sep 2015 05:50:10 -0400 Received: by pablk4 with SMTP id lk4so31406025pab.3 for ; Sat, 26 Sep 2015 02:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=keIPXScumuzo+6TDZpAzcZVE7cjPTCPoXmXIPEVmGXQ=; b=m742+RpdKh3WtO7DSiD9YMq5OzoiS45t1T8Y7JTASR0K0mQlGGkfc5ZNnKSVvk4405 07cPyT1EbOkDsx5kJJkgWr1YuvY/b1fmkd4VvcDgXXnIEQlwOXctHYml7QCwEWpouZdb jx1cSn3QhLjdcoG64XBh6kGJqhlLPHHE0vXtT47aVXbl+o5zEUYqWWUvn4H5GZkJdAYv XWjtJDa4dfh1PbQIXokwH6ZFnZmtlUKhjRR95TW9qfZ+unpciAn6rG3OTbMLrBZNboIF gFb49u06ru5TdNYme/elIB+U5yrh3ufxabk897qaFoVqJ4gVIt9YW4/Ggq8gWHsYnHfL oXlw== X-Received: by 10.66.228.233 with SMTP id sl9mr4755781pac.139.1443261009021; Sat, 26 Sep 2015 02:50:09 -0700 (PDT) Received: from [192.168.0.26] (168-103-229-158.ptld.qwest.net. [168.103.229.158]) by smtp.googlemail.com with ESMTPSA id tz8sm8357098pab.34.2015.09.26.02.50.07 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Sep 2015 02:50:08 -0700 (PDT) Message-ID: <56066A48.5070007@gmail.com> Date: Sat, 26 Sep 2015 02:50:00 -0700 From: "Faye N." User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.5; prog-mode unconditionally sets require-final-newline Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 26 Sep 2015 14:25:31 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) In using a mode that inherits from prog-mode (perl6-mode), I found it inserting a newline at the end of my files upon saving, despite having require-final-newline set to nil. After a bit of digging, I found that prog-mode sets require-final-newline to mode-require-final-newline. 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. In my specific case, Perl 6 is not a language that balks at the lack of a final newline, so the use of mode-require-final-newline would be inappropriate for any mode implementing Perl 6 support. 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. It could either be user-configurable for prog-mode via customize, or it could be something a deriving major mode chooses to use (but then again, that would be no better than the deriving mode setting require-final-newline itself in the first place). In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.28) of 2015-08-25 on AMD64 Windowing system distributor `The X.Org Foundation', version 11.0.11604000 System Description: NAME=Gentoo Configured using: `configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --libdir=/usr/lib64 --program-suffix=-emacs-24 --infodir=/usr/share/info/emacs-24 --localstatedir=/var --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp --with-gameuser=:gamestat --without-compress-install --with-file-notification=inotify --enable-acl --with-dbus --without-gnutls --with-gpm --without-hesiod --without-kerberos --without-kerberos5 --without-xml2 --without-selinux --without-wide-int --with-zlib --with-sound=alsa --with-x --without-ns --without-gconf --without-gsettings --with-toolkit-scroll-bars --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm --without-imagemagick --with-xft --without-libotf --without-m17n-flt --with-x-toolkit=gtk2 GENTOO_PACKAGE=app-editors/emacs-24.5 'CFLAGS=-march=k8 -O2 -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed'' Important settings: value of $LC_COLLATE: C value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Perl6 Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: [not relevant] Load-path shadows: ~/emacsmodes/cperl-mode hides /usr/share/emacs/24.5/lisp/progmodes/cperl-mode Features: (shadow sort mail-extr emacsbug sendmail whitespace apropos debug mule-util epa-file epa epg perl-mode server misearch multi-isearch cus-edit cus-start cus-load wid-edit vc-git perl6-mode derived perl6-indent perl6-font-lock smie pcase perl6-detect tar-mode json find-func epl rx cl-macs gv compile comint ansi-color ring autoload lisp-mnt mm-archive message format-spec rfc822 mml mml-sec mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mail-utils network-stream starttls url-http tls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-cache url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core gnus-util mm-util help-fns mail-prsvr password-cache url-vars finder-inf help-mode easymenu cmake-mode thingatpt solarized-dark-theme solarized solarized-theme-autoloads package epg-config site-gentoo edmacro kmacro cl-loaddefs cl-lib imenu time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind inotify dynamic-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 229799 51554) (symbols 48 28232 0) (miscs 40 1018 950) (strings 32 47424 2827) (string-bytes 1 1311635) (vectors 16 27286) (vector-slots 8 1371261 215410) (floats 8 99 738) (intervals 56 3990 0) (buffers 960 29) (heap 1024 44864 2301)) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 26 18:14:18 2015 Received: (at 21570) by debbugs.gnu.org; 26 Sep 2015 22:14:18 +0000 Received: from localhost ([127.0.0.1]:45256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfxjW-00009D-FK for submit@debbugs.gnu.org; Sat, 26 Sep 2015 18:14:18 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:33378) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZfxjU-000093-8l for 21570@debbugs.gnu.org; Sat, 26 Sep 2015 18:14:16 -0400 Received: by wiclk2 with SMTP id lk2so61319620wic.0 for <21570@debbugs.gnu.org>; Sat, 26 Sep 2015 15:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=0TkMbDZD8n+leoPQ/gAKxZP3LbDfP6mpewM8jXLvKq4=; b=CIBTUez68qh6KjdJoYJk5qjtkcEw+ICN7W96VBW+pPDK5ezWtEOaLEooQqUnbehDkA VvsA2b5gWbeTSStDAd3KvsyaxvOIgpDPorn+42iEHqi4SGVejBU3mage18e2w++yHZ2C BjiRdcuK+dYYJeJYIF0i/fSN+uZFXkPjkDyfvGh3UWfSAoJYLdddY95IT7v4iRPELrUs p6AfoxhP3SSR+x0EEiN6hub0v4QGYlItqvIk+2KIVeTovd4Hmkg+xujNyNd0k7KZBEdx NvANqdPfK/oXwz8n7h0rzNtDKki0oMqxSX04C1+SkKHDU5wOpt3g3pHoO9mjbLuyj9N3 GpZA== X-Received: by 10.194.113.1 with SMTP id iu1mr15158969wjb.158.1443305655555; Sat, 26 Sep 2015 15:14:15 -0700 (PDT) Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id lf10sm10243867wjb.23.2015.09.26.15.14.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Sep 2015 15:14:14 -0700 (PDT) Subject: Re: bug#21570: 24.5; prog-mode unconditionally sets require-final-newline To: "Faye N." , 21570@debbugs.gnu.org References: <56066A48.5070007@gmail.com> From: Dmitry Gutov Message-ID: <560718AD.7010403@yandex.ru> Date: Sun, 27 Sep 2015 01:14:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Thunderbird/41.0 MIME-Version: 1.0 In-Reply-To: <56066A48.5070007@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21570 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 ...))) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 18:19:19 2019 Received: (at 21570) by debbugs.gnu.org; 29 Sep 2019 22:19:19 +0000 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 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 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) MIME-Version: 1.0 From: Stefan Kangas Date: Mon, 30 Sep 2019 00:19:00 +0200 Message-ID: Subject: Re: bug#21570: 24.5; prog-mode unconditionally sets require-final-newline To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21570 Cc: 21570@debbugs.gnu.org, "Faye N." X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From unknown Sun Jun 22 04:18:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 28 Oct 2019 11:24:16 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator