From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: on-screen Date: Wed, 21 Oct 2015 21:04:10 +0200 Message-ID: <87vba0avrp.fsf@web.de> References: <87k2qgcfm7.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445454311 30199 80.91.229.3 (21 Oct 2015 19:05:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Oct 2015 19:05:11 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 21 21:05:02 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zoygy-0005Uh-FN for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 21:04:56 +0200 Original-Received: from localhost ([::1]:53595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zoygs-00080A-Tw for ged-emacs-devel@m.gmane.org; Wed, 21 Oct 2015 15:04:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoygM-0007xa-5M for emacs-devel@gnu.org; Wed, 21 Oct 2015 15:04:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoygH-0003YF-6M for emacs-devel@gnu.org; Wed, 21 Oct 2015 15:04:18 -0400 Original-Received: from mout.web.de ([212.227.17.12]:56151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoygG-0003Y8-V0 for emacs-devel@gnu.org; Wed, 21 Oct 2015 15:04:13 -0400 Original-Received: from drachen.dragon ([90.186.2.175]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MEEa4-1ZmlkZ2pxo-00FPb6; Wed, 21 Oct 2015 21:04:11 +0200 In-Reply-To: (John Wiegley's message of "Wed, 21 Oct 2015 11:20:53 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:DPeIg9TBaMoGSa3WU3Bv/0ffn4yL6/6y0s28laGj3clHrU7eulk WLXVe4qHT4rcFqDsP1n2BfZqdEgxDacruxnZdoAnsNHi5AI5Ls5deBn3WFTrroUPYd2bIpf ApJ4SiOdIrE8TguiWtJ1myiZi+c2tAy9YI4Vvqym9IhwXTGqIEXWfMijJIUHj2owWQzKY3U pzSFCDrNX0OSq0ASkpYGQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:E+eNGjLL8yo=:UMRbmj1tBZH6UcNFEc96kb hpA3uaqMbLLGKOLt+DE/8RWMyw/KXN0L58eH2PisgesY9v7bGvWdqWTlzJxNiZSM2rlkKOyP1 DT8yGQsS8Dg+X+9/TvLfbobka6oBi06XIvCCv8lCQauyAOlqlyrq8tn3dxUUa48kUHRAc0TbW qYHK0fAiL3DRkD/QOLsMkryJiYSSiYMdwkXVyS1lQd03wvFwppMEOWzgXr/rBphSN+b0MFjpX I4H/6fRqp+++E0RQd5Vse5WsZ50MaebgvfavDNRU21jb4+AUNq58xHkXX+o5TeCJZ1XX0XK7W UHW6TkCjFrymISFpxNxZmyurFSoOrWBI+brHsKUZgbAAhCQQ6F1xwXuwDlQGC6d/r2aaxE7pI oWy+O/TiiqUcD1Ac2aR2r4vQdGDBfV7Fevu2YO6YbeUrT16f9lHMAShGsEuSqUPfhYSJNhm4B cldsrJZWnaatWV2uE8Q87blU7w4C4wJSfbWKY8wnq3FwWHZBl6MV7W207Zvayvn/nPDhWQ6qI 9dvRD6yQy9hWmDAz58/dT6IRayLGMyDnVTKv0sEmFRMbgJhhImtp8o3QX1P6p0yrG68yX/Dv6 JHBawTT54zHWKHagme0v2MXJTenJtjdegKwMyx+UM0V/LDpSQ0aDqp2IYEFiNh4DPMPW81SUI XpVA0rLX2S7RtdQIMJcl48wkYJ1mU8eceN3F/HZkuM3cVFq/1530vam5QOd13weCNj4L88aTc p+dhTWfElV3pRNL2S0ZMZSJ5YicDeBY4cwe7VdK1Q7XzkTOEM5A4hcHBlFkifMt5WWiS/wkx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192319 Archived-At: "John Wiegley" writes: > Just two comments: That was quick! Thanks for having a look. > > (let ((method `(,on-screen-highlight-method . ,on-screen-inverse-flag))) > > Is the same as: > > (let ((method (const on-screen-highlight-method > on-screen-inverse-flag))) I guess you mean `cons' ;-) Then I agree. > The other one is a matter of affecting the global environment. In > `on-screen-initialize', you should pass `t' as a 3rd argument to > add-hook, so the hooks are only affected in buffers where on-screen > mode is active. This is a actually an intended design choice. What you suggest is not sufficient if you scroll the "other" buffer via M-next/M-prior, or scroll any buffer "with the mouse wheel" that is not current, but has the mode on. Then you still want to see the highlighting effect. Another common use case is reading news with Gnus and scrolling the article buffer with RET or Space: the summary buffer is current, but you are reading, and scrolling the article buffer, which has the mode turned on. So, to avoid unnecessary complication, I decided to install my stuff in the global hooks. If you don't have any buffer with `on-screen-mode' turned on visible, there is no performance loss this way, so I decided that's acceptable. Thanks, Michael.