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

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

Here's some more debug ..

If you eval the below (completely override eldoc-minibuffer-message for
debug purpose):

(defun eldoc-minibuffer-message (format-string &rest args)
  "Display messages in the mode-line when in the minibuffer.
Otherwise work like `message'."
  (setq args '(#("0123456789" 0 5 (face font-lock-keyword-face))))
  (let ((message-log-max 1000))
    (message "debug: format-string = %S" format-string)
    (message "debug: args = %S" args))
  (unless (minibufferp)
    (apply 'message format-string args)))

Then while in emacs-lisp-mode, with cursor after any keyword like defun or
setq or anything will show "0123456789" in the echo area. BUT the whole
face will be font-lock-keyword-face instead of just the first five chars.
Image: http://i.imgur.com/1tsp1rt.png

Here's the outcome of the same eldoc-minibuffer-message hack in emacs-25
build
http://i.imgur.com/1TfRxpx.png

This time, the first 5 chars only have the font-lock-keyword-face as
expected.


Now back to the master build, when I evaluate the below:

(let ((format-string "%s")
      (args '(#("0123456789" 0 5 (face font-lock-keyword-face)))))
  (apply #'message format-string args))

I get:

#("0123456789" 0 10 (face font-lock-keyword-face))

!! Notice that the end point 5 got updated to 10 by itself !!

On emacs-25 build, evalling the same keeps the end point at 5.

====

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?

Nonetheless this difference in behavior when evaluating let form is what
made me realize that the message function returns the end pointer updated
from 5 to 10 in the master build.


-- 

-- 
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 3312 bytes --]

  reply	other threads:[~2016-07-07 22:19 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 [this message]
2016-07-08  9:25               ` Eli Zaretskii
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='CAFyQvY2q2t6exY5K69NqyF=3=NDHFDNUwCht-eurNK_VRTQXjw@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=23897@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@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 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).