Mercurial > emacs
view lisp/textmodes/reftex-auc.el @ 68529:7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
instead of replace-regexp-in-string.
(crm, multi-prompt): Use mh-require instead of require.
(mh-goto-address-find-address-at-point): Use
mh-line-beginning-position and mh-line-end-position instead of
line-beginning-position and line-end-position. Use
mh-match-string-no-properties instead of match-string-no-properties.
* mh-comp.el (mh-modify-header-field): Use mh-line-beginning-position
and mh-line-end-position instead of line-beginning-position and
line-end-position.
* mh-compat.el (mailabbrev): Use mh-require instead of require.
(mh-assoc-string, mh-display-completion-list, mh-face-foreground)
(mh-face-background): Make docstring consistent.
(mh-require, mh-cancel-timer, mh-display-color-cells)
(mh-line-beginning-position, mh-line-end-position)
(mh-match-string-no-properties, mh-replace-regexp-in-string)
(mh-view-mode-enter): Move definition here from mh-xemacs.el and add
mh- prefix since compatibility functions should have our package
prefix (mh-) by Emacs convention and to avoid messing up checks for
the same functions in other packages.
* mh-e.el (mh-compiling-flag): Move mh-xemacs-compiling-flag here from
mh-xemacs.el and rename.
(mh-xargs): Use mh-line-beginning-position and mh-line-end-position
instead of line-beginning-position and line-end-position.
(mh-defface-compat): Use mh-display-color-cells instead of
display-color-cells.
* mh-folder.el (which-func): Use mh-require instead of require.
* mh-funcs.el (mh-list-folders): Use mh-view-mode-enter instead of
view-mode-enter.
* mh-gnus.el (gnus-util, mm-bodies, mm-decode, mm-view, mml): Use
mh-require instead of require.
* mh-letter.el (mh-letter-header-end, mh-letter-mode)
(mh-letter-next-header-field): Use mh-line-beginning-position and
mh-line-end-position instead of line-beginning-position and
line-end-position.
* mh-limit.el (mh-subject-to-sequence-unthreaded): Use
mh-match-string-no-properties instead of match-string-no-properties.
(mh-narrow-to-header-field): Use mh-line-beginning-position and
mh-line-end-position instead of line-beginning-position and
line-end-position.
* mh-mime.el (mh-mime-inline-part, mh-mm-display-part)
(mh-mh-quote-unescaped-sharp, mh-mh-directive-present-p): Use
mh-line-beginning-position and mh-line-end-position instead of
line-beginning-position and line-end-position.
* mh-search.el (which-func): Use mh-require instead of require.
(mh-make-pick-template, mh-index-visit-folder)
(mh-pick-parse-search-buffer, mh-swish-next-result)
(mh-mairix-next-result, mh-namazu-next-result)
(mh-pick-next-result, mh-grep-next-result)
(mh-index-create-imenu-index, mh-index-match-checksum)
(mh-md5sum-parser, mh-openssl-parser, mh-index-update-maps): Use
mh-line-beginning-position and mh-line-end-position instead of
line-beginning-position and line-end-position.
* mh-seq.el (mh-list-sequences): Use mh-view-mode-enter instead of
view-mode-enter.
(mh-folder-size-flist, mh-parse-flist-output-line)
(mh-add-sequence-notation): Use mh-line-beginning-position and
mh-line-end-position instead of line-beginning-position and
line-end-position.
* mh-show.el (mh-show-addr): Use mh-require instead of require.
* mh-speed.el (mh-folder-speedbar-menu-items, mh-speed-toggle)
(mh-speed-view, mh-folder-speedbar-buttons)
(mh-speed-highlight, mh-speed-goto-folder)
(mh-speed-add-buttons, mh-speed-parse-flists-output)
(mh-speed-invalidate-map, mh-speedbar-change-expand-button-char)
(mh-speed-add-folder): Use mh-line-beginning-position and
mh-line-end-position instead of line-beginning-position and
line-end-position.
(mh-speed-flists): Use mh-cancel-timer instead of cancel-timer.
* mh-thread.el (mh-thread-find-children)
(mh-thread-parse-scan-line, mh-thread-generate): Use
mh-line-beginning-position and mh-line-end-position instead of
line-beginning-position and line-end-position.
* mh-utils.el (mh-colors-available-p): Use mh-display-color-cells
instead of display-color-cells.
(mh-folder-list): Use mh-replace-regexp-in-string instead of
replace-regexp-in-string.
(mh-sub-folders-actual, mh-letter-toggle-header-field-display): Use
mh-line-beginning-position and mh-line-end-position instead of
line-beginning-position and line-end-position.
* mh-comp.el (mh-send-sub): Don't find components file in current
directory--this seems to have been a side-effect of commenting out the
use of an old mh-etc variable. Improve error message.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Wed, 01 Feb 2006 23:24:34 +0000 |
parents | ed770a0a7846 |
children | 067115a6e738 ee12d75eb214 |
line wrap: on
line source
;;; reftex-auc.el --- RefTeX's interface to AUCTeX ;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Author: Carsten Dominik <dominik@science.uva.nl> ;; Version: VERSIONTAG ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: (eval-when-compile (require 'cl)) (provide 'reftex-auc) (require 'reftex) ;;; (defun reftex-plug-flag (which) ;; Tell if a certain flag is set in reftex-plug-into-AUCTeX (or (eq t reftex-plug-into-AUCTeX) (and (listp reftex-plug-into-AUCTeX) (nth which reftex-plug-into-AUCTeX)))) (defun reftex-arg-label (optional &optional prompt definition) "Use `reftex-label', `reftex-reference' or AUCTeX's code to insert label arg. What is being used depends upon `reftex-plug-into-AUCTeX'." (let (label) (cond ((and definition (reftex-plug-flag 1)) ;; Create a new label, with a temporary brace for `reftex-what-macro' (unwind-protect (progn (insert "{") (setq label (or (reftex-label nil t) ""))) (delete-backward-char 1))) ((and (not definition) (reftex-plug-flag 2)) ;; Reference a label with RefTeX (setq label (reftex-reference nil t))) (t ;; AUCTeX's default mechanism (setq label (completing-read (TeX-argument-prompt optional prompt "Key") (LaTeX-label-list))))) (if (and definition (not (string-equal "" label))) (LaTeX-add-labels label)) (TeX-argument-insert label optional))) (defun reftex-arg-cite (optional &optional prompt definition) "Use `reftex-citation' or AUCTeX's code to insert a cite-key macro argument. What is being used depends upon `reftex-plug-into-AUCTeX'." (let (items) (cond ((and (not definition) (reftex-plug-flag 3)) (setq items (list (or (reftex-citation t) "")))) (t (setq prompt (concat (if optional "(Optional) " "") (if prompt prompt "Add key") " (default none): ")) (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list))))) (apply 'LaTeX-add-bibitems items) (TeX-argument-insert (mapconcat 'identity items ",") optional))) (defun reftex-arg-index-tag (optional &optional prompt &rest args) "Prompt for an index tag with completion. This is the name of an index, not the entry." (let (tag taglist) (setq prompt (concat (if optional "(Optional) " "") (if prompt prompt "Index tag") " (default none): ")) (if (and reftex-support-index (reftex-plug-flag 4)) ;; Use RefTeX completion (progn (reftex-access-scan-info nil) (setq taglist (cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol))) tag (completing-read prompt (mapcar 'list taglist)))) ;; Just ask like AUCTeX does. (setq tag (read-string prompt))) (TeX-argument-insert tag optional))) (defun reftex-arg-index (optional &optional prompt &rest args) "Prompt for an index entry completing with known entries. Completion is specific for just one index, if the macro or a tag argument identify one of multiple indices." (let* (tag key) (if (and reftex-support-index (reftex-plug-flag 4)) (progn (reftex-access-scan-info nil) (setq tag (reftex-what-index-tag) key (reftex-index-complete-key (or tag "idx")))) (setq key (completing-read (TeX-argument-prompt optional prompt "Key") (LaTeX-index-entry-list)))) (unless (string-equal "" key) (LaTeX-add-index-entries key)) (TeX-argument-insert key optional))) (defun reftex-what-index-tag () ;; Look backward to find out what index the macro at point belongs to (let ((macro (save-excursion (and (re-search-backward "\\\\[a-zA-Z*]+" nil t) (match-string 0)))) tag entry) (when (and macro (setq entry (assoc macro reftex-index-macro-alist))) (setq tag (nth 1 entry)) (cond ((stringp tag) tag) ((integerp tag) (save-excursion (goto-char (match-end 1)) (or (reftex-nth-arg tag (nth 6 entry)) "idx"))) (t "idx"))))) (defvar LaTeX-label-function) (defun reftex-plug-into-AUCTeX () ;; Replace AUCTeX functions with RefTeX functions. ;; Which functions are replaced is controlled by the variable ;; `reftex-plug-into-AUCTeX'. (if (reftex-plug-flag 0) (setq LaTeX-label-function 'reftex-label) (setq LaTeX-label-function nil)) (and (or (reftex-plug-flag 1) (reftex-plug-flag 2)) (fboundp 'TeX-arg-label) (fset 'TeX-arg-label 'reftex-arg-label)) (and (reftex-plug-flag 3) (fboundp 'TeX-arg-cite) (fset 'TeX-arg-cite 'reftex-arg-cite)) (and (reftex-plug-flag 4) (fboundp 'TeX-arg-index-tag) (fset 'TeX-arg-index-tag 'reftex-arg-index-tag)) (and (reftex-plug-flag 4) (fboundp 'TeX-arg-index) (fset 'TeX-arg-index 'reftex-arg-index))) (defun reftex-toggle-plug-into-AUCTeX () "Toggle Interface between AUCTeX and RefTeX on and off." (interactive) (unless (and (featurep 'tex-site) (featurep 'latex)) (error "AUCTeX's LaTeX mode does not seem to be loaded")) (setq reftex-plug-into-AUCTeX (not reftex-plug-into-AUCTeX)) (reftex-plug-into-AUCTeX) (if reftex-plug-into-AUCTeX (message "RefTeX has been plugged into AUCTeX.") (message "RefTeX no longer interacts with AUCTeX."))) (defun reftex-add-label-environments (entry-list) "Add label environment descriptions to `reftex-label-alist-style'. The format of ENTRY-LIST is exactly like `reftex-label-alist'. See there for details. This function makes it possible to support RefTeX from AUCTeX style files. The entries in ENTRY-LIST will be processed after the user settings in `reftex-label-alist', and before the defaults (specified in `reftex-default-label-alist-entries'). Any changes made to `reftex-label-alist-style' will raise a flag to the effect that the label information is recompiled on next use." (unless reftex-docstruct-symbol (reftex-tie-multifile-symbols)) (when (and reftex-docstruct-symbol (symbolp reftex-docstruct-symbol)) (let ((list (get reftex-docstruct-symbol 'reftex-label-alist-style)) entry changed) (while entry-list (setq entry (pop entry-list)) (unless (member entry list) (setq reftex-tables-dirty t changed t) (push entry list))) (when changed (put reftex-docstruct-symbol 'reftex-label-alist-style list))))) (defalias 'reftex-add-to-label-alist 'reftex-add-label-environments) (defun reftex-add-section-levels (entry-list) "Add entries to the value of `reftex-section-levels'. The added values are kept local to the current document. The format of ENTRY-LIST is a list of cons cells (\"MACRONAME\" . LEVEL). See `reftex-section-levels' for an example." (unless reftex-docstruct-symbol (reftex-tie-multifile-symbols)) (when (and reftex-docstruct-symbol (symbolp reftex-docstruct-symbol)) (let ((list (get reftex-docstruct-symbol 'reftex-section-levels)) entry changed) (while entry-list (setq entry (pop entry-list)) (unless (member entry list) (setq reftex-tables-dirty t changed t) (push entry list))) (when changed (put reftex-docstruct-symbol 'reftex-section-levels list))))) (defun reftex-notice-new-section () (reftex-notice-new 1 'force)) ;;; arch-tag: 4a798e68-3405-421c-a09b-0269aac64ab4 ;;; reftex-auc.el ends here