[Top][All Lists]

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

bug#10916: Using occur to list occurrencies of the symbol at point

From: Niels Möller
Subject: bug#10916: Using occur to list occurrencies of the symbol at point
Date: Thu, 01 Mar 2012 13:18:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v)

Juri Linkov <address@hidden> 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.


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

reply via email to

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