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

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

Re: Quoted function in `define-key'


From: Narendra Joshi
Subject: Re: Quoted function in `define-key'
Date: Sat, 04 Feb 2017 16:41:32 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Narendra Joshi <address@hidden> writes:

> The following piece of code is confusing me. It is from `rinari-minor-mode'.
>
> (dolist (el (append (mapcar
>                      (lambda (el)
>                        (cons (concat "f" (second el))
>                              (read (format "'rinari-find-%S"
>                                            (first el)))))
>                      rinari-jump-schema)
>                     rinari-minor-mode-keybindings))
>   (eval `(define-key rinari-prefix-map ,(car el) ,(cdr el))))
I have also tried changing this ^ to
(let ((key (car el))
      (func (cdr el)))
  (define-key rinari-prefix-map key func))

I thought maybe `define-key` is a macro and hence the calls to `car` and
`cdr` might not be evaluated. But that doesn't seem to be the case. This
still fails. The key is bound to a value that is equal to (quote 
some-function-name).

-- 
Narendra Joshi



reply via email to

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