Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Wednesday, January 18, 2023

Emacs lsp-mode multiple completions

Recently I started using lsp-mode with company-mode for completions (Following instructions from How to setup Emacs LSP Mode for Go). I was pretty happy with my configuration which for pretty basic using use-package But, soon ran into the following issue where 2 completion minibuffers started showing up.
So, did a bit of googling to land in Multiple completion modes enabled. How to fix this?. It did not fix my issue but, pointed me in the right direction. So, I looked at the current values for company-frontends & company-backends in the buffer in question and found that auto-complete-mode was enabled which was the contributor to the lower completion buffer which I wanted to get rid off. I also remembered disabling global-auto-complete-mode But, the devil is in the details taking a peek into ac-config-default showed the culprit (all the way below in line #10). So, with a little tinkering later we get And, all is well in Emacs :)

Friday, October 07, 2011

Luhn algorithm in elisp

I was looking for the checksum validation of credit card numbers and came across the Luhn Algorithm. I had emacs open and on a whim decided I'll try and implement it using elisp. I'm no lisp programmer but, have in the past managed to write some basic elisp in .emacs so, I guessed it would take me about .5hr at most.

I guessed wrong. It took me a lot longer to wrap my head around even some of the simple elisp constructs like let and lambda took quite a while and it took a lot longer than I anticipated. Here, I present to you the fruit of my labors :)