Interest in addition to slime-repl-history-replace?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Slime Devs, Here at the office folks are used to the Franz Lisp eli emacs interface. Once of the features of the eli interface is that when you iterate through previous commands in the REPL they get inserted at the point as opposed to Slime's behavior of erasing all input and inserting the previous input at the REPL. I've modified slime-repl-history-replace to mimic the eli behavior, is there interest in me tidying this up and submitting a patch to slime with this as an optional alternative to the current history behavior? Regards, Andrew -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSzYg+AAoJELwmtL8s8iv947QQAKxpPheH21yPv1+zG/zxPrrw qSLTDq43xgO3BdjX1yRnom7pdnoaHB/RvZXckUoxM9yP4n0FLYeWoF29YJW//HlP 14cyOcE7t/goClXgpl/Ft6jP8Wh0yclBa7hrfRrbrXzZB9VppeMdkpX0/qRFeTWk AGu6Sx79lkSO3BgLIUjAVMv03htKa/y3uhq2wPKZnlLyKU49qCOiECEyzE+biMeK 3o3Edw2JmmB0KZ1nxHp/jvWJJ7Vc5H/PEYxL5XRR/vYOqCPEheNYIDEQ12kg13kZ p4doQfKScaWTuapaOk1/Lwwu9pODXU6qqY+xGdgi1ZdzhAIHBgVHiDL9Y/w0p44s 1JC5ZB0GzSxbCWoCGFF5G6E2w+PohsAsiwncqvpAtbrV0i55oi3PQ0XC0NrAdIvR F7xg9PEu13A9wwHaV4CuNavMPhEaeqTgM0SrK1Llh2StkZmMVBQazV1sxvE8Fu7K NfFFRHMNRGl8axWOn7s6oSFmvfQYbFya4BglPOU6LfS2n/bljD/wiNt5U5S6TfkZ 9HrUKTos5vM9Ti+qcLJhUcl0tPj/B3Vom9FSOTDa/ssaf84bgEWf58UAIm7znoAi u3gc+3RGpj7Zodx5qI4ZeKjxpTrSqCn708Yvo9qaACP9l0w2hE8JlzhJIJ0vnIjC GRXK4bpL+JVEGubNbAUl =Geki -----END PGP SIGNATURE-----

On Wed, Jan 8, 2014 at 5:17 PM, Andrew Myers <asm198@gmail.com> wrote:
I've modified slime-repl-history-replace to mimic the eli behavior, is there interest in me tidying this up and submitting a patch to slime with this as an optional alternative to the current history behavior?
I'm interested in features that help ELI users move to SLIME. :-) -- Luís Oliveira http://kerno.org/~luis/

