Once upon a time I was surprised to see buffer-file-name
sometimes return propertized text like #("/tmp/foo" 1 4 (face flx-highlight-face))
instead of "/tmp/foo"
.
I got in the habit of defensively "cleansing" when I need the filename as a simple string, e.g.:
(and (buffer-file-name)
(substring-no-properties (buffer-file-name)))
Thinking about this more recently, the flx-highlight-face
suggests this might (?) be a little bug in flx-ido-mode
-- maybe it ought to strip the properties?
One tiny question is, should I report this as a bug? I think I can self-answer: Yes; worst case they can explain why I'm wrong. :)
My real question is: How broadly do I need to keep this in mind? Is buffer-file-name
just one of many Emacs functions like this? Every time I think "string", should I slap myself and say hey, never assume an Emacs Lisp string is "simple", it could always have properties?
flx
affectbuffer-file-name
? Don't see anything to suggest it'd do that.ido-find-file
andflx-ido-mode
.