From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Bug in simple.el? Date: Fri, 16 Jan 2015 00:02:58 +0100 Message-ID: <87vbk7hckd.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421363091 25327 80.91.229.3 (15 Jan 2015 23:04:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2015 23:04:51 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 16 00:04:47 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YBtT4-00073G-2b for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Jan 2015 00:04:46 +0100 Original-Received: from localhost ([::1]:53239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBtT3-0007iC-DP for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Jan 2015 18:04:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBtSp-0007hG-UQ for help-gnu-emacs@gnu.org; Thu, 15 Jan 2015 18:04:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBtSk-0002gQ-JK for help-gnu-emacs@gnu.org; Thu, 15 Jan 2015 18:04:29 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:39886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBtSk-0002ft-Cx for help-gnu-emacs@gnu.org; Thu, 15 Jan 2015 18:04:26 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 3BADB47F2B for ; Fri, 16 Jan 2015 00:04:24 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vx2SRhwEBHi4 for ; Fri, 16 Jan 2015 00:04:24 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 954D047F2A for ; Fri, 16 Jan 2015 00:03:40 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102107 Archived-At: Hello there, either there is a bug in simple.el (the `newline' function), or I don't understand something. Here's an excerpt: (let* ((was-page-start (and (bolp) (looking-at page-delimiter))) ;; (some code cut from here) ;; If the newline leaves the previous line blank, and we ;; have a left margin, delete that from the blank line. (save-excursion (goto-char beforepos) (beginning-of-line) (and (looking-at "[ \t]$") (> (current-left-margin) 0) (delete-region (point) (line-end-position)))) (BTW: page-delimiter is by default "^^L", i.e. caret and C-l, so the (and (bolp) ...) seems to be spurious.) But my real problem with the above code is the (looking-at "[ \t]$") part. Shouldn't the regex be "[ \t]+$"? Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University