all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20519: face-at-point: do not compute the final list if a sole value is wanted
@ 2015-05-06 21:25 Ivan Shmakov
  2015-05-27 22:30 ` Ivan Shmakov
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Shmakov @ 2015-05-06 21:25 UTC (permalink / raw)
  To: 20519

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 500 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-27 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-06 21:25 bug#20519: face-at-point: do not compute the final list if a sole value is wanted Ivan Shmakov
2015-05-27 22:30 ` Ivan Shmakov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.