unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: nisse@lysator.liu.se (Niels Möller)
To: Juri Linkov <juri@jurta.org>
Cc: 10916@debbugs.gnu.org
Subject: bug#10916: Using occur to list occurrencies of the symbol at point
Date: Thu, 01 Mar 2012 13:18:09 +0100	[thread overview]
Message-ID: <nn62eoo6pq.fsf@stalhein.lysator.liu.se> (raw)
In-Reply-To: <87399ssiu6.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 01 Mar 2012 12:42:41 +0200")

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





  reply	other threads:[~2012-03-01 12:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 10:10 bug#10916: Using occur to list occurrencies of the symbol at point Niels Möller
2012-03-01 10:42 ` Juri Linkov
2012-03-01 12:18   ` Niels Möller [this message]
2012-03-01 12:28     ` Juri Linkov
2019-11-01 22:33       ` Stefan Kangas
2019-11-13 20:58         ` Juri Linkov
2019-12-05 11:04           ` Stefan Kangas

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=nn62eoo6pq.fsf@stalhein.lysator.liu.se \
    --to=nisse@lysator.liu.se \
    --cc=10916@debbugs.gnu.org \
    --cc=juri@jurta.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).