diff options
| author | Stefan Monnier | 2008-12-08 16:30:43 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-12-08 16:30:43 +0000 |
| commit | bdaf166cdf3a5bcc00963fe5ca1a91fdd421f2d5 (patch) | |
| tree | 439c5982a54e008ebe78f14fdbd8e1dc60192ac8 /lisp/autoinsert.el | |
| parent | 7c19d3aedbc55c4458bd8911aaa614c0c7f2c316 (diff) | |
| download | emacs-bdaf166cdf3a5bcc00963fe5ca1a91fdd421f2d5.tar.gz emacs-bdaf166cdf3a5bcc00963fe5ca1a91fdd421f2d5.zip | |
(auto-insert): Use expand-file-name instead of concat.
Suggested by Eric Hanchrow <eric.hanchrow@gmail.com>.
Diffstat (limited to 'lisp/autoinsert.el')
| -rw-r--r-- | lisp/autoinsert.el | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 92a5f9f3f92..b276cc18f99 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el | |||
| @@ -343,19 +343,19 @@ Matches the visited file name against the elements of `auto-insert-alist'." | |||
| 343 | 343 | ||
| 344 | ;; Now, if we found something, do it | 344 | ;; Now, if we found something, do it |
| 345 | (and action | 345 | (and action |
| 346 | (if (stringp action) | 346 | (or (not (stringp action)) |
| 347 | (file-readable-p (concat auto-insert-directory action)) | 347 | (file-readable-p (expand-file-name |
| 348 | t) | 348 | action auto-insert-directory))) |
| 349 | (if auto-insert-query | 349 | (or (not auto-insert-query) |
| 350 | (or (if (eq auto-insert-query 'function) | 350 | (if (eq auto-insert-query 'function) |
| 351 | (eq this-command 'auto-insert)) | 351 | (eq this-command 'auto-insert)) |
| 352 | (y-or-n-p (format auto-insert-prompt desc))) | 352 | (y-or-n-p (format auto-insert-prompt desc))) |
| 353 | t) | ||
| 354 | (mapc | 353 | (mapc |
| 355 | (lambda (action) | 354 | (lambda (action) |
| 356 | (if (stringp action) | 355 | (if (stringp action) |
| 357 | (if (file-readable-p | 356 | (if (file-readable-p |
| 358 | (setq action (concat auto-insert-directory action))) | 357 | (setq action (expand-file-name |
| 358 | action auto-insert-directory))) | ||
| 359 | (insert-file-contents action)) | 359 | (insert-file-contents action)) |
| 360 | (save-window-excursion | 360 | (save-window-excursion |
| 361 | ;; make buffer visible before skeleton or function | 361 | ;; make buffer visible before skeleton or function |
| @@ -393,8 +393,7 @@ or if CONDITION had no actions, after all other CONDITIONs." | |||
| 393 | (vector action (cdr elt))))) | 393 | (vector action (cdr elt))))) |
| 394 | (if after | 394 | (if after |
| 395 | (nconc auto-insert-alist (list (cons condition action))) | 395 | (nconc auto-insert-alist (list (cons condition action))) |
| 396 | (setq auto-insert-alist (cons (cons condition action) | 396 | (push (cons condition action) auto-insert-alist))))) |
| 397 | auto-insert-alist)))))) | ||
| 398 | 397 | ||
| 399 | ;;;###autoload | 398 | ;;;###autoload |
| 400 | (define-minor-mode auto-insert-mode | 399 | (define-minor-mode auto-insert-mode |