From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul W. Rankin Newsgroups: gmane.emacs.devel Subject: Use of where-is-internal Date: Sat, 1 Feb 2020 16:53:58 +1000 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="62812"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 01 07:54:56 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ixmgB-000GBA-Ec for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Feb 2020 07:54:55 +0100 Original-Received: from localhost ([::1]:36318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixmgA-0008RY-Cm for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Feb 2020 01:54:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44731) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixmfQ-00080L-T1 for emacs-devel@gnu.org; Sat, 01 Feb 2020 01:54:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixmfP-00012J-MB for emacs-devel@gnu.org; Sat, 01 Feb 2020 01:54:08 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:55029) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ixmfP-00010M-4W for emacs-devel@gnu.org; Sat, 01 Feb 2020 01:54:07 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 8C236610 for ; Sat, 1 Feb 2020 01:54:04 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 01 Feb 2020 01:54:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=from:content-type:content-transfer-encoding:mime-version :subject:message-id:date:to; s=fm1; bh=xnEzYq6qlwffqqjH8DjlR/4zy 6AIzWb62sLnUSQaqfA=; b=RCm8otNfPb5WL+4bBvV0GmefrR5WhrWkgsj1DiNfj Bm2PdN4HXQmA7N241ZItpNCpBvn6Y+l0kfsJ9CGpr79LBlkMYUykhce4B1OxXa2l sIyZHpzh2732dvIi3kak2eCF+wBp685uEQjpra4B4huh8r1ZfFP0EmM1syphn1Hb UjABVgtGbYjEbMMzqR2ffo9W6kgSG/JhB2BWmztOoXw6TmNZNITjN0/Zr0a3+yOV 757mANzb2tIgPy0H/c5ALg3STSrS57dguSsn8qUrXsjBH3ZQUtwxtcWmw3gNTQJo gz0Jov6ollnCSSob2kVh6jLUPnFExwgQbvnMjRHk3kJrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=xnEzYq 6qlwffqqjH8DjlR/4zy6AIzWb62sLnUSQaqfA=; b=PYMYXD4/KG6zs7CrrRz04C 8drLvvneoZIY+CWYyCKTeCrLVBRM3EEbpikH79na62Pl7rUJ4I5fTHsMMSSc7hpD eezPGjii1ogIgUJLruXECLoe9HhrlN92vycY5ctmJwjNcUUjX2IbgE3YLGkpXkep LGGpuRejfKj9s0354D6Ebk1qmi44U060KP/C+4Lat0HM4kYio3DYzdP+5493Mt7i NskLkMOon8VInC/0aIdTWZNp0cy8r38kPlnD2/v2T2HPq+zYetFQ+lGVECRFsKeO 3aBxNwm33cpHTY9WQXVvV3wj4Eq87Y/fl8BcDgMuJtLvoDBCHwk9wcoKUvx1VuQQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrgedugdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephfgtgfgguffkfffvofesthejmhdthh dtvdenucfhrhhomheprfgruhhlucghrdcutfgrnhhkihhnuceohhgvlhhlohesphgruhhl fihrrghnkhhinhdrtghomheqnecuffhomhgrihhnpehprghulhifrhgrnhhkihhnrdgtoh hmnecukfhppeduvddtrddvvddrudeihedrudelgeenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehhvghllhhosehprghulhifrhgrnhhkihhnrd gtohhm X-ME-Proxy: Original-Received: from [172.20.10.3] (unknown [120.22.165.194]) by mail.messagingengine.com (Postfix) with ESMTPA id CA4E93280062 for ; Sat, 1 Feb 2020 01:54:02 -0500 (EST) X-Mailer: Apple Mail (2.3608.60.0.2.5) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.19 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244803 Archived-At: I'm considering of using where-is-internal in a program outside of the help library. I've used the following in my init for a while to cycle windows and so far the world has persisted unscathed: (defun other-window-and-beyond (count &optional all-frames) "Select another window in cyclic ordering of windows. Successive pressing `o' calls `other-window'." (interactive "p") (let ((key-vector (where-is-internal this-command overriding-local-map t))) (set-transient-map (let ((map (make-sparse-keymap))) (define-key map (vector (aref key-vector (1- (length key-vector)))) 'other-window) map) t) (other-window count all-frames))) This function allows me to type C-x o o o o to cycle through all windows with the idea being to allow the command to work with any key binding rather than hardcoding anything. I maintain a minor mode called olivetti that also uses a transient key map to allow changing a buffer-local variable with C-c { { { ... The key binding is currently hardcoded within the transient key map but I'd like to allow user customisation. So, should I throw caution to the wind and reimplement the transient key map in olivetti using where-is-internal despite it being clearly marked as internal, or is there a better way? Thanks, -- Paul W. Rankin https://www.paulwrankin.com