unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Romain Francoise <romain@orebokech.com>
Subject: Re: follow-link not on mouse-face
Date: Sat, 22 Oct 2005 14:14:18 +0200	[thread overview]
Message-ID: <87br1hwxyd.fsf@pacem.orebokech.com> (raw)
In-Reply-To: 87zmp2q1pl.fsf@jurta.org

Juri Linkov <juri@jurta.org> writes:

> So I think the question is not whether to make mouse-1 to have the
> exact same effect as mouse-2, but why mouse-2 sensitive areas are
> bigger than areas with mouse-face=highlight in the *Occur* buffer.

Yes.

I think we should simply remove all special properties from the context
lines: they're just context and do not really mean anything wrt the
match itself.  When you click on a context line, point moves to the
match line in the buffer, not to the line you clicked in the Occur
buffer, which doesn't make much sense.

With the following patch, mouse actions and highlighting are put on the
match line only, which solves the problem.  Clicking mouse-1 elsewhere
just sets point.

What do you think?

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	22 Oct 2005 12:00:37 -0000
***************
*** 1133,1139 ****
  			     ;; 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)
--- 1133,1143 ----
  			     ;; 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
--- 1158,1164 ----
  			(let ((beg (point))
  			      (end (progn (insert data) (point))))
  			  (unless (= nlines 0)
! 			    (insert "-------\n")))))
  		    (goto-char endpt))
  		  (if endpt
  		      (progn

-- 
Romain Francoise <romain@orebokech.com> | I like the streets when
it's a miracle -- http://orebokech.com/ | they're empty, I can make the
                                        | rest up.

  parent reply	other threads:[~2005-10-22 12:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-21 11:59 follow-link not on mouse-face Juri Linkov
2005-10-21 13:39 ` Kim F. Storm
2005-10-21 13:47 ` Romain Francoise
2005-10-21 13:58 ` Romain Francoise
2005-10-21 16:02   ` Juri Linkov
2005-10-22  4:18     ` Richard M. Stallman
2005-10-22  5:23       ` Drew Adams
2005-10-23  4:42         ` Richard M. Stallman
2005-10-23  5:34           ` Drew Adams
2005-10-22 12:14     ` Romain Francoise [this message]
2005-10-23  4:42       ` Richard M. Stallman
2005-10-23  8:44         ` David Kastrup
2005-10-23 10:19         ` Romain Francoise
2005-10-24  1:00           ` Richard M. Stallman
2005-10-24  6:22             ` Romain Francoise
2005-10-24 23:43               ` Juri Linkov
2005-10-25  6:01                 ` Romain Francoise
2005-10-25 14:26                 ` Drew Adams
2005-10-25 15:57                   ` David Kastrup
2005-10-25 20:27                 ` Richard M. Stallman
2005-10-25 20:54                   ` Romain Francoise
2005-10-25 20:59                     ` Juri Linkov
2005-10-27  1:31                     ` Richard M. Stallman
2005-10-27 18:22                       ` Romain Francoise

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87br1hwxyd.fsf@pacem.orebokech.com \
    --to=romain@orebokech.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).