unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Ryde <user42@zip.com.au>
To: 15004@debbugs.gnu.org
Subject: bug#15004: 24.3; fill-paragraph on perl-mode indented comment at start of buffer
Date: Fri, 02 Aug 2013 09:43:04 +1000	[thread overview]
Message-ID: <87wqo5vuyf.fsf@blah.blah> (raw)

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





             reply	other threads:[~2013-08-01 23:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 23:43 Kevin Ryde [this message]
2022-09-21 12:32 ` bug#15004: 24.3; fill-paragraph on perl-mode indented comment at start of buffer Mauro Aranda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqo5vuyf.fsf@blah.blah \
    --to=user42@zip.com.au \
    --cc=15004@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).