From 01c3af05c3145db0af951cea06ad8c98a34923c3 Mon Sep 17 00:00:00 2001 From: Tone Kokalj Date: Sat, 18 Dec 2021 19:57:10 +0100 Subject: [PATCH] implementing the ido-completion-read using the elisp snippet provided by Hongyi Zhao --- GUI/QE-modes/qe-modes.templates/card.el.tcl | 7 +++---- GUI/QE-modes/qe-modes.templates/header.el.tcl | 8 +++++--- GUI/QE-modes/qe-modes.templates/qe-funcs.el.tcl | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/GUI/QE-modes/qe-modes.templates/card.el.tcl b/GUI/QE-modes/qe-modes.templates/card.el.tcl index 7440adccb..5e3f0a5b8 100644 --- a/GUI/QE-modes/qe-modes.templates/card.el.tcl +++ b/GUI/QE-modes/qe-modes.templates/card.el.tcl @@ -1,6 +1,5 @@ (defun $module-$card_uc () (interactive) - (let ((flag (read-string "Flags: $card_flags "))) - (insert "$card " flag)) - (newline 1) - ) + (let ((flag '($card_flags_elist))) + (insert "$card " (ido-completing-read "Select the flag: " flag))) + (newline 1)) diff --git a/GUI/QE-modes/qe-modes.templates/header.el.tcl b/GUI/QE-modes/qe-modes.templates/header.el.tcl index a8aa62984..4a7864d54 100644 --- a/GUI/QE-modes/qe-modes.templates/header.el.tcl +++ b/GUI/QE-modes/qe-modes.templates/header.el.tcl @@ -18,9 +18,11 @@ ;; (https://www.emacswiki.org/emacs/DerivedMode, ;; https://www.emacswiki.org/emacs/SampleMode) as well as the very ;; useful resources of Xah Lee -;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Last but -;; not the least Sebastijan Peljhan is acknowledged for his work on -;; `xsf-mode' that inspired the idea of writing the qe-modes. +;; (http://ergoemacs.org/emacs/elisp_syntax_coloring.html). Sebastijan +;; Peljhan is acknowledged for his work on `xsf-mode' that inspired +;; the idea of writing the qe-modes. Last but not the least, +;; Hongyi Zhao contributed the ido-completion-read snippet of +;; code for selecting the values for the card's flags. ;; This file is not part of GNU Emacs. diff --git a/GUI/QE-modes/qe-modes.templates/qe-funcs.el.tcl b/GUI/QE-modes/qe-modes.templates/qe-funcs.el.tcl index c6c95370d..031913cf2 100644 --- a/GUI/QE-modes/qe-modes.templates/qe-funcs.el.tcl +++ b/GUI/QE-modes/qe-modes.templates/qe-funcs.el.tcl @@ -31,6 +31,7 @@ $header ;;; Code: +(require 'ido) $utility_functions