From c284f5b2c4e4ed72a2a060cb91353408f5a2b416 Mon Sep 17 00:00:00 2001 From: John Turner Date: Sun, 3 Jul 2022 23:20:44 -0400 Subject: moved non-config functions into a new lisp directory We will now put non-config related functions (any elisp libraries or snippets that I write) into a new ".emacs.d/lisp" directory and separate them from the config code in the ".emacs.d/config" directory. During the transition I decided to move and rewrite the logic that adds all of the libraries to load-path. Now this logic is in two top level files (load-config.el load-local-lisp.el). I needed to remove the config-programming-languages module because it conflicted with the new load-path logic (it was mostly useless anyways). The man advice functions are deleted in this commit but they will be added into the new ".emacs.d/lisp" directory soon. --- config/man/config-man-helper-functions.el | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 config/man/config-man-helper-functions.el (limited to 'config/man/config-man-helper-functions.el') diff --git a/config/man/config-man-helper-functions.el b/config/man/config-man-helper-functions.el deleted file mode 100644 index a58ba75..0000000 --- a/config/man/config-man-helper-functions.el +++ /dev/null @@ -1,31 +0,0 @@ -(defun config-man-pages () - (let* ((manpath (getenv "MANPATH")) - (directories (split-string manpath ":" t)) - (that-exist (seq-filter 'file-exists-p directories)) - (files (mapcar (lambda (d) - (directory-files-recursively d ".*" nil)) - that-exist)) - (flattened (flatten-list files)) - (pages (mapcar 'file-name-nondirectory flattened)) - (without-second-ext (mapcar (lambda (p) - (let ((extension (file-name-extension p))) - (if (string-match-p "^[0-9+]$" extension) - p - (file-name-sans-extension p)))) - pages))) - without-second-ext)) - -(defun config-man-locate-page (page) - (with-temp-buffer - (let ((exit-code (call-process "man" nil (current-buffer) nil "--where" page))) - (when exit-code - (let* ((output (buffer-string)) - (trimmed (string-trim-right output "\n"))) - trimmed))))) - -(defun config-man-advice (orig &rest args) - (interactive) - (let ((page (or args (list (completing-read "Select page: " (config-man-pages) nil t))))) - (apply orig page))) - -(advice-add 'man :around 'config-man-advice) -- cgit v1.2.3