unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: John Paul Wallington <jpw@shootybangbang.com>
Cc: emacs-devel@gnu.org
Subject: Re: A few questions about occur-mode
Date: Mon, 23 Sep 2002 21:53:52 +0100	[thread overview]
Message-ID: <877khcbf6n.fsf@bundalo.shootybangbang.com> (raw)
In-Reply-To: <20020923134527.5C5E.LEKTU@terra.es> (Juanma Barranquero's message of "Mon, 23 Sep 2002 13:50:24 +0200")

Juanma Barranquero <lektu@terra.es> wrote:

> because otherwise there could be problems with matches at the end of a
> line. This leaves the point at the beginning of a match after M-n or M-p,
> but that seems preferable IMHO.
>
> Opinions?

If we put `occur-point' properties in `occur-engine' output because
of compatibility maybe they should go at the end of each match for
the same reason?   We could acomplish that by sticking a space on the
end of each line's string before propertizing it:

Index: replace.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/replace.el,v
retrieving revision 1.159
diff -u -r1.159 replace.el
*** replace.el	18 Sep 2002 16:03:58 -0000	1.159
--- replace.el	23 Sep 2002 20:46:42 -0000
***************
*** 804,811 ****
  		    (setq lines (+ lines (1- (count-lines origpt endpt))))
  		    (setq marker (make-marker))
  		    (set-marker marker matchbeg)
! 		    (setq curstring (buffer-substring begpt
! 						      (line-end-position)))
  		    ;; Depropertize the string, and maybe
  		    ;; highlight the matches
  		    (let ((len (length curstring))
--- 804,813 ----
  		    (setq lines (+ lines (1- (count-lines origpt endpt))))
  		    (setq marker (make-marker))
  		    (set-marker marker matchbeg)
! 		    (setq curstring (concat
! 				     (buffer-substring begpt
! 						       (line-end-position))
! 				     " "))
  		    ;; Depropertize the string, and maybe
  		    ;; highlight the matches
  		    (let ((len (length curstring))
***************
*** 821,826 ****
--- 823,834 ----
  					      (when match-face
  						`(font-lock-face ,match-face)))
  					     curstring)
+ 			;; `occur-point' property is used by occur-next and
+ 			;; occur-prev to move between matches.
+ 			(put-text-property (match-end 0)
+ 					   (1+ (match-end 0))
+ 					   'occur-point t 
+ 					   curstring)
  			(setq start (match-end 0))))
  		    ;; Generate the string to insert for this match
  		    (let* ((out-line

-- 
John Paul Wallington

  reply	other threads:[~2002-09-23 20:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-20 11:44 A few questions about occur-mode Juanma Barranquero
2002-09-21 19:39 ` Richard Stallman
2002-09-22 17:32   ` Juanma Barranquero
2002-09-22 23:45     ` John Paul Wallington
2002-09-23 11:04       ` Juanma Barranquero
2002-09-23 11:50         ` Juanma Barranquero
2002-09-23 20:53           ` John Paul Wallington [this message]
2002-09-24  8:55             ` Juanma Barranquero
2002-09-23 15:59       ` Richard Stallman
2002-09-24  8:43         ` Juanma Barranquero
2002-09-24 10:22           ` Juanma Barranquero
2002-09-24 23:33             ` Richard Stallman
2002-09-24 23:33           ` Richard Stallman
2002-09-23  0:16     ` Richard Stallman

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=877khcbf6n.fsf@bundalo.shootybangbang.com \
    --to=jpw@shootybangbang.com \
    --cc=emacs-devel@gnu.org \
    /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).