72 lines
4.4 KiB
Markdown
72 lines
4.4 KiB
Markdown
|
---
|
|||
|
title: Doc-Viewモード
|
|||
|
author: kazu634
|
|||
|
date: 2007-09-01
|
|||
|
url: /2007/09/01/_644/
|
|||
|
wordtwit_post_info:
|
|||
|
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:3205;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
|
|||
|
categories:
|
|||
|
- Emacs
|
|||
|
|
|||
|
---
|
|||
|
<div class="section">
|
|||
|
<p>
|
|||
|
Emacsを使い始めて、段々とその便利さがわかってきた。現在はLaTeXで修論を書いているのですが、LaTeXの打ち込みとコンパイルまでを一括して処理してくれています。
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
そんな感じで便利さを体感していると、なんと<a href="http://www.tsdh.de/cgi-bin/wiki.pl/doc-view.el" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.tsdh.de/cgi-bin/wiki.pl/doc-view.el', 'EmacsでPDFを閲覧できる');" target="blank">EmacsでPDFを閲覧できる</a>ことを知りました。使ってみると、Windowsでは使えない文字で作業用ファイルを書き込もうとしていて、PDFが閲覧できませんでした(..;)どうにかならんのかと検索していたら、すでに他の人も作者の人に指摘済みでした(→<a href="http://www.mail-archive.com/gnu-emacs-sources@gnu.org/msg01114.html" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.mail-archive.com/gnu-emacs-sources@gnu.org/msg01114.html', 'doc-view.el — View PDF/PostStript/DVI files in Emacs');" target="blank">doc-view.el — View PDF/PostStript/DVI files in Emacs</a>):
|
|||
|
</p>
|
|||
|
|
|||
|
<blockquote>
|
|||
|
<p>
|
|||
|
[ Crosspost & Followup-To: gnu.emacs.help ]
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
On Wed, Aug 22 2007, Tassilo Horn wrote:
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
> (defcustom doc-view-cache-directory “/tmp/doc-view”
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Maybe use `temporary-file-directory’ or `make-temp-name’.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
>   “The base directory, where the PNG imoges will be saved.”<br />                                       images
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
> (defun doc-view-file-name-to-directory-name (file)<br />>   “Return the directory where the png files of FILE should be saved.<br />><br />> It’a a subdirectory of `doc-view-cache-directory’.”<br />>   (concat (directory-file-name doc-view-cache-directory)<br />>           “/”<br />>           (replace-regexp-in-string “/” “!” file)))
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Probably not portable, I think.  Windows users may set the directory<br />to “c: ooar”.  Maybe you could do like the package formerly knows<br />as `tumme.el’ does it.  Ah, it’s `image-dired.el’ now:<br />`image-dired-thumb-name’.
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
> (defun doc-view-convert-file (file)<br />[…]<br />>   (let* <span class="footnote"><a href="/sirocco634/#f1" name="fn1" title="dir (doc-view-file-name-to-directory-name file">*1</a></span><br />>          (png-file (concat dir “/” “page.png”)))
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
,—-[ (info “(elisp)Directory Names”) ]<br />|    If you want to use a directory file name in making such a<br />| combination, you must first convert it to a directory name using<br />| `file-name-as-directory’:<br />| <br />|      (concat (file-name-as-directory DIRFILE) RELFILE)<br />| <br />| Don’t try concatenating a slash by hand, as in<br />| <br />|      ;;; Wrong!<br />|      (concat DIRFILE “/” RELFILE)<br />| <br />| because this is not portable.  Always use `file-name-as-directory’.<br />`—-
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
Bye, Reiner.
|
|||
|
</p>
|
|||
|
</blockquote>
|
|||
|
|
|||
|
<p>
|
|||
|
というわけで、もう一度elispを導入してみようと思う。
|
|||
|
</p>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="footnote">
|
|||
|
<p class="footnote">
|
|||
|
<a href="/sirocco634/#fn1" name="f1">*1</a>:dir (doc-view-file-name-to-directory-name file
|
|||
|
</p>
|
|||
|
</div>
|