all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 19912@debbugs.gnu.org
Subject: bug#19912: facemenu-add-face: does not handle 'face being set to a property list
Date: Wed, 25 Feb 2015 17:24:21 +0000	[thread overview]
Message-ID: <87a9013nwa.fsf@violet.siamics.net> (raw)
In-Reply-To: <87r3te31zj.fsf@violet.siamics.net> (Ivan Shmakov's message of "Wed, 25 Feb 2015 07:05:20 +0000")

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

	Please consider the (once again) revised patch MIMEd.

	* lisp/faces.el (face-list-p): Split from face-at-point.
	(face-at-point): Use it.
	* lisp/facemenu.el (facemenu-add-face): Likewise.  (Bug#19912)

	Unless there be objections, I hope to push this new change
	to ‘master’ within the next day or two.

-- 
FSF associate member #7257  np. Isle of Avalon — Iron Maiden … B6A0 230E 334A

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

--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -732,7 +732,7 @@ defun facemenu-add-face (face &optional start end)
                                  face
                                (facemenu-active-faces
                                 (cons face
-                                      (if (listp prev)
+                                      (if (face-list-p prev)
                                           prev
                                         (list prev)))
                                 ;; Specify the selected frame
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -273,6 +273,17 @@ defun face-nontrivial-p (face &optional frame)
   (not (internal-lisp-face-empty-p face frame)))
 
 
+(defun face-list-p (face-or-list)
+  "True if FACE-OR-LIST is a list of faces.
+Return nil if FACE-OR-LIST is a non-nil atom, or a cons cell whose car
+is either 'foreground-color, 'background-color, or a keyword."
+  ;; The logic of merge_face_ref (xfaces.c) is recreated here.
+  (and (listp face-or-list)
+       (not (memq (car face-or-list)
+		  '(foreground-color background-color)))
+       (not (keywordp (car face-or-list)))))
+
+
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Setting face attributes from X resources.
@@ -1922,11 +1933,7 @@ defun face-at-point (&optional thing multiple)
                         (get-char-property (point) 'face))))
       (cond ((facep faceprop)
              (push faceprop faces))
-            ((and (listp faceprop)
-                  ;; Don't treat an attribute spec as a list of faces.
-                  (not (keywordp (car faceprop)))
-                  (not (memq (car faceprop)
-                             '(foreground-color background-color))))
+            ((face-list-p faceprop)
              (dolist (face faceprop)
                (if (facep face)
                    (push face faces))))))

  reply	other threads:[~2015-02-25 17:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 17:15 bug#19903: 24.4; Emacs fails to save enriched buffer with error message `wrong-type-argument symbolp "bold"' Jorge
2015-02-19 18:48 ` bug#19903: 24.4; wrong-type-argument symbolp "bold" during enriched-encode Ivan Shmakov
2015-02-20  8:27 ` bug#19903: 24.4; Emacs fails to save enriched buffer with error message `wrong-type-argument symbolp "bold"' Eli Zaretskii
2015-02-20  8:51 ` Jorge
2015-02-20  9:12   ` bug#19903: 24.4; wrong-type-argument symbolp "bold" during enriched-encode Ivan Shmakov
2015-02-20 10:07     ` Eli Zaretskii
2015-02-20 17:18       ` Stefan Monnier
2015-02-20 18:56         ` Ivan Shmakov
2015-02-20 19:55           ` Stefan Monnier
2015-02-20 21:09             ` Ivan Shmakov
2015-02-21 11:12               ` Ivan Shmakov
2015-02-21 11:42                 ` Eli Zaretskii
2015-02-25  6:20                   ` Ivan Shmakov
2015-02-25 16:06                     ` Eli Zaretskii
2015-02-25 17:10                       ` Ivan Shmakov
2015-02-25 17:43                         ` Eli Zaretskii
2015-02-25 17:55                           ` Ivan Shmakov
2015-02-21 12:12         ` bug#19912: facemenu-add-face: does not handle 'face being set to a property list Ivan Shmakov
2015-02-25  7:05           ` Ivan Shmakov
2015-02-25 17:24             ` Ivan Shmakov [this message]
2015-02-26 18:12               ` Ivan Shmakov
2015-02-20 10:03   ` bug#19903: 24.4; Emacs fails to save enriched buffer with error message `wrong-type-argument symbolp "bold"' Eli Zaretskii

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=87a9013nwa.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=19912@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.