all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Daimrod <daimrod@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: view-mode keymap
Date: Thu, 03 Jan 2013 11:58:55 +0530	[thread overview]
Message-ID: <87ehi2ixug.fsf@gmail.com> (raw)
In-Reply-To: <87sj6j8y1q.fsf@casa.home> (daimrod@gmail.com's message of "Wed,  02 Jan 2013 15:22:25 +0100")

Daimrod <daimrod@gmail.com> writes:

> Jambunathan K <kjambunathan@gmail.com> writes:
>
>> I think, `make-composed-keymap' can help here.
>>
>>
>>> I like `view-mode' but it conflicts with others minor mode map (paredit
>>> in my case).
>>>
>>> I would like to know if there is a better way to make a keymap that
>>> takes precedence over the others than manipulating
>>> `minor-mode-map-alist'.
>>>
>>> Here is my current implementation:
>>>
>>> (add-hook 'view-mode-hook
>>>           (lambda ()
>>>             ;; Makes sure `view-mode-map' is the first minor mode map
>>>             ;; available in `minor-mode-map-alist', because in case of
>>>             ;; conflicting bindings, the first one is used.
>>>             (unless (eq 'view-mode (caar minor-mode-map-alist))
>>>               (setf minor-mode-map-alist
>>>                     (cons (cons 'view-mode view-mode-map)
>>>                           (cl-remove 'view-mode minor-mode-map-alist
>>>                                      :key #'car))))))
>
> I've looked at it but I don't see how it can help. I don't want to
> create a new keymap, I want `view-mode-map' to take priority over other
> keymaps.

I was hoping that something like this

    (use-local-map
     (make-composed-keymap view-mode-map
                           (current-local-map)))    
        
will put `view-mode-map' on top of the keymap stack and thus overwrite
paredit's bindings.

I see that DEL (backspace) key is shared between view-mode and paredit.
My little experimentation that the above snippet failst to produce the
effect expected by me.

Do you think I am reading the doc of the APIs (used above) incorrectly?

>
> I've looked at the documentation and it seems that changing the order in
> `minor-mode-map-alist' is the only way to manage priorities between
> keymap, because they shouldn't conflict in there first place.

-- 



  reply	other threads:[~2013-01-03  6:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-31 15:04 view-mode keymap Daimrod
2012-12-31 16:15 ` Jambunathan K
     [not found] ` <mailman.16432.1356970328.855.help-gnu-emacs@gnu.org>
2013-01-02 14:22   ` Daimrod
2013-01-03  6:28     ` Jambunathan K [this message]
     [not found]     ` <mailman.16584.1357194301.855.help-gnu-emacs@gnu.org>
2013-01-03 11:10       ` Daimrod
2013-01-03 12:21         ` Daimrod
2013-01-03 13:10           ` Eric Abrahamsen
     [not found]           ` <mailman.16601.1357218351.855.help-gnu-emacs@gnu.org>
2013-01-03 15:45             ` Daimrod
2013-01-02 16:43 ` Michael Heerdegen
     [not found] ` <mailman.16535.1357144973.855.help-gnu-emacs@gnu.org>
2013-01-02 17:08   ` Daimrod
2013-01-03 14:43     ` William Xu
     [not found]     ` <mailman.16604.1357224259.855.help-gnu-emacs@gnu.org>
2013-01-03 15:44       ` Daimrod

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

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

  git send-email \
    --in-reply-to=87ehi2ixug.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=daimrod@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.