From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nisse@lysator.liu.se (Niels =?UTF-8?Q?M=C3=B6ller?=) Newsgroups: gmane.emacs.bugs Subject: bug#10916: Using occur to list occurrencies of the symbol at point Date: Thu, 01 Mar 2012 13:18:09 +0100 Message-ID: References: <87399ssiu6.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1330604367 19767 80.91.229.3 (1 Mar 2012 12:19:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Mar 2012 12:19:27 +0000 (UTC) Cc: 10916@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 01 13:19:26 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S34yi-0007b9-Ah for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Mar 2012 13:19:24 +0100 Original-Received: from localhost ([::1]:51297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S34yh-0004pY-LH for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Mar 2012 07:19:23 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S34yZ-0004nM-JE for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 07:19:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S34yT-0001yl-6W for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 07:19:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S34yT-0001yf-2w for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 07:19:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S34yM-0006je-Dn for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 07:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: nisse@lysator.liu.se (Niels =?UTF-8?Q?M=C3=B6ller?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Mar 2012 12:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10916 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10916-submit@debbugs.gnu.org id=B10916.133060434025883 (code B ref 10916); Thu, 01 Mar 2012 12:19:02 +0000 Original-Received: (at 10916) by debbugs.gnu.org; 1 Mar 2012 12:19:00 +0000 Original-Received: from localhost ([127.0.0.1]:56879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S34yJ-0006jD-2l for submit@debbugs.gnu.org; Thu, 01 Mar 2012 07:19:00 -0500 Original-Received: from mail.lysator.liu.se ([130.236.254.3]:40458) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S34xv-0006ie-4Q for 10916@debbugs.gnu.org; Thu, 01 Mar 2012 07:18:47 -0500 Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 529B840004; Thu, 1 Mar 2012 13:18:10 +0100 (CET) Original-Received: from stalhein.lysator.liu.se (stalhein.lysator.liu.se [IPv6:2001:6b0:17:f0a0::cc]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPS id 262BE40003; Thu, 1 Mar 2012 13:18:10 +0100 (CET) Original-Received: from stalhein.lysator.liu.se (localhost [127.0.0.1]) by stalhein.lysator.liu.se (8.14.4+Sun/8.14.4) with ESMTP id q21CI9Au019566; Thu, 1 Mar 2012 13:18:09 +0100 (MET) Original-Received: (from nisse@localhost) by stalhein.lysator.liu.se (8.14.4+Sun/8.14.4/Submit) id q21CI9ch019565; Thu, 1 Mar 2012 13:18:09 +0100 (MET) X-Authentication-Warning: stalhein.lysator.liu.se: nisse set sender to nisse@lysator.liu.se using -f In-Reply-To: <87399ssiu6.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 01 Mar 2012 12:42:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57416 Archived-At: Juri Linkov 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 =3D (struct gcd_ctx *) p; : MPN_COPY (ctx->gp, gp, gn); ------- : } : else : { : /* Temporary storage n */ 209: n =3D mpn_gcd_subdiv_step (up, vp, n, gcd_hook, &ctx, tp); : if (n =3D=3D 0) : goto done; : } : } ------- : small, or the difference is very small. Perform one : subtraction followed by one division. */ : : /* Temporary storage n */ 253: n =3D mpn_gcd_subdiv_step (up, vp, n, &gcd_hook, &ctx, tp); : if (n =3D=3D 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 --=20 Niels M=F6ller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance.