GNU bug report logs -
#19903
24.4; Emacs fails to save enriched buffer with error message `wrong-type-argument symbolp "bold"'
Previous Next
Reported by: Jorge <jorge13515 <at> gmail.com>
Date: Thu, 19 Feb 2015 17:53:01 UTC
Severity: normal
Found in version 24.4
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #40 received at 19903 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>>>>> Ivan Shmakov <ivan <at> siamics.net> writes:
>>>>> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>>> + (warn "Face %S is a string; interning" face)
>>> + (message "Face %S is a string; interning" face)
>> Why `warn' in one and `message' in the other?
> By the time we hit this in ‘face-attribute’, the point at which the
> sub-setandard string-named face was introduced is presumably long
> gone, so there’s no good reason to use ‘warn’.
… Or, on a second thought, ‘message’, either. Given that
‘face-attribute’ has no idea of where the caller got this face
from, there’s simply no way for it to provide any helpful
message at this point. (Say, “Face "bold", as found at position
42 in #<buffer foo>, is a string; interning”.)
Now, given that there’s a number of “internal” functions (such
as ‘internal-lisp-face-p’, for instance) which accept string
face names just fine, I wonder if it makes sense to just change
‘internal-get-lisp-face-attribute’ accordingly? An untested
patch is hereby MIMEd.
[…]
--
FSF associate member #7257 np. Fear of the Dark — Iron Maiden B6A0 230E 334A
[Message part 2 (text/diff, inline)]
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3570,15 +3570,18 @@ the result will be absolute, otherwise it will be relative. */)
DEFUN ("internal-get-lisp-face-attribute", Finternal_get_lisp_face_attribute,
Sinternal_get_lisp_face_attribute,
2, 3, 0,
- doc: /* Return face attribute KEYWORD of face SYMBOL.
-If SYMBOL does not name a valid Lisp face or KEYWORD isn't a valid
+ doc: /* Return face attribute KEYWORD of face FACE.
+FACE should be a symbol or string.
+If FACE does not name a valid Lisp face or KEYWORD isn't a valid
face attribute name, signal an error.
-If the optional argument FRAME is given, report on face SYMBOL in that
-frame. If FRAME is t, report on the defaults for face SYMBOL (for new
+If the optional argument FRAME is given, report on face FACE in that
+frame. If FRAME is t, report on the defaults for face FACE (for new
frames). If FRAME is omitted or nil, use the selected frame. */)
- (Lisp_Object symbol, Lisp_Object keyword, Lisp_Object frame)
+ (Lisp_Object face, Lisp_Object keyword, Lisp_Object frame)
{
struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame);
+ Lisp_Object symbol = (STRINGP (face) ? intern (SSDATA (face))
+ : face);
Lisp_Object lface = lface_from_face_name (f, symbol, true), value = Qnil;
CHECK_SYMBOL (symbol);
This bug report was last modified 10 years and 85 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.