From 109495e3ab2adb474cb0b6538ec318034b39f02c Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 11 Jun 2020 14:56:14 +0200 Subject: Setup automatic tag updating in Emacs Sadly counsel-etags did not find universal-ctags in my PATH so some custom setup in Nix home-manager was required. --- gui/conf/init.el | 6 ++++++ gui/emacs.nix | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gui/conf/init.el b/gui/conf/init.el index 4dbaba5..f7f7916 100644 --- a/gui/conf/init.el +++ b/gui/conf/init.el @@ -236,6 +236,12 @@ (use-package counsel-etags :ensure t :config + (setq tags-revert-without-query t) + (setq large-file-warning-threshold nil) + (add-hook 'prog-mode-hook + (lambda () + (add-hook 'after-save-hook + 'counsel-etags-virtual-update-tags 'append 'local))) (evil-leader/set-key "d" 'counsel-etags-find-tag-at-point)) diff --git a/gui/emacs.nix b/gui/emacs.nix index 008f6a7..8b9749f 100644 --- a/gui/emacs.nix +++ b/gui/emacs.nix @@ -22,8 +22,11 @@ in pkgs.writeTextFile { name = "custom-runtime-env.el"; text = '' - (setenv "PATH" (concat (getenv "PATH") ":${tex}/bin")) + (setenv "PATH" (concat (getenv "PATH") + ":${tex}/bin")) (add-to-list 'exec-path "${tex}/bin") + + (setq counsel-etags-update-tags-backend (lambda (src-dir) (shell-command "${pkgs.universal-ctags}/bin/ctags -e -R"))) ''; }; -- cgit v1.2.3