From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: (define-key MAP [remap COMMAND] PREFIX-KEY-MAP) Date: Fri, 27 Sep 2019 14:20:13 -0700 (PDT) Message-ID: <50d90eb8-10e2-4151-a1db-2eb66c5f92ff@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="151933"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 27 23:21:36 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iDxgF-000dNj-En for ged-emacs-devel@m.gmane.org; Fri, 27 Sep 2019 23:21:35 +0200 Original-Received: from localhost ([::1]:57606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDxgD-0006S0-Nt for ged-emacs-devel@m.gmane.org; Fri, 27 Sep 2019 17:21:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59228) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDxf7-0006Rm-Gl for emacs-devel@gnu.org; Fri, 27 Sep 2019 17:20:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDxf5-0007iW-MA for emacs-devel@gnu.org; Fri, 27 Sep 2019 17:20:24 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:50760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iDxf5-0007dV-C2 for emacs-devel@gnu.org; Fri, 27 Sep 2019 17:20:23 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8RLJ1cu134446 for ; Fri, 27 Sep 2019 21:20:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=AP3ZklYFASQMLgEt1gfUqNZ4TyWVCUw4hTGt70a0k2U=; b=glEmmEh25yZuCD5uhn3WXg8IrynSm5KIbd9nKDtaB9h1gGAWFiTpFNLAg81FGQOFrJg8 XO/eCNNQjGphUJvweilBMY4Cdsmlk3wiS1cZn+hYAv2AQT3NclBA/Lh4bG2v1szxXIUS 0zMN2wEjsP32l9fdxXAAAU5E+O56/H8EMDuuKSUb2KHgtecMXxgSimLue/vjSZZplOBt KG9YJ9ubfJ6Dk026qgCEWc1p2wheZNu/rWqMQwb2vHCYk3keIgkroGb4/oqgl3N1gVy9 srbZwOvE1OU0aP5/QZu0nKav7EmqsI2E6sgZ1yH1dlznCsn/858L0E8gPriZDTACBg4l Tg== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2v5btqmjue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Sep 2019 21:20:16 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8RLJPVo165160 for ; Fri, 27 Sep 2019 21:20:15 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 2v8yk0xxuu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Sep 2019 21:20:15 +0000 Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x8RLKE63023914 for ; Fri, 27 Sep 2019 21:20:14 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4900.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9393 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=769 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909270179 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9393 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=851 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909270179 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240347 Archived-At: (defvar my-map nil "...") (define-prefix-command 'my-map) (define-key my-map (kbd "a") 'forward-char) (define-key my-map (kbd "b") 'backward-char) This is OK: (define-key global-map (kbd "C-n") 'my-map) These are not OK: 1. (define-key global-map [remap next-line] my-map)=20 2. (define-key global-map [remap next-line] 'my-map) Using `C-n' (normally bound to `next-line') raises an error saying that the keymap (for #1) or the keymap variable (for #2) is not a command (`commandp'). Apparently the handling of pseudo function-key `remap' doesn't cover this case. Shouldn't it be able to? Same thing if you use, say, one of these instead of `define-prefix-command': (fset 'my-map my-map) (fset 'my-map 'my-map) Apparently the problem isn't the definition of the keymap for the prefix key. And it isn't because `define-key' can't handle a `symbol-function' value that's a keymap or a symbol whose `symbol-value' is a keymap (it can). The problem seems to be only with the way the [remap COMMAND] is handled by `define-key' (and by `global-set-key' etc.). Is it feasible to have this case handled too?