GNU bug report logs - #10916
Using occur to list occurrencies of the symbol at point

Previous Next

Package: emacs;

Reported by: nisse <at> lysator.liu.se (Niels Möller)

Date: Thu, 1 Mar 2012 10:12:02 UTC

Severity: wishlist

Tags: wontfix

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 10916 <at> debbugs.gnu.org (full text, mbox):

From: nisse <at> lysator.liu.se (Niels Möller)
To: Juri Linkov <juri <at> jurta.org>
Cc: 10916 <at> debbugs.gnu.org
Subject: Re: bug#10916: Using occur to list occurrencies of the symbol at point
Date: Thu, 01 Mar 2012 13:18:09 +0100
Juri Linkov <juri <at> jurta.org> writes:

> `C-u M-x occur' doesn't interpret the prefix argument as the amount of
> additional context.  `C-u M-x occur' collects strings matching regexp.

I'm not following you. If I type C-u M-x occur RET gcd_hook RET, I get
an *Occur* buffer looking like this:

3 matches for "gcd_hook" in buffer: gcd.c
       :  mp_size_t gn;
       :};
       :
       :static void
     61:gcd_hook (void *p, mp_srcptr gp, mp_size_t gn,
       :	  mp_srcptr qp, mp_size_t qn, int d)
       :{
       :  struct gcd_ctx *ctx = (struct gcd_ctx *) p;
       :  MPN_COPY (ctx->gp, gp, gn);
-------
       :	}
       :      else
       :	{
       :	  /* Temporary storage n */
    209:	  n = mpn_gcd_subdiv_step (up, vp, n, gcd_hook, &ctx, tp);
       :	  if (n == 0)
       :	    goto done;
       :	}
       :    }
-------
       :	     small, or the difference is very small. Perform one
       :	     subtraction followed by one division. */
       :
       :	  /* Temporary storage n */
    253:	  n = mpn_gcd_subdiv_step (up, vp, n, &gcd_hook, &ctx, tp);
       :	  if (n == 0)
       :	    goto done;
       :	}
       :    }
-------

This is with emacs-23.2, but I think it's the same in other emacs
versions I have used. The documentation string for occur says

  Each line is displayed with NLINES lines before and after, or -NLINES
  before if NLINES is negative.
  NLINES defaults to `list-matching-lines-default-context-lines'.
  Interactively it is the prefix arg.

> Have you tried `M-x occur M-n RET'?

Now I have. Seems to give the symbol at point in recent emacs versions.
Slightly less convenient than a prefix argument, but I think that does
what I want.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.




This bug report was last modified 5 years and 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.