Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

counsel.el (counsel-mark-ring): Refactor for reducing nested let #2237

wants to merge 1 commit into from


Copy link

@yonta yonta commented Sep 19, 2019

Refactor PR.

  • reduce nesting let
  • make let binding to smaller working

Copy link

@mohkale mohkale commented Sep 28, 2019

This pull request is definitely going to conflict with mine 😞😞😞. Looks like the end goal in this request was to make counsel-mark-ring more readable. I've done something similair in my own, right now it's been reduced to:

(defun counsel-mark-ring ()
  "Browse `mark-ring' interactively.
Obeys `widen-automatically', which see."
  (let ((counsel--mark-ring-calling-point (point))
        (cands (counsel-mark--get-candidates
                (sort (delete-dups (copy-sequence mark-ring)) #'<))))
    (if cands
        (counsel-mark--ivy-read cands 'counsel-mark-ring)
      (message "Mark ring is empty"))))

if you'd like I could merge your pull request into my fork and then change mine to make it more like yours, but I feel my current implementation of counsel-mark-ring is pretty good 😄. Thoughts?

Copy link

@abo-abo abo-abo commented Oct 1, 2019

@yonta Thanks, merged.
@mohkale Please incorporate this into your PR. It can take a while to get the CA. I think it's good to have a more readable code during the wait time :)

@yonta yonta deleted the mark-ring-refactor branch Oct 1, 2019
Copy link

@mohkale mohkale commented Oct 1, 2019


astoff pushed a commit to astoff/swiper that referenced this issue Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants