如何测试文本行是否大于窗口高度 [英] How to test whether lines of text are greater than the window height

查看:127
本文介绍了如何测试文本行是否大于窗口高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试一下,无文件访问缓冲区中的文本行是否大于窗口高度 - 如果不是,那么

 (set-window-scroll-bars(get-buffer-window* Org Agenda *(selected-frame))0 nil)


解决方案

您可以通过以下方式进行测试:



<$ p $ ($)
(window-height))


I'd like to test, please, whether the lines of text in a no-file visiting buffer are greater than the window height -- if not, then

(set-window-scroll-bars (get-buffer-window "*Org Agenda*" (selected-frame)) 0 nil)

解决方案

You can test with this:

(> (count-lines (point-min)
                (point-max))
   (window-height))

这篇关于如何测试文本行是否大于窗口高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