unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: peter hodgson <imputerate@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: disable, replace binding in method-map
Date: Sun, 17 May 2020 10:59:06 -0500	[thread overview]
Message-ID: <871rnipn79.fsf@ralph.puteracy.com> (raw)


 A simpler version of my earlier pos

 1. `set-input-method` + `greek-babel` 
		turns an emacs buffer from U:** to BGU:
     the entire keyboard is transformed to type greek;
       most bindings are obvious- a = alpha, b = beta ...
       but a few are handled differently from other greek maps i work with,
                and these are the ones i want to a. preempt, then b.replace;
                a. theta- j, sigma- s/c,  ksi-x, chi-q
                b.        q         s         c      x

 2. i had a similar problem with org-mode 
      my global key settings worked as i wanted in org-mode, 
	 unless they were set to some other task in org-mode-map
    (bindings- mode trumping- minor trumps major, and major trumps global)
    SO, i disabled the keys which 
	  a. are globally bound in my emacs 
         but
          b. org-mode-map had given its own special tasks-
    this freed up such keys so they could work "globally;"

(add-hook 'org-mode-hook
          (lambda ()
            (define-key org-mode-map "\eh" nil)))

(add-hook 'org-mode-hook
          (lambda ()
            (define-key org-mode-map "\ea" nil)))
 ------------------------------------------

 can't i do the same with greek-babel?
                
 1. for theta (i won't need to remap 'j', 
        but i must preempt 'q' so i can give it a new job here 


 (add-hook 'input-method-hook
          (lambda ()
            (define-key input-method-greek-babel-map "j" nil))
          (lambda () 
            (define-key input-method-greek-babel-map "q" nil))
          (lambda () 
            (define-key input-method-greek-babel-map "q"
                             'θ)))

 the two issues i can't successfully google are
     1. does 'input-method-hook work like 'input-mode-hook?
     2. how do i disable a binding, then rebind the key to a new job?

-- 
imputerate@puteracy.com



             reply	other threads:[~2020-05-17 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 15:59 peter hodgson [this message]
2020-05-19 13:16 ` disable, replace binding in method-map Dmitry Alexandrov
2020-05-19 15:22 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rnipn79.fsf@ralph.puteracy.com \
    --to=imputerate@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).