help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remapping keys and creating my own keymap \\ too complicated\\


From: Tatsu Takamaro
Subject: Re: Remapping keys and creating my own keymap \\ too complicated\\
Date: Wed, 4 Dec 2024 18:55:00 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

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
        ))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]