branch: externals/ergoemacs-mode
commit 4bd466001341acebc34ac4c96bdc141507210e85
Author: Walter Landry <[email protected]>
Commit: Walter Landry <[email protected]>
Convert component--prompt to layout-prompt
---
ergoemacs-command-loop.el | 1 -
ergoemacs-component.el | 44 --------------------------------------------
ergoemacs-key-description.el | 2 +-
ergoemacs-layouts.el | 18 ++++++++++++++++--
ergoemacs-theme-engine.el | 1 -
5 files changed, 17 insertions(+), 49 deletions(-)
diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el
index 1f6581a..2ebec84 100644
--- a/ergoemacs-command-loop.el
+++ b/ergoemacs-command-loop.el
@@ -43,7 +43,6 @@
(declare-function ergoemacs-mode-line "ergoemacs-mode")
-(declare-function ergoemacs-layout--regexp "ergoemacs-layouts")
(declare-function ergoemacs-layouts--list "ergoemacs-layouts")
(declare-function ergoemacs-map-properties--movement-p
"ergoemacs-map-properties")
diff --git a/ergoemacs-component.el b/ergoemacs-component.el
index 1291663..56662ef 100644
--- a/ergoemacs-component.el
+++ b/ergoemacs-component.el
@@ -1165,50 +1165,6 @@ Return 0 if there is no such symbol. Based on
(and (ergoemacs-gethash (symbol-name sym) hash-table)
sym)))))
0))))
-(defun ergoemacs-component--prompt (&optional theme-instead)
- "Prompt for component or theme (when THEME-INSTEAD is non-nil)."
- (let ((c (or (and (eq theme-instead :layout) ergoemacs-keyboard-layout)
- (ergoemacs-component-at-point theme-instead)))
- (enable-recursive-minibuffers t)
- val)
- (setq val (completing-read (if (or (symbolp c) (stringp c))
- (format
- "Describe ergoemacs %s (default %s): "
- (or (and (eq theme-instead :layout)
"layout")
- (and theme-instead "theme")
"component")
- c)
- (format
- "Describe ergoemacs %s: "
- (or (and (eq theme-instead :layout) "layout")
- (and theme-instead "theme")
"component")))
- (or (and (eq theme-instead :layout)
(ergoemacs-layouts--list))
- (and theme-instead ergoemacs-theme-hash)
- ergoemacs-component-hash)
- nil
- ;; (lambda (vv)
- ;; (or (get vv 'variable-documentation)
- ;; (and (boundp vv) (not (keywordp vv)))))
- t nil nil
- (format "%s" c)))
- (list (or (and (equal val "") (format "%s" c)) val))))
-
-(defun ergoemacs-component-cached-p (component)
- "Determine if COMPONENT is cached instead of loaded."
- (let* ((component (and component
- (or (and (stringp component) component)
- (and (symbolp component) (symbol-name
component)))))
- (comp (ergoemacs-component-struct--lookup-hash (or component "")))
- (plist (ergoemacs-component-struct-plist comp))
- (file (plist-get plist :file))
- (el-file (and file (concat (file-name-sans-extension file) ".el")))
- (elc-file (and file (concat (file-name-sans-extension file) ".elc"))))
- (when file
- (catch 'loaded
- (dolist (load load-history)
- (when (or (string= elc-file (car load))
- (string= el-file (car load)))
- (throw 'loaded nil))) t))))
-
(provide 'ergoemacs-component)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ergoemacs-component.el ends here
diff --git a/ergoemacs-key-description.el b/ergoemacs-key-description.el
index 2975ccd..eafa356 100644
--- a/ergoemacs-key-description.el
+++ b/ergoemacs-key-description.el
@@ -447,7 +447,7 @@ KBD is the keyboard code. LAYOUT is the layout that is
used."
ret))
(defun ergoemacs-key-description--setup-xrefs ()
- "Setup cross refecnes in help buffer."
+ "Setup cross refences in help buffer."
(ergoemacs-component--help-link))
(add-hook 'temp-buffer-show-hook 'ergoemacs-key-description--setup-xrefs)
diff --git a/ergoemacs-layouts.el b/ergoemacs-layouts.el
index a27486e..ae16223 100644
--- a/ergoemacs-layouts.el
+++ b/ergoemacs-layouts.el
@@ -388,7 +388,6 @@
(declare-function ergoemacs-translate-layout "ergoemacs-translate")
(declare-function ergoemacs-translate--svg-layout "ergoemacs-translate")
(declare-function ergoemacs-translate--png-layout "ergoemacs-translate")
-(declare-function ergoemacs-component--prompt "ergoemacs-component")
(declare-function quail-insert-kbd-layout "quail")
(defun ergoemacs-layouts--current (&optional layout)
@@ -543,11 +542,26 @@ expression matching the base layout."
(base f2)
(t f1)) (regexp-opt (ergoemacs-layouts--list) t))))
+(defun ergoemacs-layout--prompt ()
+ "Prompt for component or theme (when THEME-INSTEAD is non-nil)."
+ (let ((c ergoemacs-keyboard-layout)
+ (enable-recursive-minibuffers t)
+ val)
+ (setq val (completing-read (if (or (symbolp c) (stringp c))
+ (format
+ "Describe ergoemacs layout (default %s): "
+ c)
+ "Describe ergoemacs layout: ")
+ ergoemacs-layouts--list
+ nil t nil nil
+ (format "%s" c)))
+ (list (or (and (equal val "") (format "%s" c)) val))))
+
(defun ergoemacs-layout-describe (&optional layout)
"Display the full documentation of an `ergoemacs-mode' LAYOUT.
LAYOUT can be either a symbol or string."
- (interactive (ergoemacs-component--prompt :layout))
+ (interactive (ergoemacs-layout--prompt))
(let* ((layout (or (and layout
(or (and (stringp layout) layout)
(and (symbolp layout) (symbol-name layout))))
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index f92a837..1ee8c79 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -71,7 +71,6 @@
(declare-function ergoemacs-component-struct--component-description
"ergoemacs-component")
(declare-function ergoemacs-component-at-point "ergoemacs-component")
(declare-function ergoemacs-component-find-1 "ergoemacs-component")
-(declare-function ergoemacs-component--prompt "ergoemacs-component")
(declare-function ergoemacs-require "ergoemacs-lib")
(declare-function ergoemacs-command-loop--spinner-display
"ergoemacs-command-loop")
(declare-function ergoemacs-key-description "ergoemacs-key-description")