From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A8F96431FAE for ; Wed, 25 Jan 2012 23:19:48 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P0qCTOVcaPmT for ; Wed, 25 Jan 2012 23:19:48 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 50E64431FB6 for ; Wed, 25 Jan 2012 23:19:47 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so226448wgb.2 for ; Wed, 25 Jan 2012 23:19:45 -0800 (PST) Received: by 10.180.95.1 with SMTP id dg1mr1365190wib.21.1327562385142; Wed, 25 Jan 2012 23:19:45 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id fv6sm9579699wib.8.2012.01.25.23.19.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jan 2012 23:19:43 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 83AF49FE6A; Thu, 26 Jan 2012 07:19:41 +0000 (GMT) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH 1/4 v3] test: `visible-buffer-substring' should not return text properties. Date: Thu, 26 Jan 2012 07:19:37 +0000 Message-Id: <1327562380-12894-2-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327562380-12894-1-git-send-email-dme@dme.org> References: <1327503908-17226-1-git-send-email-dme@dme.org> <1327562380-12894-1-git-send-email-dme@dme.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 07:19:49 -0000 When using `visible-buffer-substring' to examine a buffer, the text properties are not useful, so don't include them. --- test/test-lib.el | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test-lib.el b/test/test-lib.el index bc75f06..5b32e0a 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -51,16 +51,19 @@ FILENAME is OUTPUT." (with-temp-file (or filename "OUTPUT") (insert text)))) (defun visible-buffer-string () - "Same as `buffer-string', but excludes invisible text." + "Same as `buffer-string', but excludes invisible text and +removes any text properties." (visible-buffer-substring (point-min) (point-max))) (defun visible-buffer-substring (start end) - "Same as `buffer-substring', but excludes invisible text." + "Same as `buffer-substring-no-properties', but excludes +invisible text." (let (str) (while (< start end) (let ((next-pos (next-char-property-change start end))) (when (not (invisible-p start)) - (setq str (concat str (buffer-substring start next-pos)))) + (setq str (concat str (buffer-substring-no-properties + start next-pos)))) (setq start next-pos))) str)) -- 1.7.8.3