From 59d21881b13bfdbe78b0228a3e9174e48ec6f792 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 22 Oct 2017 15:38:35 +0200 Subject: [PATCH] Revert "Move `org-key' and `org-defkey' into "org-macs.el"" This reverts commit 7f56a9920fff6c3538f30df2cc1c04cefe4f803b. `org-key' is specific to Org keybinding, therefore not generic enough to fit in "org-macs.el". So is `org-defkey'. --- lisp/org-macs.el | 21 --------------------- lisp/org.el | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 5d1eaf9ea..8ce29191a 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -31,9 +31,6 @@ ;;; Code: -(defvar org-disputed-keys) -(defvar org-replace-disputed-keys) - ;;; Macros @@ -223,24 +220,6 @@ error when the user input is empty." (if a (not b) b)) - -;;; 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)) - - ;;; Overlays diff --git a/lisp/org.el b/lisp/org.el index 5d2073a01..eac39313f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1107,6 +1107,20 @@ 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.