From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#15004: 24.3; fill-paragraph on perl-mode indented comment at start of buffer Date: Wed, 21 Sep 2022 09:32:53 -0300 Message-ID: References: <87wqo5vuyf.fsf@blah.blah> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: Kevin Ryde To: 15004@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 21 14:43:51 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaz4x-0001DW-5w for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Sep 2022 14:43:51 +0200 Original-Received: from localhost ([::1]:37478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaz4v-0003PC-U4 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Sep 2022 08:43:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oayvU-0004MH-6K for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2022 08:34:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oayvS-00030b-HT for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2022 08:34:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oayvS-0006HH-AI for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2022 08:34:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87wqo5vuyf.fsf@blah.blah> Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Sep 2022 12:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 15004-submit@debbugs.gnu.org id=B15004.166376359424074 (code B ref 15004); Wed, 21 Sep 2022 12:34:02 +0000 Original-Received: (at 15004) by debbugs.gnu.org; 21 Sep 2022 12:33:14 +0000 Original-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 Original-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 Original-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) Original-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) Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243326 Archived-At: 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.