yatex

view yatex23.el @ 340:3206061867ae

let* should be
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 18 Dec 2014 17:57:46 +0900
parents 9cef5d10a0f1
children 43fb2bf403e4
line source
1 ;;; yatex23.el --- YaTeX facilities for Emacs 23 or later -*- coding: sjis -*-
2 ;;; (c)2014 by HIROSE Yuuji.[yuuji@yatex.org]
3 ;;; Last modified Tue Dec 16 11:29:14 2014 on firestorm
4 ;;; $Id:$
6 ;;; Code:
7 (defun YaTeX-dnd-handler (uri action)
8 "DnD handler for yatex-mode
9 Convert local image URI to \\includegraphcis{} and
10 .tex file names to \\include{}."
11 (save-excursion
12 (YaTeX-visit-main t)
13 (let*((file (dnd-get-local-file-name uri))
14 (path (file-relative-name file))
15 (insert-file-directory nil)
16 (case-fold-search t))
17 (cond
18 ((memq action '(copy link move private))
19 (cond
20 ((string-match "\\.\\(jpe?g\\|png\\|gif\\|bmp\\|tiff?\\|e?ps\\|pdf\\)$" path)
21 (insert "\\includegraphics")
22 (insert "{" (YaTeX::includegraphics 1 path t) "}")
23 (YaTeX-package-auto-usepackage "includegraphics" 'section))
24 ((string-match "\\.tex$" path)
25 (insert "\\include{" path "}"))
26 ))
27 (t (message "%s" action))))))
29 (provide 'yatex23)
31 ; Local variables:
32 ; fill-prefix: ";;; "
33 ; paragraph-start: "^$\\| \\|;;;$"
34 ; paragraph-separate: "^$\\| \\|;;;$"
35 ; coding: sjis
36 ; End: