From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Use of where-is-internal Date: Sat, 01 Feb 2020 09:24:59 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="114471"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Paul W. Rankin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 01 15:25:36 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 1ixtiK-000TdH-0f for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Feb 2020 15:25:36 +0100 Original-Received: from localhost ([::1]:46670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixtiJ-0000qv-3N for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Feb 2020 09:25:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56267) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixthp-0000Rf-1m for emacs-devel@gnu.org; Sat, 01 Feb 2020 09:25:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixtho-0002cT-4Z for emacs-devel@gnu.org; Sat, 01 Feb 2020 09:25:04 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60781) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ixtho-0002c3-0b for emacs-devel@gnu.org; Sat, 01 Feb 2020 09:25:04 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A356C10084C; Sat, 1 Feb 2020 09:25:03 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8EF9A10080B; Sat, 1 Feb 2020 09:25:01 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1580567101; bh=u2NtH2NgUAPKVYCy3zFd+2LmvvtVEUpMloWWtDhspNM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ccaT+qRxP4DDVc9Ca70HKhvAuXg/7zNGzuwboIYgS2M9mrwYpjKq/R+b7jnA38lwm 8c727dhMtNPg/N3NKSfA3Y7DeXA4f8T1ppqIozJzdNY3p2CNUNjlE4e3eCL7fhXpbR Iz9Ns4kVwSnmz0FvpPfuSoFkEYYJ6o1I42/SynbLRWhtEQuwS5Ecfp5Mju1YjMr72k 5kuZFTOehXlB4XGQ/047oqyH3s5BzibYMMHyd6MKbgMzfHB5ROBCsBx32rN1T75JIJ 7JODWolLM4VNhSXuvV/Y3C0plAUpPviQIn/uvVdYTJxX6sAkZGdHCvGk42/pdr6sY1 PBxeewWnQVZag== Original-Received: from pastel (unknown [45.72.213.248]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 51F7C120C2D; Sat, 1 Feb 2020 09:25:01 -0500 (EST) In-Reply-To: (Paul W. Rankin's message of "Sat, 1 Feb 2020 16:53:58 +1000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:244807 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))) I have a feeling of "d=E9j=E0 vu"! The answer involved `this-single-command-keys`. Stefan