With some help from the blog post found here
<https://nullprogram.com/blog/2013/02/06/>, I have managed to write a
small code for a test package named niranjan. It is as follows.
:lighter " niranjan"
:keymap (let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c i") 'insert-niranjan)
(add-hook 'text-mode-hook 'niranjan-mode)
I hope this is correct. I saved it in ~/.emacs.d/elpa/niranjan with the
name niranjan.el. Now I expect niranjan-mode to be listed when I press
M-x, but unfortunately it isn't. Note that I am opening a new session
while trying M-x. What should be done to make a package appear in the
normal package/mode list? Also I need some help for starting an actual
package, would somebody like to help me doing this?