1 ;;; inputenc.el --- AUCTeX style for `inputenc.sty'
3 ;; Copyright (C) 2005 Free Software Foundation, Inc.
5 ;; Author: Arne Jørgensen <arne@arnested.dk>
8 ;; This file is part of AUCTeX.
10 ;; AUCTeX is free software; you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; AUCTeX is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
22 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 ;; MA 02110-1301, USA.
27 ;; This file adds support for `inputenc.sty'.
31 (defun LaTeX-inputenc-package-options nil
32 "Prompt for package options for the inputenc package."
33 ;; separate the condition in three to silence the byte compiler
34 (if (boundp 'latex-inputenc-coding-alist)
35 (when (fboundp 'latexenc-coding-system-to-inputenc)
36 (when (fboundp 'latexenc-inputenc-to-coding-system)
37 (let ((default (latexenc-coding-system-to-inputenc
38 (or coding-system-for-write
39 buffer-file-coding-system)))
40 (selected 'undecided))
41 (setq selected (completing-read
43 (format "Input encoding (default %s): " default)
45 (mapcar 'car latex-inputenc-coding-alist)
52 ;; if necessary offer to set the coding system for saving
53 ;; this buffer based on the selected input encoding
57 (or coding-system-for-write
58 buffer-file-coding-system))
60 (latexenc-inputenc-to-coding-system selected))))
61 (y-or-n-p "Set coding system for saving this buffer? ")
62 (set-buffer-file-coding-system
64 (latexenc-inputenc-to-coding-system selected)))
67 ;; return selected input encoding
69 (read-string "Input encoding: ")))
71 (defun LaTeX-arg-inputenc-inputenc (optional)
72 "Prompt for input encoding."
73 (TeX-argument-insert (LaTeX-inputenc-package-options) nil))
80 '("inputencoding" LaTeX-arg-inputenc-inputenc))))
86 ;;; inputenc.el ends here