[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to differentiate between default interactive argument 1 and user sup
From: |
Dieter Wilhelm |
Subject: |
how to differentiate between default interactive argument 1 and user supplied argument 1[was: insert pair doesn't work with *, $ and %] |
Date: |
Sun, 10 Dec 2006 17:01:49 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) |
Andreas Seltenreich <seltenreich@gmx.de> writes:
Katsumi Yamaoka <yamaoka@jpl.org> writes:
>>>>>> In <mailman.1624.1165460982.2155.help-gnu-emacs@gnu.org>
>>>>>> Dieter Wilhelm wrote:
>
>> For a special mode I'd like to have key bindings duplicating various
>> characters like e. g.
>
>> (global-set-key "\C-c{" 'insert-pair)
>
>> this does work as expected (I'm getting a pair of {} and the point is
>> within the pair). But I can't get the analogous with *, $ and % to
>> run, I'm just getting one of these characters back and not a pair.
>> What am I missing here?
>
> You need to add to the `insert-pair-alist' variable the pairs
> corresponding to those keys. For example:
>
> (add-to-list 'insert-pair-alist '(?* ?*))
> (add-to-list 'insert-pair-alist '(?$ ?$))
> (add-to-list 'insert-pair-alist '(?% ?%))
Hi Andreas and Katsumi
Thank you very much.
I think that insert-pair should duplicate by default every input
character when the characters is not in insert-pair-alist. Except
when the user *prescribes* the numeric argument to 1.
But then, how can one detect programmatically whether the user gives
interactively no argument (default argument 1) and an actual argument
1?
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany