From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tatsu Takamaro Newsgroups: gmane.emacs.help Subject: Re: Remapping keys and creating my own keymap \\ too complicated\\ Date: Wed, 4 Dec 2024 18:55:00 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4440"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 04 16:55:47 2024 Return-path: Envelope-to: geh-help-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 1tIrj9-00013E-2p for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Dec 2024 16:55:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIrid-00077e-Vf; Wed, 04 Dec 2024 10:55:15 -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 1tIrib-00076l-Pb for help-gnu-emacs@gnu.org; Wed, 04 Dec 2024 10:55:13 -0500 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIria-0006nw-28 for help-gnu-emacs@gnu.org; Wed, 04 Dec 2024 10:55:13 -0500 Original-Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2ffc7a2c5d5so71713951fa.1 for ; Wed, 04 Dec 2024 07:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733327709; x=1733932509; darn=gnu.org; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=XQIhr9NkmGHSx6LNZjX3KwDwGZ/yp+2+rtTTTmh290A=; b=aPi+py9fkAssGGdeEdELrZV8EEnMZ5YfARvJnoOJe75shn54FZ/4CQPhgDbbi7MorN 998wPPtlrw1dFJWb+78oU2OW1AN5+X0Bwbw4KAear0GP1bhFL4SYZ2R8BLCwbfoZWDYe NZTZ0muc3HyyAiSIrVfwVn08B4yvk69PSGpFCtGYqmphDn11RHp3EoWxyPd/sTSqeN+Q zEpWBabQAIh+YxbmT6TafNgVxNQI/ivRqBqkEi8RNQy4Gksz8v6moJdyMdHKgLlcyXUa TYYkZNkbcn8yzN/fxI008notIlkfReTue0aKs5hrSkXv3sSUKljjMW3xRZVBu71IebLy ArSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733327709; x=1733932509; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=XQIhr9NkmGHSx6LNZjX3KwDwGZ/yp+2+rtTTTmh290A=; b=BzM+6o1OmlRTmk3POmyIlF3Ru9whumEnnJpGuOtDPNP+FPFMnEHDiMs+sNnMEUoDd/ AcEIf8V8oOgKniaRC/ipEPFb+4F+y7hCbKj9oK9tnrUaJr6mt3hcV56i+1VRf5KYrX9U A/fbnE2W2x92/tiFgzaiuSxlzMRmcYuwAl+Jjy9cd+xRkgMiS8Q7ZPLT0DLG3EemnmYq xEnCFQjAJ1FzxPUZwGHg7vTxRsSIsCf2tz7ABhXD/SnpCvcEilCNjelqiman9E0VR+wu NzUkwf+CQYlmps1twViUDN7nD5bN52rk8lbZhVbJZt3OR4gLY+uBJIyit/6DTTUSdcqM OW/w== X-Gm-Message-State: AOJu0YxObeh1JgyEdUb5GdLMlWmd6j9yXEyRDLsAVYrwey7+ztqRvUdL 2RjictH/G++aayua4139SghHTkd1Kurc4o6zshsEhq+Q0euJZWlVMlT7qkT0 X-Gm-Gg: ASbGncu0SMyUwQ3CZtqMX4tNvG2dv9nbngBBM33Nwlp5DpuvpUHfiUI2qkLenpVbfTh TT8MMXuBM8tXzwI7N9C2ZZhYj4tcJA/KagV63cfldIzQAIHQ8ZGf/B06jP3XouEEsVkU7CpLuMg PQLB1YTnAKIdEO4dlZw0xrpGWklAh2EM7Z0eLoSQWFLfskTFUJvrFz/SkYvuhpnGqlo/ZeBxfAI rjxnRmokK6jGfr3KGQXwLDhs7F8cH2/XfmzsWcnO4/k13xGihPjclaIB/B02FfTlBj8/KJLMrJc u/86kXYwxb1WjQh9E5+ZVa+TEbNlxQjvtIwCZQc= X-Google-Smtp-Source: AGHT+IGs66Du0jJM47yPulmZqoVaFCd8BpL9OptN5SY0AVn2WOFtdIA862qJuA+SiduqAO4INBU9Wg== X-Received: by 2002:a05:651c:210c:b0:2ff:7a4f:e770 with SMTP id 38308e7fff4ca-30014eaa13cmr14405321fa.31.1733327705213; Wed, 04 Dec 2024 07:55:05 -0800 (PST) Original-Received: from [192.168.1.120] (broadband-37-110-24-126.ip.moscow.rt.ru. [37.110.24.126]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-300162394edsm3239781fa.1.2024.12.04.07.55.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Dec 2024 07:55:03 -0800 (PST) Content-Language: ru In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=tatsu.takamaro@gmail.com; helo=mail-lj1-x233.google.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.27, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148599 Archived-At: So, the concrete questions that bother me are as they were in the original question. Like 1) Is my idea to create an own keymap the best (or is it OK just to change the defaults)?, 2) What about the differenced in the approach and the syntax matters, 3) What is the correct way of creating my keymap. Sould it be inside of the ".emacs" file or a separate one? What commands should I use? And yes, I read the manual, but it's too difficult... Maybe it's just OK to change the defaults? No? ср, 04.12.2024 10:43, Jean Louis пишет: > Here is example how I have defined some global keys: > > (defvar cf-map) > (define-prefix-command 'cf-map) > (keymap-global-set "C-c p" 'cf-map) > (keymap-set cf-map "l" #'cf-people-last-few) > (keymap-set cf-map "N" #'cf-people-add) > (keymap-set cf-map "P" #'cf-people-search-ts-query) > (keymap-set cf-map "a" #'cf-people-list-by-name) > (keymap-set cf-map "c" #'cf-people-by-country) > (keymap-set cf-map "d" #'cf-people-by-description) > (keymap-set cf-map "f" #'cf-find-files-of-person) > (keymap-set cf-map "i" #'cf-people-by-interactions) > (keymap-set cf-map "j" #'cf-people-by-phone) > (keymap-set cf-map "m" #'cf-messages-repeat-to-last-person-sent) > (keymap-set cf-map "n" #'cf-people-by-name) > (keymap-set cf-map "p" #'cf-people) > (keymap-set cf-map "r" #'cf-people-by-rank) > (keymap-set cf-map "w" #'cf-people-not-in-any-list) > > And here is example how I have defined some menus: > > (defvar cf-people-menu-find-people > (list "Find people" > ["Find people" cf-people t] > ["Find people by name" cf-people-by-name t] > ["Find people by query" cf-people-search-ts-query t] > ["Find files of person" cf-find-files-of-person t] > ["Find people by description" cf-people-by-description t])) > > (defvar cf-people-menu-list-of-people > (list "List of people" > ["Find people by rank" cf-people-by-rank t] > ["Latest contacts" cf-people-last-few t] > ["List contacts by interactions" cf-people-by-interactions t] > ["People by country" cf-people-by-country t] > ["People without account" cf-people-not-in-any-list t] > ["People from last 60 days without valid email" cf-people-recent-with-failed-email-addresses t])) > > where above functions are used in the following: > > (easy-menu-define cf-people-menu global-map "People menu" > (list "People" > cf-people-menu-find-people > cf-people-menu-list-of-people > cf-people-menu-collaborate > cf-people-menu-add-new-people > cf-people-menu-edit-people > cf-mailing-list-menu > cf-central-files-menu > rcd-db-database-maintenance-menu > ;;hyperscope-menu-module-for-other-menu > )) >