   (forward-line -1)
   (indent-according-to-mode))
 
-;; Do not auto indent current line when pressing <RET>.
-(add-hook 'sgml-mode-hook
-          (lambda() (local-set-key (kbd "<RET>")
-                              #'electric-indent-just-newline)))
+(use-package sgml-mode
+  :after electric
+  :bind (:map sgml-mode-map
+              ;; Do not auto indent current line when pressing <RET>.
+              ("<RET>" . electric-indent-just-newline)))
 
 (defun ar/smart-open-line (arg)
   "Insert an empty line after the current line.

;; Easy access to links in buffer (using avy).
(use-package link-hint :ensure t)

(defun ar/bazel-mode-hook-fun ()
  (ar/buffer-run-for-saved-file-name "buildifier" "BUILD")
  (setq-local company-backends '(company-bazel company-rfiles)))

(use-package bazel-mode
  :after company-grep
  :config
  (add-hook 'bazel-mode-hook #'ar/bazel-mode-hook-fun))

(use-package use-host-package
  :config


;; make ELisp regular expressions more readable.
(use-package easy-escape :ensure t
  :hook (emacs-lisp-mode . easy-escape-minor-mode))

;; Logs commands in a separate buffer. Handy for screenscasts.
(use-package command-log-mode :ensure t)
