How to make a Lisp function call java while being aware of packages?
问题 In Emacs use a Lisp function to run the Java program the current file correspond to. (defun java-run-current-file () "Runs the java program the current file correspond to" (interactive) (shell-command (concat "java " (file-name-sans-extension (file-name-nondirectory (buffer-file-name)))))) It works by stripping the current file name of its path and extension and using it as an argument to java which is run from the path where the file is at. The problem with this approach is that if the