Program name: Difference between revisions

Content added Content deleted
m (Emacs Lisp: Fix indentation)
Line 667: Line 667:


(defun main ()
(defun main ()
(let ((program (nth 2 command-line-args)))
(let ((program (nth 2 command-line-args)))
(message "Program: %s" program)))</lang>
(message "Program: %s" program)))</lang>


<code>load-file-name</code> is the ".el" or ".elc" currently being loaded. Within a batch <code>-l</code> it will be the script name, but within sub-loads like <code>require</code> etc it is that sub-load.
<code>load-file-name</code> is the ".el" or ".elc" currently being loaded. Within a batch <code>-l</code> it will be the script name, but within sub-loads like <code>require</code> etc it is that sub-load.