From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Romain Francoise Newsgroups: gmane.emacs.devel Subject: Re: follow-link not on mouse-face Date: Sun, 23 Oct 2005 12:19:42 +0200 Organization: orebokech dot com Message-ID: <87wtk4sfgh.fsf@pacem.orebokech.com> References: <87ll0n11ey.fsf@jurta.org> <87pspzm0ou.fsf@pacem.orebokech.com> <87zmp2q1pl.fsf@jurta.org> <87br1hwxyd.fsf@pacem.orebokech.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1130067056 1876 80.91.229.2 (23 Oct 2005 11:30:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Oct 2005 11:30:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 23 13:30:48 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ETe2z-0002Gd-2S for ged-emacs-devel@m.gmane.org; Sun, 23 Oct 2005 13:29:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ETe2w-00073F-Ua for ged-emacs-devel@m.gmane.org; Sun, 23 Oct 2005 07:29:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ETcxq-0001io-Da for emacs-devel@gnu.org; Sun, 23 Oct 2005 06:20:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ETcxK-0001G3-6e for emacs-devel@gnu.org; Sun, 23 Oct 2005 06:20:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ETcws-0000zx-Pa for emacs-devel@gnu.org; Sun, 23 Oct 2005 06:19:32 -0400 Original-Received: from [82.67.41.165] (helo=yeast.orebokech.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ETcwi-00085S-ME; Sun, 23 Oct 2005 06:19:21 -0400 Original-Received: from pacem.orebokech.com (pacem.orebokech.com [192.168.1.3]) by yeast.orebokech.com (Postfix) with ESMTP id D844C1321C; Sun, 23 Oct 2005 12:19:17 +0200 (CEST) Original-Received: by pacem.orebokech.com (Postfix, from userid 1000) id 4DD67523C0; Sun, 23 Oct 2005 12:19:42 +0200 (CEST) Original-To: rms@gnu.org X-Face: }9mYu,e_@+e!`Z-P5kVXa3\_b:hdJ"B)ww[&=b<2=awG:GOIM (Richard M. Stallman's message of "Sun, 23 Oct 2005 00:42:31 -0400") 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:44610 Archived-At: "Richard M. Stallman" writes: > The change you described about context lines does not solve the > problem, as I understand the problem. I thought the problem was about > the line numbers on match lines. It's the same problem, line numbers and context lines are both zones without mouse-face=highlight where a mouse-1 click will have an action. The current CVS code does this: +--------------------+--------------------+--------------------+ | Line part | | | | | Line number | Match data | | Line type | | | +--------------------+--------------------+--------------------+ | | highlight: N | highlight: N | | Context line | mouse-1: Y | mouse-1: Y | | | mouse-2: Y | mouse-2: Y | +--------------------+--------------------+--------------------+ | | highlight: N | highlight: Y | | Match line | mouse-1: Y | mouse-1: Y | | | mouse-2: Y | mouse-2: Y | +--------------------+--------------------+--------------------+ I see why you would want to treat the line number margin separately from context lines. How about adding a mouse-face=highlight property on line numbers associated with match lines as well? This way the whole match line highlights and reacts to clicks, and context lines (including the line number margin) have no special properties. When there's no context, all lines in the Occur buffer are links, and you can set point with a long mouse-1 click, as with all links. It seems natural. This patch implements the following scheme: +--------------------+--------------------+--------------------+ | Line part | | | | | Line number | Match data | | Line type | | | +--------------------+--------------------+--------------------+ | | highlight: N | highlight: N | | Context line | mouse-1: N | mouse-1: N | | | mouse-2: N | mouse-2: N | +--------------------+--------------------+--------------------+ | | highlight: Y | highlight: Y | | Match line | mouse-1: Y | mouse-1: Y | | | mouse-2: Y | mouse-2: Y | +--------------------+--------------------+--------------------+ Index: lisp/replace.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/replace.el,v retrieving revision 1.225 diff -c -r1.225 replace.el *** lisp/replace.el 20 Oct 2005 16:53:10 -0000 1.225 --- lisp/replace.el 23 Oct 2005 09:58:57 -0000 *************** *** 1129,1139 **** (append (when prefix-face `(font-lock-face prefix-face)) ! '(occur-prefix t))) ;; We don't put `mouse-face' on the newline, ;; because that loses. And don't put it ;; on context lines to reduce flicker. ! (propertize curstring 'mouse-face 'highlight) "\n")) (data (if (= nlines 0) --- 1129,1145 ---- (append (when prefix-face `(font-lock-face prefix-face)) ! `(occur-prefix t mouse-face highlight ! occur-target ,marker follow-link t ! help-echo "mouse-2: go to this occurrence"))) ;; We don't put `mouse-face' on the newline, ;; because that loses. And don't put it ;; on context lines to reduce flicker. ! (propertize curstring 'mouse-face 'highlight ! 'occur-target marker ! 'follow-link t ! 'help-echo ! "mouse-2: go to this occurrence") "\n")) (data (if (= nlines 0) *************** *** 1154,1164 **** (let ((beg (point)) (end (progn (insert data) (point)))) (unless (= nlines 0) ! (insert "-------\n")) ! (add-text-properties ! beg end ! `(occur-target ,marker follow-link t ! help-echo "mouse-2: go to this occurrence"))))) (goto-char endpt)) (if endpt (progn --- 1160,1166 ---- (let ((beg (point)) (end (progn (insert data) (point)))) (unless (= nlines 0) ! (insert "-------\n"))))) (goto-char endpt)) (if endpt (progn -- Romain Francoise | I just thought I'd go out it's a miracle -- http://orebokech.com/ | with a little bit more style.