unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: 23897@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#23897: 25.1.50; Argument at point not being highlighted in eldoc hints
Date: Fri, 08 Jul 2016 12:25:19 +0300	[thread overview]
Message-ID: <83y45ciirk.fsf@gnu.org> (raw)
In-Reply-To: <CAFyQvY2q2t6exY5K69NqyF=3=NDHFDNUwCht-eurNK_VRTQXjw@mail.gmail.com> (message from Kaushal Modi on Thu, 07 Jul 2016 22:19:19 +0000)

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Thu, 07 Jul 2016 22:19:19 +0000
> Cc: 23897@debbugs.gnu.org, rudalics@gmx.at, dgutov@yandex.ru
> 
> Here's some more debug ..

Thanks.

For the future, please always try to find the simplest way to
demonstrate a problem, and preferably as close to the lowest-level
function that still exhibits it.  In particular, various fancy
constructs using 'apply', 'funcall', let alone cl-lib stuff are a
distraction that should only be present if the problem doesn't show
without them.

Specifically, in this case, the simplest way to demonstrate the
problem is this:

  (format "%s" (concat (propertize "01234" 'face 'bold) "56789"))
    => #("0123456789" 0 10 (face bold))

Clearly, the "0 10" part is not what is expected.

This has the advantage of showing that the problem is inside the
'format' primitive (you used 'message', but that just calls 'format'
and then displays the result, as you can see from its source).  Also,
propertize is a much simpler way of constructing a string with
properties than using the #("0123456789" 0 5 (face FACE)) read syntax.

> An unrelated thing, elisp related, that I don't understand is that 
> 
> - The face-formatted string shown in the minibuffer when "(apply 'message format-string args)" is called in the
> eldoc-minibuffer-message function.
> - But "#("0123456789" 0 10 (face font-lock-keyword-face))" (in master build) is shown verbatim without any
> face-formatting in the minibuffer when the above let form (which has the exact same apply form with the
> exact same message arguments) is evaluated. 
> Why is that?

The "#("0123456789" 0 10 (face font-lock-keyword-face))" stuff doesn't
have the face applied, that's why.  The face will be applied when it
is read by the Lisp reader.

(Avoiding these tricky constructs as much as possible is one way of
not getting distracted by unrelated issues.)

Thanks.





  reply	other threads:[~2016-07-08  9:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 15:25 bug#23897: 25.1.50; Argument at point not being highlighted in eldoc hints Kaushal Modi
2016-07-07 16:18 ` martin rudalics
2016-07-07 16:28   ` Clément Pit--Claudel
2016-07-07 16:57   ` Kaushal Modi
2016-07-07 17:06     ` Dmitry Gutov
2016-07-07 19:31       ` Kaushal Modi
2016-07-07 19:38         ` Kaushal Modi
2016-07-07 19:44         ` Eli Zaretskii
2016-07-07 20:31           ` Kaushal Modi
2016-07-07 22:19             ` Kaushal Modi
2016-07-08  9:25               ` Eli Zaretskii [this message]
2016-07-08 19:39                 ` Eli Zaretskii
2016-07-08 19:42                   ` Kaushal Modi
2016-07-08 19:49                     ` Eli Zaretskii
2016-07-08 20:01                       ` Kaushal Modi
2016-07-09  6:40                         ` Clément Pit--Claudel
2016-07-07 19:36       ` Clément Pit--Claudel

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83y45ciirk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23897@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=kaushal.modi@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).