Function: orgtbl-make-binding

orgtbl-make-binding is a byte-compiled function defined in org-table.el.gz.

Signature

(orgtbl-make-binding FUN N &rest KEYS)

Documentation

Create a function for binding in the table minor mode.

FUN is the command to call inside a table. N is used to create a unique command name. KEYS are keys that should be checked in for a command to execute outside of tables.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
(defun orgtbl-make-binding (fun n &rest keys)
  "Create a function for binding in the table minor mode.
FUN is the command to call inside a table.  N is used to create a unique
command name.  KEYS are keys that should be checked in for a command
to execute outside of tables."
  (eval
   (list 'defun
	 (intern (concat "orgtbl-hijacker-command-" (number-to-string n)))
	 '(arg)
	 (concat "In tables, run `" (symbol-name fun) "'.\n"
		 "Outside of tables, run the binding of `"
		 (mapconcat #'key-description keys "' or `")
		 "'.")
	 '(interactive "p")
	 (list 'if
	       '(org-at-table-p)
	       (list 'call-interactively (list 'quote fun))
	       (list 'let '(orgtbl-mode)
		     (list 'call-interactively
			   (append '(or)
				   (mapcar (lambda (k)
					     (list 'key-binding k))
					   keys)
				   '('orgtbl-error))))))))