From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Justin Timmons Newsgroups: gmane.emacs.bugs Subject: bug#20694: 25.0.50; Please bind `p' and `n' in apropos-mode Date: Mon, 12 Dec 2016 21:18:11 -0500 Message-ID: <878trkh8rg.fsf@gmail.com> References: <87k2vqhpuu.wl-jch@pps.univ-paris-diderot.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1481595578 12979 195.159.176.226 (13 Dec 2016 02:19:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2016 02:19:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 20694@debbugs.gnu.org To: Juliusz Chroboczek Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 13 03:19:33 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGcgj-0001Zr-9I for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Dec 2016 03:19:29 +0100 Original-Received: from localhost ([::1]:34881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGcgl-0000SD-VS for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Dec 2016 21:19:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGcgN-0000LQ-02 for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 21:19:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGcgI-000323-2g for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 21:19:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGcgH-00031z-UG for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 21:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cGcgH-00029b-PD for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2016 21:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Justin Timmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2016 02:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20694-submit@debbugs.gnu.org id=B20694.14815955048218 (code B ref 20694); Tue, 13 Dec 2016 02:19:01 +0000 Original-Received: (at 20694) by debbugs.gnu.org; 13 Dec 2016 02:18:24 +0000 Original-Received: from localhost ([127.0.0.1]:39880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGcfg-00028U-JF for submit@debbugs.gnu.org; Mon, 12 Dec 2016 21:18:24 -0500 Original-Received: from mail-qk0-f170.google.com ([209.85.220.170]:32912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGcfe-00028F-PS for 20694@debbugs.gnu.org; Mon, 12 Dec 2016 21:18:23 -0500 Original-Received: by mail-qk0-f170.google.com with SMTP id x190so103231060qkb.0 for <20694@debbugs.gnu.org>; Mon, 12 Dec 2016 18:18:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=0OzxH25ew8nGFoOj1U0H5YUltHsqXPKkwloeMKU9Ssg=; b=PmvZB4U0ptvriVArMchm8y/GJsSGbbhKTud8Gve7OJd5FjiJAtgqD0Fl0X6BAVNTLn ryOtWPmYh12uCDmuy1yh0PW8jwjg7X3AqudipOVkQDF4EPm+GUHZBld+J5gSBmHXxcrT JmpAKsHY3p6IprDklE5uLtwbWYMf0GshRGqr/gwTbUlt7Hsts11643KinPdDCDU4x29h Ev60qKvukJnND/tmXdlD1YLs/3/GHrS+z2vUsVFuQhvuIZQ5CIW79kw30wR29UoH51Js CrG/OnjS/CbrrGzcKbUrKd0azZZOgHJG3rceqdJCQNDFlsf1nScwAYF/nYW+OZqEhg78 x9Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=0OzxH25ew8nGFoOj1U0H5YUltHsqXPKkwloeMKU9Ssg=; b=AJJUPr8HGmyyyd/a3JuzvJb9Tdq0G0Wg+5sGnf2u89HakQcqMjeWuqJOuZMjpPI1x6 fEPFQdL6ToiYKPE7sNPQAhYt3G4qG4FBClEVDUQfVGy+gKaZjjMsoZyHn8GxKhOENTor CiDrbowvBpr04MnauniJBJ31w71lH/V1DuBj8/B3vudOPgktY0tg7KXwru4Vgu/RSbUY SBkhmeAU9YI8cWM+Ygvyex2JFg4gyh+OVzEJyZQEnXQac08u89cnpQYQslXDTVl5NKgq YjdeYpG1MKC1n+rDkG7imujNcX3V+Z3+DwMj5wr17ah520ssgnN8BbkdEGaGicVY34w+ 36sw== X-Gm-Message-State: AKaTC00y4VOgUSp8JWkfXKSs8bb8DD4K8PmRhPXYST/bKWHfeB3yl0hy/dnOv5mUk0KtGw== X-Received: by 10.55.70.76 with SMTP id t73mr80277672qka.195.1481595497411; Mon, 12 Dec 2016 18:18:17 -0800 (PST) Original-Received: from restitution (c-73-186-209-171.hsd1.ma.comcast.net. [73.186.209.171]) by smtp.gmail.com with ESMTPSA id o31sm27898721qtf.20.2016.12.12.18.18.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Dec 2016 18:18:16 -0800 (PST) X-Google-Original-From: Justin Timmons In-Reply-To: <87k2vqhpuu.wl-jch@pps.univ-paris-diderot.fr> (Juliusz Chroboczek's message of "Sat, 30 May 2015 02:27:05 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:126957 Archived-At: --=-=-= Content-Type: text/plain I wrote up a quick set of functions which accomplishes this and added them to the apropos-mode keymap - see the attached patch file. The functions search forward (or backwards) for the 'apropos-symbol face; there could be a cleaner way to do this, but this seems to work pretty well. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=apropos-movement.patch Content-Description: Patch to add symbol movement to apropos-mode diff --git a/lisp/apropos.el b/lisp/apropos.el index 7c9ec12..d5a9a3a 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -160,6 +160,10 @@ If value is `verbose', the computed score is shown for each match." ;; definition of RET, so that users can use it anywhere in an ;; apropos item, not just on top of a button. (define-key map "\C-m" 'apropos-follow) + + ;; Movement keys + (define-key map "n" 'apropos-next-symbol) + (define-key map "p" 'apropos-previous-symbol) map) "Keymap used in Apropos mode.") @@ -1209,6 +1213,24 @@ as a heading." (error "There is nothing to follow here")))) +(defun apropos-next-symbol () + "Move cursor down to the next symbol in an apropos-mode buffer." + (interactive) + (forward-line) + (while (and (not (eq (face-at-point) 'apropos-symbol)) + (< (point) (point-max))) + (forward-line))) + + +(defun apropos-previous-symbol () + "Move cursor back to the last symbol in an apropos-mode buffer." + (interactive) + (forward-line -1) + (while (and (not (eq (face-at-point) 'apropos-symbol)) + (> (point) (point-min))) + (forward-line -1))) + + (defun apropos-describe-plist (symbol) "Display a pretty listing of SYMBOL's plist." (help-setup-xref (list 'apropos-describe-plist symbol) --=-=-=--