From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#20519: face-at-point: do not compute the final list if a sole value is wanted Date: Wed, 06 May 2015 21:25:40 +0000 Message-ID: <87pp6djt4b.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1430947588 27043 80.91.229.3 (6 May 2015 21:26:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2015 21:26:28 +0000 (UTC) To: 20519@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 06 23:26:17 2015 Return-path: Envelope-to: geb-bug-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 1Yq6pa-0001YQ-Su for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 May 2015 23:26:15 +0200 Original-Received: from localhost ([::1]:47119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq6pZ-0002ww-81 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 May 2015 17:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq6pV-0002uD-5d for bug-gnu-emacs@gnu.org; Wed, 06 May 2015 17:26:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yq6pR-0000F2-2L for bug-gnu-emacs@gnu.org; Wed, 06 May 2015 17:26:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yq6pP-0000Em-Dt for bug-gnu-emacs@gnu.org; Wed, 06 May 2015 17:26:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Yq6pO-00006x-SL for bug-gnu-emacs@gnu.org; Wed, 06 May 2015 17:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 May 2015 21:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20519 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1430947555411 (code B ref -1); Wed, 06 May 2015 21:26:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 May 2015 21:25:55 +0000 Original-Received: from localhost ([127.0.0.1]:36598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yq6pG-00006Z-VS for submit@debbugs.gnu.org; Wed, 06 May 2015 17:25:55 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:42014) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yq6pE-00006O-D6 for submit@debbugs.gnu.org; Wed, 06 May 2015 17:25:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:Date:Sender:Subject:To:From; bh=i3P+B9iQK1nB4KidaLJIuhlBe9XtnOqXdU2jiFznbOM=; b=jQ6ZUILfRT+PjLd2Tmxv7MZ0yRZjCAYjbYZlptf3y5LsAcBeyRK+8Yb7U3iAd7l9bDbDJXkjA75vW8wU1auIkUw/spdyOg/WmZCH3cCYx07MIZitgCfMFQKpOylp+jHcJeV+o+rZSdFowJ54jJ8TCLVfQAMJCbtWjpl3DwBK/28=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Yq6pC-0005Yj-Bm for submit@debbugs.gnu.org; Wed, 06 May 2015 21:25:50 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Yq6p3-0006yl-Tk for submit@debbugs.gnu.org; Thu, 07 May 2015 04:25:42 +0700 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102553 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Package: emacs Severity: wishlist The face-at-point function currently (1c7f0cdc4c1f, 2015-04-27 16:59:11 +00:00) uses delete-dups to compute a duplicate-free version of the list=E2=80=A6 just before taking a single value of it and discarding the rest in the (not multiple) case. Please thus consider the following patch. * lisp/faces.el (face-at-point): Do not compute the properly ordered, duplicate-free list if only a single value is requested. --=20 FSF associate member #7257 http://am-1.org/~ivan/ =E2=80=A6 3013 B6A0= 230E 334A --=-=-= Content-Type: text/diff Content-Disposition: inline --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1937,8 +1937,9 @@ defun face-at-point (&optional thing multiple) (dolist (face faceprop) (if (facep face) (push face faces)))))) - (setq faces (delete-dups (nreverse faces))) - (if multiple faces (car faces)))) + (if multiple + (delete-dups (nreverse faces)) + (car (last faces))))) (defun foreground-color-at-point () "Return the foreground color of the character after point." --=-=-=--