emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#20519: closed (face-at-point: do not compute the f


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#20519: closed (face-at-point: do not compute the final list if a sole value is wanted )
Date: Wed, 27 May 2015 22:31:03 +0000

Your message dated Wed, 27 May 2015 22:30:48 +0000
with message-id <address@hidden>
and subject line Re: bug#20519: face-at-point: do not compute the final list if 
a sole value is wanted 
has caused the debbugs.gnu.org bug report #20519,
regarding face-at-point: do not compute the final list if a sole value is 
wanted 
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
20519: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20519
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- 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 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
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
--- 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."

--- End Message ---
--- Begin Message --- 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 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Version: 25.1

>>>>> Ivan Shmakov <address@hidden> 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


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]