I made a function in Windows Emacs like:
(defun explorer (&optional tex) (interactive) (let* ((current-path (file-name-directory (buffer-file-name))) (file-path-at-point (file-name-directory (concat current-path (if (or (ffap-file-at-point) (ffap-url-at-point)) (substring (ffap-url-at-point) 5)))))) (if (equal tex t) (shell-command (format "\"C:/Program Files/TeXnicCenter/TeXnicCenter.exe\" %s" (concat (file-name-sans-extension (buffer-file-name)) "\.tex")))) (shell-command (format "explorer.exe %s" (convert-standard-filename (or file-path-at-point current-path))) t nil))) (bind-key "<f11>" 'explorer)
In my opinion, when I press
f11, this function should open window explorer for me, and if I press
C-u f11, it should open a LaTeX file of current directory with Texniccenter.exe, but why doesn't it work, it just open the directory?
PS: if there is some other problems of this function, can anyone give me some advice?