diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-10-22 15:05:48 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-10-22 15:05:48 +0200 |
commit | 7f56a9920fff6c3538f30df2cc1c04cefe4f803b (patch) | |
tree | 80be25dcbbf50d8bf0be086accc5cfd8428bd25f | |
parent | 7554012cefc522326ac320ec97f5783fc93d47c1 (diff) | |
download | org-mode-7f56a9920fff6c3538f30df2cc1c04cefe4f803b.tar.gz |
Move `org-key' and `org-defkey' into "org-macs.el"
* lisp/org.el (org-key):
(org-defkey): Move...
* lisp/org-macs.el: ... there.
-rw-r--r-- | lisp/org-macs.el | 21 | ||||
-rw-r--r-- | lisp/org.el | 14 |
2 files changed, 21 insertions, 14 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 196a2ce..f55c07f 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -31,6 +31,9 @@ ;;; Code: +(defvar org-disputed-keys) +(defvar org-replace-disputed-keys) + ;;; Macros @@ -201,6 +204,24 @@ error when the user input is empty." +;;; Keybinding + +(defun org-key (key) + "Select key according to `org-replace-disputed-keys' and `org-disputed-keys'. +Or return the original if not disputed." + (when org-replace-disputed-keys + (let* ((nkey (key-description key)) + (x (cl-find-if (lambda (x) (equal (key-description (car x)) nkey)) + org-disputed-keys))) + (setq key (if x (cdr x) key)))) + key) + +(defun org-defkey (keymap key def) + "Define a key, possibly translated, as returned by `org-key'." + (define-key keymap (org-key key) def)) + + + ;;; String manipulation (defsubst org-trim (s &optional keep-lead) diff --git a/lisp/org.el b/lisp/org.el index 6d62f12..c7ebad7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1107,20 +1107,6 @@ therefore you'll have to restart Emacs to apply it after changing." :group 'org-startup :type 'alist) -(defun org-key (key) - "Select key according to `org-replace-disputed-keys' and `org-disputed-keys'. -Or return the original if not disputed." - (when org-replace-disputed-keys - (let* ((nkey (key-description key)) - (x (cl-find-if (lambda (x) (equal (key-description (car x)) nkey)) - org-disputed-keys))) - (setq key (if x (cdr x) key)))) - key) - -(defun org-defkey (keymap key def) - "Define a key, possibly translated, as returned by `org-key'." - (define-key keymap (org-key key) def)) - (defcustom org-ellipsis nil "The ellipsis to use in the Org mode outline. |