Skip to main content


You may not think me very impressive, but I'll have you know that I'm a successful restauranteur in an obscure text-based multi-user virtual reality.
#LambdaMOO


elisp
God, my tab completion function is a hacky mess:
(defun lambdamoo-tab-complete ()
  "Complete user input using text from the buffer"
  (interactive)
  (when (memq (char-before) '(?  ?\r ?\n ?\t ?\v))
    (user-error "Point must follow non-whitespace character"))
  (let (replace-start
        (replace-end (point))
        replace-text found-pos found-text)
    (save-excursion
      (backward-word)
      (setq replace-start (point)
            replace-text (buffer-substring replace-start replace-end))
      (when (or (null lambdamoo--search-text)
                (not (string-prefix-p lambdamoo--search-text replace-text t)))
        (setq-local lambdamoo--search-text replace-text)
        (set-marker lambdamoo--found-point (point)))
      (goto-char lambdamoo--found-point)
      (unless
          (setq found-pos
                (re-search-backward
                 (concat "\\b" (regexp-quote lambdamoo--search-text))
                 (point-min) t))
        (setq-local lambdamoo--found-point (make-marker))
        (user-error "No match found"))
      (set-marker lambdamoo--found-point found-pos)
      (forward-word)
      (setq found-text (buffer-substring found-pos (point))))
    (delete-region replace-start replace-end)
    (insert found-text)))

#emacs #lisp #moo #mud #LambdaMOO

reshared this

in reply to Jonathan Lamothe

elisp

@Omar Antolín Actually, looking more closely at it, it might just do the trick.

I love it when I spend hours re-writing code that essentially already exists. ;)

in reply to Jonathan Lamothe

elisp

In the end, I wound up just binding tab to dabbrev-expand. 🙃

It might seem like I wasted a bunch of time writing that, but at least I learned a bunch along the way.



I'm finally MOOing from #Emacs. I've still got a bunch of work to do to port my customizations over from my old client, but it's Emacs... I'm sure it can do that.
#LambdaMOO #moo #mud


Popped into #LambdaMOO for a birthday celebration that took place inside my sushi restaurant. This got me to thinking. I wonder if it's possible to tie my restaurant's code into the birthday machine somehow so that people can get free food on their birthday.

This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.