1 line
1.6 KiB
Plaintext
1 line
1.6 KiB
Plaintext
<!-- SC_OFF --><div class="md"><p>I wrote a <code>post-command-hook</code> that displays a small calendar whenever the point is on a date.</p> <p>I generate the calendar by invoking <code>calendar-generate-month</code> in a temp buffer, and I'd like to show that in the echo area.</p> <p>The code I'm using is:</p> <pre><code>(with-temp-buffer (calendar-generate-month (car date) (nth 2 date) 6) (message "%s" (buffer-string)))) </code></pre> <p>It works fine <strong>except</strong> for colors.</p> <p>I see a nicely tabulated calendar in the echo/minibuffer area (while the point is on top of a date in the format I like...) but without colors. And colors are what make today stand out in the calendar, so the visual immediacy is lost.</p> <p>If I <code>insert</code> into a buffer the string I extract from the temporary buffer, I see that string displayed nicely with colors, so I know that the properties are preserved.</p> <p>If I <code>print</code> that string, I see all its properties represented textually, which offers additional confirmation I didn't lose them.</p> <p>I read on stackoverflow that function <code>message</code> supports faces but not <code>font-lock-faces</code>, but I haven't found out how to convert the second into the first.</p> <p>Help?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/cazzipropri"> /u/cazzipropri </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/q6w9se/cant_show_propertized_text_in_the_echo_area/">[link]</a></span>   <span><a href="https://www.reddit.com/r/emacs/comments/q6w9se/cant_show_propertized_text_in_the_echo_area/">[comments]</a></span> |