diff options
author | Tomas Volf <~@wolfsden.cz> | 2024-01-13 14:18:04 +0100 |
---|---|---|
committer | Tomas Volf <~@wolfsden.cz> | 2024-01-15 19:41:38 +0100 |
commit | cfe14bf11096ded649b57e2532302321044d51c6 (patch) | |
tree | 63a6c602a2b39e509a54ab728e25bfa41c5ba25c /elisp | |
parent | bc9051e532ada72f92de8e50a85e349e33573205 (diff) | |
download | geiser-cfe14bf11096ded649b57e2532302321044d51c6.tar.gz geiser-cfe14bf11096ded649b57e2532302321044d51c6.tar.bz2 |
edit: Add geiser-insert-actual-lambda.
Some projects use λ, some use lambda, and it is convenient to be able to use the
same mapping engraved into muscle memory for both. Therefore this commit adds a
new variable that allow geiser-insert-lambda to do both, depending on the value.
* elisp/geiser-edit.el (geiser-insert-actual-lambda): New variable.
(geiser-insert-lambda): Respect it.
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-edit.el | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el index 0f2b080..df4231c 100644 --- a/elisp/geiser-edit.el +++ b/elisp/geiser-edit.el @@ -298,13 +298,22 @@ With prefix, asks for the symbol to locate." (when marker (xref-push-marker-stack marker)) t))) +(geiser-custom--defcustom geiser-insert-actual-lambda t + "Whether geiser-insert-lambda should insert \"λ\" or \"lambda\"." + :type 'boolean) + (defun geiser-insert-lambda (&optional full) - "Insert λ at point. With prefix, inserts (λ ())." + "Insert λ or lambda at point. With prefix, inserts (λ ()) or (lambda ()). + +See also `geiser-insert-actual-lambda'." (interactive "P") - (if (not full) - (insert (make-char 'greek-iso8859-7 107)) - (insert "(" (make-char 'greek-iso8859-7 107) " ())") - (backward-char 2))) + (let ((sym (if geiser-insert-actual-lambda + (make-char 'greek-iso8859-7 107) + "lambda"))) + (if (not full) + (insert sym) + (insert "(" sym " ())") + (backward-char 2)))) (defun geiser-squarify (n) "Toggle between () and [] for current form. |