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

a snippet in EmacsWiki isn't compatible #59

Open
TailorSchmitt opened this issue May 29, 2016 · 0 comments
Open

a snippet in EmacsWiki isn't compatible #59

TailorSchmitt opened this issue May 29, 2016 · 0 comments

Comments

@TailorSchmitt
Copy link

I use this snippet from EmacsWiki(https://www.emacswiki.org/emacs/Smex):
;;; Filters ido-matches setting acronynm matches in front of the results
(defadvice ido-set-matches-1 (after ido-smex-acronym-matches activate)
(if (and (fboundp 'smex-already-running) (smex-already-running)
(> (length ido-text) 1))
(let ((regex (concat "^" (mapconcat 'char-to-string ido-text "[^-]-")))
(acronym-matches (list))
(remove-regexes '("-menu-")))
;; Creating the list of the results to be set as first
(dolist (item items)
(if (string-match ido-text item) ;; exact match
(add-to-list 'acronym-matches item)
(if (string-match (concat regex "[^-]
$") item) ;; strict match
(add-to-list 'acronym-matches item)
(if (string-match regex item) ;; appending relaxed match
(add-to-list 'acronym-matches item t)))))

    ;; Filtering ad-return-value
    (dolist (to_remove remove-regexes)
      (setq ad-return-value
            (delete-if (lambda (item)
                         (string-match to_remove item))
                       ad-return-value)))

    ;; Creating resulting list
    (setq ad-return-value
          (append acronym-matches
                  ad-return-value))

    (delete-dups ad-return-value)
    (reverse ad-return-value))))

When I use Emacs 24.5, it works quite fine and helps me a lot. However, there seem to be some strange errors after I update Emacs 24.5 to Emacs pretest 25.0.94. For example, I can only type three letters after I hit M-x. The fourth letter will overwrite the third letter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant