From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#74619: macOS: displayed as keybinding for \\[customize] on emacs -nw Date: Mon, 09 Dec 2024 17:14:52 +0100 Message-ID: <87ed2gal4z.fsf@gmail.com> References: <87bjxufa7d.fsf@gmail.com> <8734j3eco2.fsf@gmail.com> <87bjxoc058.fsf@gmail.com> <86bjxolr2k.fsf@gnu.org> <877c8cbvms.fsf@gmail.com> <867c8clpbo.fsf@gnu.org> <86y10sj6cp.fsf@gnu.org> <86bjxmhfjo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23945"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yoichi Nakayama , gerd.moellmann@gmail.com, 74619@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 09 17:17:34 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tKgRx-0005we-0Q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Dec 2024 17:17:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKgRV-0006Wl-26; Mon, 09 Dec 2024 11:17:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKgRT-0006WQ-72 for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 11:17:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKgRS-00024s-SV for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 11:17:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=hElvuruua8DuH3CCHPUtBW2ii5aa78qjazhkw/iTQ7A=; b=I+SVrUvms00xsBUP1BNg/flsMFHNIxsP8JYoqSKF9LMORhA4bvdUto8nQgyMjZNe/GAQEjFe7VoUMi9Wrg36zu1QrTgDrRN/vLyPECOdZjt/hnSSxQQQ9gaWpFeHu7Vtue6vR7dCkIMRsirgDrDoevmVvdjblVeEISrbylnMNMH0l4B+2TIenMJlDXjH0pMae5/FLnCUndNivwpvqFxyHqgyb9MGZxO4ejxStoQ8v10NY3xDXMXZjTW6Ky9Hs1r5Auv0JMekFEHKWfhCq9f8BmunuiSDDzdhRF/6V06vOCAONUyJutXo0j3NsDuru9tnH55pePoVMo9FTpEpxLd4DQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKgRR-0005rp-Nr for bug-gnu-emacs@gnu.org; Mon, 09 Dec 2024 11:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 16:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74619 X-GNU-PR-Package: emacs Original-Received: via spool by 74619-submit@debbugs.gnu.org id=B74619.173376096422428 (code B ref 74619); Mon, 09 Dec 2024 16:17:01 +0000 Original-Received: (at 74619) by debbugs.gnu.org; 9 Dec 2024 16:16:04 +0000 Original-Received: from localhost ([127.0.0.1]:55290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKgQV-0005pf-KC for submit@debbugs.gnu.org; Mon, 09 Dec 2024 11:16:04 -0500 Original-Received: from mail-wr1-f49.google.com ([209.85.221.49]:56714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKgQS-0005pB-F9 for 74619@debbugs.gnu.org; Mon, 09 Dec 2024 11:16:03 -0500 Original-Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-385ddcfc97bso3635232f8f.1 for <74619@debbugs.gnu.org>; Mon, 09 Dec 2024 08:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733760894; x=1734365694; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=hElvuruua8DuH3CCHPUtBW2ii5aa78qjazhkw/iTQ7A=; b=axwUkui41coPV6VrYGfveNmPXh21hxci/fp2wepFc7yHlg1H2gTfwFlbyyr2lB2IJW CDqBykIs0Dxi7G80tHHSAAmuV3l3wBJ9+Gxo5pr5tEO2p2wf9FJN57D51dO7Po4ls3bY 5kYkYkq97KM7xmvwaXPBOaWUBDOUsvLlGm6IcCGaXPKToeUVZbJRmUfuErYjdys0vGeb wQ1ITa7YyS2/Xtaepn5DFOlGtOgIyQF1RaQUzij/qF1wsbkbCKrZEegCJSwm4/uU8pbP DMx8fhvh2GoFAzqBc30AKafuqyojCT5M8Mp6ySOhaVY4H4lX2A2sL3sLjQqj3NcrVG3b 8GSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733760894; x=1734365694; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hElvuruua8DuH3CCHPUtBW2ii5aa78qjazhkw/iTQ7A=; b=KN5Rk22HpPWuP1zgV5+Ei01OLgDqPTwYVWYAluo98kOctrP/oQ20SgaWHtoZYrP0TN kQrAvid92o6Y7U9nx6hzT89qvtPdmAqclaV8WfigdSQD7XQ4fDUOjAKbSuZjCy0FK9ws BdmDMzU7olB1aQtqBbr4d0/fmtIISvJeWhRTVYS5lWJTlg94FLBrAXdev5xLV8LKo24G wzKWnAG+eI7DP7o5uipbXCuZaYtKHr1lgxYgwA78iIDOkvNDUrzR7Nxu9jpwm46HonMn v/0o3EgUeiI5YuSzsqMZIK82A3wI7c+GvTZAF4K/6UavvTot9sU1isAS3FecLwonS2Zy lVfg== X-Forwarded-Encrypted: i=1; AJvYcCUUCscqTRq/kSo+Yx6dAclk0/nDxOqypZfgHPvhK0B+5faHNL4r497Sm0bkZ9kg2SQUvk24Gw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwcZqmFHYyQnmJ2UBbJdJUQ9rqvpwLQ+/MQwXasuOcbLEEeWbFr TR1JSCwxepK1nqCNgg+fXper0TbJWQSxUmj7RQAlhnJcdHUISdqOaJAHfw== X-Gm-Gg: ASbGncu564EG+GZW/ngRp8Ozap7AEtqzDI1xki4RBDW66ZkBCX4cMOb7nnw4KPsWY5Y aWaRu/y3tIoGy7jUirlKw+feg40bzgU31DYverHIY4WZOdrc8xOXEmPU6AE3FQtIaHn2HuInK+v HxBbIDc8Uz9sfT2mS6GKSOl+uIyxd98jYp7mHRI6w/hBnXsqQEx1sdbsrGYsNtN6FlRruAvyUs8 7+LgFREoe+rvtcO4LjxRVG6DIIHCdgUKsTQ X-Google-Smtp-Source: AGHT+IGCID0UuxNzifWs8iux6JjHqjQXP0IZIT+wK4Hee2Xw0r8OCOx5kP9YEpx1QxIbJcSiLk1ZuA== X-Received: by 2002:a5d:47a1:0:b0:385:f7ea:eb86 with SMTP id ffacd0b85a97d-3862b333779mr10296360f8f.7.1733760894048; Mon, 09 Dec 2024 08:14:54 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb51:909c:f7db:82f4:f3d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38621909952sm13167250f8f.69.2024.12.09.08.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 08:14:53 -0800 (PST) In-Reply-To: <86bjxmhfjo.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Dec 2024 08:09:15 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296706 Archived-At: >>>>> On Sun, 08 Dec 2024 08:09:15 +0200, Eli Zaretskii said: >> From: Yoichi Nakayama >> * Emacs built with --without-ns doesn't load term/ns-win.el (in this >> case, the problem doesn't occur) >> * Emacs built with --with-ns does load term/ns-win.el even in -nw pr= ocess >>=20 >> Therefore, putting make-non-key-event for non-key events ns-* in the >> toplevel of term/ns-win.el solve the problem, and I also think >> term/ns-win.el is better place as you said "NS specific code should >> definitely go to ns-win.el". Eli> Thanks, then I guess it's okay to move the code there. Except if we do that, then in the --with-ns build, the =E2=8C=98-, binding (and the toplevel emacs/Settings menu item) doesn=CA=BCt work anymore. I=CA= =BCd rather not have the code be duplicated, so how about this (I suck at naming, so we can change the defun name): diff --git i/lisp/term/common-win.el w/lisp/term/common-win.el index 181dcc8e6d9..68c3b2d56e3 100644 --- i/lisp/term/common-win.el +++ w/lisp/term/common-win.el @@ -45,6 +45,8 @@ x-alternatives-map map) "Keymap of possible alternative meanings for some keys.") =20 +(declare-function ns-setup-special-keys "term/ns-win" ()) + (defun x-setup-function-keys (frame) "Set up `function-key-map' on the graphical frame FRAME." ;; Don't do this twice on the same display, or it would break @@ -56,22 +58,7 @@ x-setup-function-keys (set-keymap-parent map (keymap-parent local-function-key-map)) (set-keymap-parent local-function-key-map map)) (when (featurep 'ns) - (setq system-key-alist - (list - ;; These are special "keys" used to pass events from C to lisp. - (cons 1 (make-non-key-event 'ns-power-off)) - (cons 2 (make-non-key-event 'ns-open-file)) - (cons 3 (make-non-key-event 'ns-open-temp-file)) - (cons 4 (make-non-key-event 'ns-drag-file)) - (cons 5 (make-non-key-event 'ns-drag-color)) - (cons 6 (make-non-key-event 'ns-drag-text)) - (cons 8 (make-non-key-event 'ns-open-file-line)) -;;; (cons 9 (make-non-key-event 'ns-insert-working-text)) -;;; (cons 10 (make-non-key-event 'ns-delete-working-text)) - (cons 11 (make-non-key-event 'ns-spi-service-call)) - (cons 12 (make-non-key-event 'ns-new-frame)) - (cons 13 (make-non-key-event 'ns-toggle-toolbar)) - (cons 14 (make-non-key-event 'ns-show-prefs)))))) + (ns-setup-special-keys))) (set-terminal-parameter frame 'x-setup-function-keys t))) =20 (defvar x-invocation-args) diff --git i/lisp/term/ns-win.el w/lisp/term/ns-win.el index 2a29457133e..640b7fe6dc7 100644 --- i/lisp/term/ns-win.el +++ w/lisp/term/ns-win.el @@ -168,6 +168,27 @@ global-map (define-key global-map [S-mouse-1] 'mouse-save-then-kill) (global-unset-key [S-down-mouse-1]) =20 +;; Moved here from common-win.el because they need to work in a -nw +;; invocation of a (featurep 'ns) =3D> true build. Bug#74619. +(defun ns-setup-special-keys () + (setq system-key-alist + (list + ;; These are special "keys" used to pass events from C to lisp. + (cons 1 (make-non-key-event 'ns-power-off)) + (cons 2 (make-non-key-event 'ns-open-file)) + (cons 3 (make-non-key-event 'ns-open-temp-file)) + (cons 4 (make-non-key-event 'ns-drag-file)) + (cons 5 (make-non-key-event 'ns-drag-color)) + (cons 6 (make-non-key-event 'ns-drag-text)) + (cons 8 (make-non-key-event 'ns-open-file-line)) +;;; (cons 9 (make-non-key-event 'ns-insert-working-text)) +;;; (cons 10 (make-non-key-event 'ns-delete-working-text)) + (cons 11 (make-non-key-event 'ns-spi-service-call)) + (cons 12 (make-non-key-event 'ns-new-frame)) + (cons 13 (make-non-key-event 'ns-toggle-toolbar)) + (cons 14 (make-non-key-event 'ns-show-prefs))))) +(ns-setup-special-keys) + ;; Special Nextstep-generated events are converted to function keys. Here ;; are the bindings for them. Note, these keys are actually declared in ;; x-setup-function-keys in common-win. Robert --=20