all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Feng Shu" <tumashu@163.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: posn-at-point get strange info when flycheck enable and (setq truncate-lines t)
Date: Wed, 17 Jan 2018 19:11:44 +0800	[thread overview]
Message-ID: <873734buz3.fsf@163.com> (raw)
In-Reply-To: <87efmowz84.fsf@linux-m68k.org> (Andreas Schwab's message of "Wed, 17 Jan 2018 11:34:19 +0100")

Andreas Schwab <schwab@linux-m68k.org> writes:

> On Jan 17 2018, tumashu <tumashu@163.com> wrote:
>
>> When I enable flycheck and (setq truncate-lines t)
>> sometimes  posn-at-point get strange info like the below:
>>
>>
>>         (#<window 3 on test.el> 31 (65 . 111) 0 (! . 0) 31 (5 . 3) nil (0 . 24) (13 . 29))
>
> Strange in which way?

Sorry, it is flycheck's setting:

#+BEGIN_SRC emacs-lisp
(defcustom flycheck-indication-mode 'left-fringe
  "The indication mode for Flycheck errors and warnings.

This variable controls how Flycheck indicates errors in buffers.
May either be `left-fringe', `right-fringe', or nil.

If set to `left-fringe' or `right-fringe', indicate errors and
warnings via icons in the left and right fringe respectively.

If set to nil, do not indicate errors and warnings, but just
highlight them according to `flycheck-highlighting-mode'."
  :group 'flycheck
  :type '(choice (const :tag "Indicate in the left fringe" left-fringe)
                 (const :tag "Indicate in the right fringe" right-fringe)
                 (const :tag "Do not indicate" nil))
  :safe #'symbolp)

...
    (when flycheck-indication-mode
      (setf (overlay-get overlay 'before-string)
            (flycheck-error-level-make-fringe-icon
             level flycheck-indication-mode)))
...
#+END_SRC

flycheck will insert a picture with the help of overlay,

The problem I faced is that when I use posn-at-point to
get buffer POS's pixel position. it will get the picture's pixel position.

The two (X .Y) position is not equal, for example

  (#<window 3 on test.el> 31 (65 . 111) 0 (! . 0) 31 (5 . 3) nil (0 . 24) (13 . 29))
  (#<window 3 on test.el> 31 (65 . 87) 0 nil 31 (5 . 3) nil (0 . 0) (13 . 29))

Is it possible force get buffer POS's pixel position?




>
> Andreas.

-- 




  reply	other threads:[~2018-01-17 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  2:08 posn-at-point get strange info when flycheck enable and (setq truncate-lines t) tumashu
2018-01-17  3:42 ` Eli Zaretskii
2018-01-17 10:34 ` Andreas Schwab
2018-01-17 11:11   ` Feng Shu [this message]
2018-01-17 16:02     ` Eli Zaretskii
2018-01-17 16:45       ` Eli Zaretskii
2018-01-17 23:04       ` Feng Shu
2018-01-19 14:21         ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=873734buz3.fsf@163.com \
    --to=tumashu@163.com \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.