all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tumashu  <tumashu@163.com>
To: "Eli Zaretskii" <eliz@gnu.org>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re:Re: How to add a temporary blank line at the end of buffer safely
Date: Fri, 12 Jan 2018 09:38:40 +0800 (CST)	[thread overview]
Message-ID: <71e5c84d.1a1a.160e804dbf8.Coremail.tumashu@163.com> (raw)
In-Reply-To: <83lgh44c2g.fsf@gnu.org>

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

It works, thanks very much.


At 2018-01-12 00:03:51, "Eli Zaretskii" <eliz@gnu.org> wrote:
>> Date: Thu, 11 Jan 2018 16:45:43 +0800 (CST)
>> From: tumashu <tumashu@163.com>
>> 
>> Doesn't vertical-motion fit the bill?  If not, why not?
>> ------------------------------------------------------------------------
>> @Eli Zaretskii Thanks for your suggestion, it works very well,  the only problem is that 
>> it can not work when point at the end line of buffer, I use the below code to handle this problem, 
>> (add a temp "\n" then remove) but it seem to hacky.  any good way to solve this problem:
>
>Something like the below, perhaps?
>
>  (aref (font-info (font-at POS)) 3)
>
>This will give you the height of the font used at position POS.  Then
>you could add that to the y-coordinate of the line at EOB, to get the
>bottom y-coordinate of that line.  (Caveat: font-at doesn't like to be
>called at EOB, so make sure you are one buffer position before that.)

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

      reply	other threads:[~2018-01-12  1:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  8:45 How to add a temporary blank line at the end of buffer safely tumashu
2018-01-11 16:03 ` Eli Zaretskii
2018-01-12  1:38   ` tumashu [this message]

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=71e5c84d.1a1a.160e804dbf8.Coremail.tumashu@163.com \
    --to=tumashu@163.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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 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.