From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.devel Subject: Re: no good way to highlight rectangle while region is highlighted Date: Mon, 23 Jul 2007 08:46:31 +0100 Message-ID: <863azfftpk.fsf@macs.hw.ac.uk> References: <86bqe5fmf1.fsf@macs.hw.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1185176863 1623 80.91.229.12 (23 Jul 2007 07:47:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2007 07:47:43 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 23 09:47:42 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ICsdo-0008Qe-24 for ged-emacs-devel@m.gmane.org; Mon, 23 Jul 2007 09:47:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICsdn-00086i-Ma for ged-emacs-devel@m.gmane.org; Mon, 23 Jul 2007 03:47:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ICsdj-00086c-KQ for emacs-devel@gnu.org; Mon, 23 Jul 2007 03:47:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ICsdh-00086P-Qy for emacs-devel@gnu.org; Mon, 23 Jul 2007 03:47:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICsdh-00086M-Le for emacs-devel@gnu.org; Mon, 23 Jul 2007 03:47:33 -0400 Original-Received: from izanami.macs.hw.ac.uk ([137.195.13.6]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ICsdg-0006ei-3t; Mon, 23 Jul 2007 03:47:32 -0400 Original-Received: from lxultra1.macs.hw.ac.uk ([137.195.27.173]:58255 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1ICsdb-0001j2-Lu; Mon, 23 Jul 2007 08:47:27 +0100 Original-Received: (nullmailer pid 32720 invoked by uid 1001); Mon, 23 Jul 2007 07:46:31 -0000 In-Reply-To: (Richard Stallman's message of "Mon, 23 Jul 2007 00:28:52 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:75363 Archived-At: Richard Stallman writes: > Summary of this message: This is a feature request for (1) the > possibility that some overlays can have priority over the use of the > region face, and/or (2) a variant of the ?box? face feature where the > vertical lines of the box take no extra space. > > (2) sounds terribly low-level. (1) is cleaner. I agree with you that it is low level. At the same time, I think it would make a far better user interface for highlighting the rectangle I think the ease of the user seeing the rectangle would be much better. This is especially important if the rectangle is to be highlighted at the same time as the region (see below for why this is desirable). I think it is worth pointing out (again) that the =E2=80=9Cbox=E2=80=9D fea= ture of faces _already_ supports having the _horizontal_ lines take no extra space. It is a bit strange that it supports this but does not support having the _vertical_ lines take no extra space. > I think (1) could be implemented with a change in face_at_buffer_position. > For instance, we could define a certain priority for the region, > so that overlays whose priority exceeds that cover the region. > It doesn't look terribly hard, but you need to think carefully > to prove that you store the value into *ENDPTR in all cases. It would be lovely to be able to do (1), because that would allow using background color to distinguish the rectangle while the region is being shown. (Note that parts of the rectangle can be outside the region, so showing it with colors at the same time as the region is a bit complicated.) > It contains some > code to make Emacs operations that normally operate on the region > switch between operating on the region and the rectangle. When > operating on the region (in transient mark mode), the region is > highlighted. When operating on the rectangle, the rectangle is > highlighted. > > If you only want to show the region OR a rectangle, > why do you need any new display features? You'd need a new > feature only to show both at once. You are correct. I am not using sense-region.el as designed (see below for why). I am only using the code from sense-region that highlights the rectangle. Using some of the code in sense-region.el, I am now showing both the region and rectangle at once. But I am currently using the stipple feature of faces for the rectangle, and as a user interface it is visually not so good. > I ran into these problems in trying to highlight the > region and rectangle simultaneously: > > Why do you want to highlight them both simultaneously? I think it is useful (and is the way Emacs has worked already for decades) to have both rectangle and region commands available at all times. In this case, because Emacs doesn't know whether you are going to use a region or rectangle command next, it is helpful to be able to show them both. I hope these comments are helpful. --=20 Joe