comparison lisp/textmodes/texinfo.el @ 51527:6dd58876664c

(texinfo-enable-quote-macros): Fix thinko. (texinfo-insert-@table): Remove unused arg. (texinfo-show-structure): Remove unused var `source-buffer'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 08 Jun 2003 01:17:04 +0000
parents 167c56f6d789
children 62a53410dbd8
comparison
equal deleted inserted replaced
51526:6445bf9b37f8 51527:6dd58876664c
1 ;;; texinfo.el --- major mode for editing Texinfo files 1 ;;; texinfo.el --- major mode for editing Texinfo files
2 2
3 ;; Copyright (C) 1985, '88, '89, '90, '91, '01, 3 ;; Copyright (C) 1985,88,89,90,91,92,93,96,97,2000,01,03
4 ;; '92, '93, '96, '97, 2000 Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Author: Robert J. Chassell 6 ;; Author: Robert J. Chassell
7 ;; Date: [See date below for texinfo-version] 7 ;; Date: [See date below for texinfo-version]
8 ;; Maintainer: bug-texinfo@gnu.org 8 ;; Maintainer: bug-texinfo@gnu.org
9 ;; Keywords: maint, tex, docs 9 ;; Keywords: maint, tex, docs
664 "Non-nil if inside an environment matching the regexp @ENV." 664 "Non-nil if inside an environment matching the regexp @ENV."
665 (save-excursion 665 (save-excursion
666 (and (re-search-backward (concat "@\\(end\\s +\\)?" env) bound t) 666 (and (re-search-backward (concat "@\\(end\\s +\\)?" env) bound t)
667 (not (match-end 1))))) 667 (not (match-end 1)))))
668 668
669 (defvar texinfo-enable-quote-macros '("@\\(code\\|samp\\|kbd\\)\\>")) 669 (defvar texinfo-enable-quote-macros "@\\(code\\|samp\\|kbd\\)\\>")
670 (defvar texinfo-enable-quote-envs '("example\\>" "lisp\\>")) 670 (defvar texinfo-enable-quote-envs '("example\\>" "lisp\\>"))
671 (defun texinfo-insert-quote (&optional arg) 671 (defun texinfo-insert-quote (&optional arg)
672 "Insert the appropriate quote mark for TeXinfo. 672 "Insert the appropriate quote mark for TeXinfo.
673 Usually inserts the value of `texinfo-open-quote' (normally ``) or 673 Usually inserts the value of `texinfo-open-quote' (normally ``) or
674 `texinfo-close-quote' (normally ''), depending on the context. 674 `texinfo-close-quote' (normally ''), depending on the context.
840 A numeric argument says how many words the braces should surround. 840 A numeric argument says how many words the braces should surround.
841 The default is not to surround any existing words with the braces." 841 The default is not to surround any existing words with the braces."
842 (interactive "P") 842 (interactive "P")
843 (texinfo-insert-@-with-arg "strong" arg)) 843 (texinfo-insert-@-with-arg "strong" arg))
844 844
845 (defun texinfo-insert-@table (&optional arg) 845 (defun texinfo-insert-@table ()
846 "Insert the string `@table' in a Texinfo buffer." 846 "Insert the string `@table' in a Texinfo buffer."
847 (interactive "P") 847 (interactive)
848 (insert "@table ")) 848 (insert "@table "))
849 849
850 (defun texinfo-insert-@var (&optional arg) 850 (defun texinfo-insert-@var (&optional arg)
851 "Insert a `@var{}' command in a Texinfo buffer. 851 "Insert a `@var{}' command in a Texinfo buffer.
852 A numeric argument says how many words the braces should surround. 852 A numeric argument says how many words the braces should surround.
879 \\<occur-mode-map>\\[occur-mode-goto-occurrence], 879 \\<occur-mode-map>\\[occur-mode-goto-occurrence],
880 to jump to the corresponding spot in the Texinfo source file." 880 to jump to the corresponding spot in the Texinfo source file."
881 881
882 (interactive "P") 882 (interactive "P")
883 ;; First, remember current location 883 ;; First, remember current location
884 (let ((source-buffer (current-buffer)) 884 (let (current-location)
885 current-location)
886 (save-excursion 885 (save-excursion
887 (end-of-line) ; so as to find section on current line 886 (end-of-line) ; so as to find section on current line
888 (if (re-search-backward 887 (if (re-search-backward
889 ;; do not require `texinfo-section-types-regexp' in texnfo-upd.el 888 ;; do not require `texinfo-section-types-regexp' in texnfo-upd.el
890 "^@\\(chapter \\|sect\\|subs\\|subh\\|unnum\\|major\\|chapheading \\|heading \\|appendix\\)" 889 "^@\\(chapter \\|sect\\|subs\\|subh\\|unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
891 nil t) 890 nil t)
892 (setq current-location 891 (setq current-location
893 (progn 892 (progn
894 (beginning-of-line) 893 (beginning-of-line)
895 (buffer-substring (point) (progn (end-of-line) (point))))) 894 (buffer-substring (point) (progn (end-of-line) (point)))))
896 ;; else point is located before before any section command 895 ;; else point is located before any section command.
897 (setq current-location "tex"))) 896 (setq current-location "tex")))
898 ;; Second, create and format an *Occur* buffer 897 ;; Second, create and format an *Occur* buffer
899 (save-excursion 898 (save-excursion
900 (goto-char (point-min)) 899 (goto-char (point-min))
901 (if nodes-too 900 (if nodes-too