emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: follow-link not on mouse-face


From: Romain Francoise
Subject: Re: follow-link not on mouse-face
Date: Sat, 22 Oct 2005 14:14:18 +0200

Juri Linkov <address@hidden> 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 <address@hidden> | I like the streets when
it's a miracle -- http://orebokech.com/ | they're empty, I can make the
                                        | rest up.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]