From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 01 19:43:37 2013 Received: (at submit) by debbugs.gnu.org; 1 Aug 2013 23:43:37 +0000 Received: from localhost ([127.0.0.1]:35359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V52Wu-0002H2-Mu for submit@debbugs.gnu.org; Thu, 01 Aug 2013 19:43:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33753) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V52Wq-0002Gd-Uc for submit@debbugs.gnu.org; Thu, 01 Aug 2013 19:43:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V52Wb-0004f3-9H for submit@debbugs.gnu.org; Thu, 01 Aug 2013 19:43:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-99.2 required=5.0 tests=BAYES_50,USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V52Wb-0004ew-1q for submit@debbugs.gnu.org; Thu, 01 Aug 2013 19:43:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V52WS-0002oQ-R1 for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2013 19:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V52WK-0004XZ-81 for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2013 19:43:08 -0400 Received: from mailout2-12.pacific.net.au ([125.255.80.139]:48811 helo=mailout4-syd3.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V52WJ-0004Vw-M8 for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2013 19:43:00 -0400 Received: from mailproxy3-syd3.pacific.net.au (mailproxy3-syd3.pacific.net.au [61.8.2.164]) by mailout4-syd3.pacific.net.au (Postfix) with ESMTP id 6D74F47B6B2 for ; Fri, 2 Aug 2013 09:42:54 +1000 (EST) Received: from blah.blah (unknown [203.26.175.75]) by mailproxy3-syd3.pacific.net.au (Postfix) with ESMTP id 9BE49578092 for ; Fri, 2 Aug 2013 09:42:53 +1000 (EST) Received: from gg by blah.blah with local (Exim 4.80) (envelope-from ) id 1V52WO-0005B5-W9 for bug-gnu-emacs@gnu.org; Fri, 02 Aug 2013 09:43:05 +1000 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 24.3; fill-paragraph on perl-mode indented comment at start of buffer Date: Fri, 02 Aug 2013 09:43:04 +1000 Message-ID: <87wqo5vuyf.fsf@blah.blah> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: -3.4 (---) X-Debbugs-Envelope-To: submit 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: -3.4 (---) Starting from emacs -Q, (progn (switch-to-buffer "xx") (erase-buffer) (insert " # aa aa\n") (insert " # bb bb\n") (insert " # cc cc\n") (insert " # dd dd\n") (goto-char (point-min)) (perl-mode) (fill-paragraph nil)) gives # aa aa # bb bb cc cc dd dd whereas I hoped the fill-paragraph would include the first line too, # aa aa bb bb cc cc dd dd The problem is only if the lines are at the start of the buffer. I noticed this under filladapt which narrows to its desired target region and fills that. The problem occurs both at actual start of buffer and when narrowed. I couldn't tell where it might go wrong except that it might be related to perl-mode using comment-start-skip "\\(^\\|\\s-\\);?#+ *" which has a \\(\\) group to demand preceding whitespace if not at start of line. If you change it to (set (make-local-variable 'comment-start-skip) ";?#+[ \t]*") then the fill correctly includes the first line. In GNU Emacs 24.3.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2013-05-29 on blah.blah, modified by Debian System Description: Debian GNU/Linux 7.0 (wheezy) Configured using: `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro -Wl,-znocombreloc' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: en_AU locale-coding-system: iso-latin-1-unix default enable-multibyte-characters: t From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 12 18:55:37 2020 Received: (at control) by debbugs.gnu.org; 12 Aug 2020 22:55:37 +0000 Received: from localhost ([127.0.0.1]:45899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5zei-000417-Rv for submit@debbugs.gnu.org; Wed, 12 Aug 2020 18:55:37 -0400 Received: from mail-yb1-f170.google.com ([209.85.219.170]:42500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5zed-00040p-TW for control@debbugs.gnu.org; Wed, 12 Aug 2020 18:55:35 -0400 Received: by mail-yb1-f170.google.com with SMTP id a34so2239706ybj.9 for ; Wed, 12 Aug 2020 15:55:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=FbT686WfkzI6AzkQ2wgpSJGa+5+ZavfHAzp1Dq4kKQI=; b=Cyc8wzORsERtGMvRKSFCd0B12aXXDAzDlaeTv/f69Q8I3V2e3qGPaWzWdcwgr0jfXW PYrydc5/Wv68cunZRwMegIhD5McorvFwpV7KR6K67XkCADKX3cmCaboWlMOiVg8gPKyJ Gybo8DQvH7HmExuoMc1Sp8ZnNgnkZ7uZCxpA3r5e917wMHTdtY3c33GB9w0LKCSIdTs+ QMpMVKV68JBGwg60vcMfx9DGGDb+XDkbaJIlgZPsUt4GIz5dC6YmWVDgpS62RTboTtsJ Pq5aeQYo9VrHex24XAm2T2ZwQli8RxDwwUSqAw6WHMh4wjwVDSYlezpVXeMRWogkXl0K kujA== X-Gm-Message-State: AOAM533RnjlVdjL0KvAmplGXvixvrLniyosjwfyoRiTx6ZzLiI9Dkz1X VsFAoiiuRn5S0Z3lMrWsjdaBzeoMmyMvA/A/hOmWZ8WmYgE= X-Google-Smtp-Source: ABdhPJw5LBWP1lVoXCqZfh/v1NihY86BxqGkpxtUQt+10Ey5/dQotRQIJ2+yc2/3LkkovNbmlOsmu5zyhD8dDFlPla8= X-Received: by 2002:a25:b290:: with SMTP id k16mr2416513ybj.389.1597272926257; Wed, 12 Aug 2020 15:55:26 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Aug 2020 15:55:25 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Wed, 12 Aug 2020 15:55:25 -0700 Message-ID: Subject: To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 15004 + confirmed found 15004 28.0.50 thanks Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.170 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.170 listed in wl.mailspike.net] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 2.0 BLANK_SUBJECT Subject is present but empty X-Debbugs-Envelope-To: control 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 15004 + confirmed found 15004 28.0.50 thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 08:33:14 2022 Received: (at 15004) by debbugs.gnu.org; 21 Sep 2022 12:33:14 +0000 Received: from localhost ([127.0.0.1]:32856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oayub-0006G9-PM for submit@debbugs.gnu.org; Wed, 21 Sep 2022 08:33:14 -0400 Received: from mail-oa1-f48.google.com ([209.85.160.48]:42983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oayuV-0006Fb-Kh for 15004@debbugs.gnu.org; Wed, 21 Sep 2022 08:33:08 -0400 Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-127d10b4f19so8774251fac.9 for <15004@debbugs.gnu.org>; Wed, 21 Sep 2022 05:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date; bh=2bvKS7BCXSKxCTPS3LBeBo6kPotx5ExqWzA2zjgJqxQ=; b=FaMZK8G/ZGIDsBUHTow0TKY9ME+D9Y0xRN1gpH8wyoGuzx27CJwgg82cTqgud+Zp0y a7VxC9mr82aCB3YqebFXG/qIctR9G4xz3sx31JyKcQm7BCLdAKqqZy0OFNMhFEYOi3uk WhVgb1H1kdOq/Be0UYWlvP84YmpWom1hoG05gW+tHLLPrqXOT8btiabF2V7/3/vSGaab h6oXoXchixdu7Fl1RM9/Ok97bZhNP+GBzZzkIQP7/Ula4W2U8L2aLISmUhj9YI55g/+0 EXXhURD02u1Ny5U3yuTRBYCG1AwtALDTtW7ULmD1yT1lTO6Mhw3YM52q0kzNuFPqnH7v +KzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=2bvKS7BCXSKxCTPS3LBeBo6kPotx5ExqWzA2zjgJqxQ=; b=JMxlTFYp1Z5HU6cFpGyqcZm0cY0VpzwgaC/fqqiD9yJdPYDVk+vLbWYbONxNlBuhuO 1gCLEzjge8sBciebEweZG5Fry19I7WKaVDQu/u7M2VLIw7FHyn/ESYVDoDKiySuRW5HL Tlb4SQQi9XPQO/Ik7jq1IiyAsqVuLMC01Tp123qyzH/11FkayfnXxPEJZUjguuEGVPCu 7E45gHJ29fBrw3KsxaPOJ2WFgDBrHW40XclyhRYYguy9nelKsUwfO+j7WmeCL6KWbksy OM96x2SQdOa6ILcQGJMExiXSSuq7XAFoJwoZec1lM+Tvx4CUeeL2HGfV6de4MCLh63un w6+g== X-Gm-Message-State: ACrzQf10b/AzJAlilpR5EnxrjtSG5Z5hh9ZoJuSYI8ZA0dWH4w5LUgEa Sq3ruBSSdshnGpQ0+80YxbOJhMbG7yEPiU6X X-Google-Smtp-Source: AMsMyM7RaQ0WglD8tEFXpomeweS8qmEo29o+ilB/j8gO23j9bPzSATWwVe60QccQkHls1KUqbF0n1Q== X-Received: by 2002:a05:6870:b693:b0:12d:5e21:9f47 with SMTP id cy19-20020a056870b69300b0012d5e219f47mr3953531oab.45.1663763577532; Wed, 21 Sep 2022 05:32:57 -0700 (PDT) Received: from [192.168.0.234] ([181.228.28.240]) by smtp.gmail.com with ESMTPSA id 5-20020aca0505000000b00344eb5a9416sm1126131oif.55.2022.09.21.05.32.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Sep 2022 05:32:56 -0700 (PDT) Message-ID: Date: Wed, 21 Sep 2022 09:32:53 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: 15004@debbugs.gnu.org From: Mauro Aranda Subject: Re: bug#15004: 24.3; fill-paragraph on perl-mode indented comment at start of buffer Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 15004 Cc: Kevin Ryde 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 (-) Kevin Ryde writes: > Starting from emacs -Q, > >  (progn >    (switch-to-buffer "xx") >    (erase-buffer) >    (insert " # aa aa\n") >    (insert " # bb bb\n") >    (insert " # cc cc\n") >    (insert " # dd dd\n") >    (goto-char (point-min)) >    (perl-mode) >    (fill-paragraph nil)) > > gives > >  # aa aa >  # bb bb cc cc dd dd > > whereas I hoped the fill-paragraph would include the first line too, > >  # aa aa bb bb cc cc dd dd I can reproduce this on current master. > The problem is only if the lines are at the start of the buffer. Indeed, but that seems to be out of sheer luck: somehow the narrowing goes from the newline previous to the start of comment when the lines are not at the start of the buffer. > I couldn't tell where it might go wrong except that it might be related > to perl-mode using comment-start-skip "\\(^\\|\\s-\\);?#+ *" which has a > \\(\\) group to demand preceding whitespace if not at start of line. > If you change it to > >   (set (make-local-variable 'comment-start-skip) ";?#+[ \t]*") > > then the fill correctly includes the first line. > I don't know why comment-start-skip is set this way in perl-mode.  It tries to do something more than just match the start of a comment and skip to the body, and that confuses me. Maybe it can be simplified to just "#+[ \t]*".  Light testing shows no problem with doing that.  In fact, by no demanding preceding whitespace, the following works as expected: sub foo {     $bar = shift;#Just testing. } With point anywhere inside the function, C-M-q moves the comment to comment-column.