GNU bug report logs - #20519
face-at-point: do not compute the final list if a sole value is wanted

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Wed, 6 May 2015 21:26:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 25.1

Done: Ivan Shmakov <ivan <at> siamics.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20519 in the body.
You can then email your comments to 20519 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20519; Package emacs. (Wed, 06 May 2015 21:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivan Shmakov <ivan <at> siamics.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 06 May 2015 21:26:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: 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 part 1 (text/plain, inline)]
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… 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.

-- 
FSF associate member #7257  http://am-1.org/~ivan/      … 3013 B6A0 230E 334A
[Message part 2 (text/diff, 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."

Added tag(s) patch. Request was from Ivan Shmakov <ivan <at> siamics.net> to control <at> debbugs.gnu.org. (Thu, 07 May 2015 07:11:04 GMT) Full text and rfc822 format available.

Reply sent to Ivan Shmakov <ivan <at> siamics.net>:
You have taken responsibility. (Wed, 27 May 2015 22:31:03 GMT) Full text and rfc822 format available.

Notification sent to Ivan Shmakov <ivan <at> siamics.net>:
bug acknowledged by developer. (Wed, 27 May 2015 22:31:05 GMT) Full text and rfc822 format available.

Message #12 received at 20519-done <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: 20519-done <at> debbugs.gnu.org
Subject: Re: bug#20519: face-at-point: do not compute the final list if a sole
 value is wanted 
Date: Wed, 27 May 2015 22:30:48 +0000
Version: 25.1

>>>>> Ivan Shmakov <ivan <at> siamics.net> writes:

 > 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… 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.

	Pushed, as there were no objections; closing.

commit 550c65011c7394e8ebcf91fc29af2984908279d1
Date: 2015-05-27 22:15:27 +0000

    Avoid gratuitous delete-dups in face-at-point.

    * lisp/faces.el (face-at-point): Do not compute the properly
    ordered, duplicate-free list if only a single value is
    requested anyway.  (Bug#20519)

-- 
FSF associate member #7257  http://am-1.org/~ivan/      … 3013 B6A0 230E 334A




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Jun 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.