Here's what I have modified right now. Currently Devs who want the behavior put this in their emacs config after loading slime and set the defvar to t. I'm not a slime or elisp expert by a long shot so if anyone has comments for what I should improve that would be great :) Andrew These changes are in contrib/slime-repl.el
(defvar slime-repl-eli-history-behavior nil)
(defun slime-repl-insert-history (direction pos min-pos max-pos content) (when (slime-repl-history-search-in-progress-p) (let* ((dir-of-previous (if (eq direction 'backward) 'forward 'backward)) (previous-index (slime-repl-position-in-history pos dir-of-previous "")) (previous (nth previous-index slime-repl-input-history))) (let ((prev-point (point))) (backward-char (length previous)) (delete-region (min (point) prev-point) (max (point) prev-point))))) (insert-and-inherit content))
(defun slime-repl-history-replace (direction &optional regexp) "Replace the current input with the next line in DIRECTION. DIRECTION is 'forward' or 'backward' (in the history list). If REGEXP is non-nil, only lines matching REGEXP are considered." (setq slime-repl-history-pattern regexp) (let* ((min-pos -1) (max-pos (length slime-repl-input-history)) (pos0 (cond ((slime-repl-history-search-in-progress-p) slime-repl-input-history-position) (t min-pos))) (pos (slime-repl-position-in-history pos0 direction (or regexp "") (slime-repl-current-input))) (msg nil)) (cond ((and (< min-pos pos) (< pos max-pos)) (if slime-repl-eli-history-behavior (slime-repl-insert-history direction pos min-pos max-pos (nth pos slime-repl-input-history)) (slime-repl-replace-input (nth pos slime-repl-input-history))) (setq msg (format "History item: %d" pos))) ((not slime-repl-wrap-history) (setq msg (cond ((= pos min-pos) "End of history") ((= pos max-pos) "Beginning of history")))) (slime-repl-wrap-history (setq pos (if (= pos min-pos) max-pos min-pos)) (setq msg "Wrapped history"))) (when (or (<= pos min-pos) (<= max-pos pos)) (when regexp (setq msg (concat msg "; no matching item")))) ;;(message "%s [%d %d %s]" msg start-pos pos regexp) (message "%s%s" msg (cond ((not regexp) "") (t (format "; current regexp: %s" regexp)))) (setq slime-repl-input-history-position pos) (setq this-command 'slime-repl-history-replace)))
On 01/08/2014 01:26 PM, Luís Oliveira wrote:
On Wed, Jan 8, 2014 at 5:17 PM, Andrew Myers <asm198@gmail.com> wrote:
I've modified slime-repl-history-replace to mimic the eli behavior, is there interest in me tidying this up and submitting a patch to slime with this as an optional alternative to the current history behavior? I'm interested in features that help ELI users move to SLIME. :-)

João Távora <joaotavora <at> gmail.com> writes:
Andrew Myers <asm198 <at> gmail.com> writes:
Here's what I have modified right now.
There is a much, much bigger chance to get this looked at if you make a github pull request. See the new CONTRIBUTING.md file.
João
For anyone interested in this, I Just submitted a pull request for it on github. It's been cleaned up and I added a customize option and fixed a few bugs that were in the version I sent out in email. https://github.com/slime/slime/pull/100 Andrew

On Fri, Jan 31, 2014 at 9:04 AM, Andrew <asm198@gmail.com> wrote:
João Távora <joaotavora <at> gmail.com> writes:
Andrew Myers <asm198 <at> gmail.com> writes:
Here's what I have modified right now.
There is a much, much bigger chance to get this looked at if you make a github pull request. See the new CONTRIBUTING.md file.
João
For anyone interested in this, I Just submitted a pull request for it on github. It's been cleaned up and I added a customize option and fixed a few bugs that were in the version I sent out in email.
https://github.com/slime/slime/pull/100
Andrew
I'm interested in this feature; it's one of the things I missed when I switched from ELI to SLIME years ago. What is its status? I notice the discussion on github about last input vs. last matching input; as I recall, ELI could do both, I think there was a prefix argument for the latter. Liam

On Sun, Dec 28, 2014 at 2:07 PM, Liam Healy <lnp@healy.washington.dc.us> wrote:
I'm interested in this feature; it's one of the things I missed when I switched from ELI to SLIME years ago. What is its status? I notice the discussion on github about last input vs. last matching input; as I recall, ELI could do both, I think there was a prefix argument for the latter.
I suppose trying this code out would help: <https://github.com/slime/slime/pull/184>. Does it work for you? Cheers, -- Luís Oliveira http://kerno.org/~luis/

Liam Healy <lnp@healy.washington.dc.us> writes:
On Fri, Jan 31, 2014 at 9:04 AM, Andrew <asm198@gmail.com> wrote:
João Távora <joaotavora <at> gmail.com> writes:
> Andrew Myers <asm198 <at> gmail.com> writes: > > Here's what I have modified right now. > There is a much, much bigger chance to get this looked at if you make a > github pull request. See the new CONTRIBUTING.md file. > > João
For anyone interested in this, I Just submitted a pull request for it on github. It's been cleaned up and I added a customize option and fixed a few bugs that were in the version I sent out in email. https://github.com/slime/slime/pull/100
I'm interested in this feature; it's one of the things I missed when I switched from ELI to SLIME years ago. What is its status? I notice the discussion on github about last input vs. last matching input; as I recall, ELI could do both, I think there was a prefix argument for the latter.
About a year ago, this was complicated to implement in slime-repl which doesn't use much of Emacs' own comint.el. But I still find this feature interesting and I've implemented it in SLY as demonstrated in this 30 sec video: https://www.youtube.com/watch?v=Ka4J2v3n57o I used Robert Goldman's description of the behaviour in https://github.com/slime/slime/pull/100. It also works with reverse i-search. João

FTR, i also have some years old changes for the repl history that we've been using ever since then: as documented in the pull request here: https://github.com/slime/slime/pull/84 -- • attila lendvai • PGP: 963F 5D5F 45C7 DFCD 0A39 -- “Life is a series of experiences, each one of which makes us bigger, even though sometimes it is hard to realize this. For the world was built to develop character, and we must learn that the setbacks and grieves which we endure help us in our marching onward.” — Henry Ford (1863–1947)

I've modified slime-repl-history-replace to mimic the eli behavior, is there interest in me tidying this up and submitting a patch to slime with this as an optional alternative to the current history behavior?
Sounds good to me if you can provide a configuration variable to switch between the two options. But in any case make a pull request on github and we'll handle discussion there. João
participants (7)
-
Andrew
-
Andrew Myers
-
Attila Lendvai
-
joaotavora@gmail.com
-
João Távora
-
Liam Healy
-
Luís Oliveira