all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 20519@debbugs.gnu.org
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	[thread overview]
Message-ID: <87pp6djt4b.fsf@violet.siamics.net> (raw)

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

             reply	other threads:[~2015-05-06 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 21:25 Ivan Shmakov [this message]
2015-05-27 22:30 ` bug#20519: face-at-point: do not compute the final list if a sole value is wanted Ivan Shmakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp6djt4b.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=20519@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.