summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-05-29 22:13:22 (GMT)
committer Nicolas Goaziou <mail@nicolasgoaziou.fr>2016-05-29 22:13:22 (GMT)
commit3d0ade9571a911d5f294f686334170af40c3a098 (patch)
tree1aeb68422721a4462e0a614bde935ba96fd0e732
parentcf77060d184dc691607f69249053aa240fa09c4c (diff)
downloadorg-mode-master.zip
org-mode-master.tar.gz
By default, use relative name for compilationHEADmaster
* lisp/org.el (org-compile-file): %f meant relative name of compiled file. %F is its full name. Also always set `default-directory' to the directory of the source. Reported-by: Stig Brautaset <stig@brautaset.org> <http://permalink.gmane.org/gmane.emacs.orgmode/107348>
-rw-r--r--lisp/org.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 87989c6..6f7a2c7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22884,9 +22884,9 @@ If PROCESS is a function, it is called with a single argument:
the SOURCE file.
If it is a list of commands, each of them is called using
-`shell-command'. By default, in each command, %b, %f and %o are
-replaced, respectively, with SOURCE base name, SOURCE full name
-and SOURCE directory. It is possible, however, to use more
+`shell-command'. By default, in each command, %b, %f, %F and %o
+are replaced with, respectively, SOURCE base name, name, full
+name and directory. It is possible, however, to use more
place-holders by specifying them in optional argument SPEC, as an
alist following the pattern (CHARACTER . REPLACEMENT-STRING).
@@ -22896,13 +22896,12 @@ it for output.
`default-directory' is set to SOURCE directory during the whole
process."
- (let* ((base-name (file-name-sans-extension (file-name-nondirectory source)))
+ (let* ((source-name (file-name-nondirectory source))
+ (base-name (file-name-sans-extension source-name))
(full-name (file-truename source))
(out-dir (file-name-directory source))
;; Properly set working directory for compilation.
- (default-directory (if (file-name-absolute-p source)
- (file-name-directory full-name)
- default-directory))
+ (default-directory (file-name-directory full-name))
(time (current-time))
(err-msg (if (stringp err-msg) (concat ". " err-msg) "")))
(save-window-excursion
@@ -22912,7 +22911,8 @@ process."
(let ((log-buf (and log-buf (get-buffer-create log-buf)))
(spec (append spec
`((?b . ,(shell-quote-argument base-name))
- (?f . ,(shell-quote-argument full-name))
+ (?f . ,(shell-quote-argument source-name))
+ (?F . ,(shell-quote-argument full-name))
(?o . ,(shell-quote-argument out-dir))))))
(dolist (command process)
(shell-command (format-spec command spec) log-buf))))