⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 texinfo.el

📁 gcc-2.95.3 Linux下最常用的C编译器
💻 EL
📖 第 1 页 / 共 3 页
字号:
;; number of words (actually s-exprs) that should be surrounded by;; braces.  Thus you can first paste a variable name into a .texinfo;; buffer, then say C-u 1 C-c C-c v at the beginning of the just;; pasted variable name to put @var{...} *around* the variable name.;; Operate on previous word or words with negative arg.;; These commands use texinfo-insert-@-with-arg(defun texinfo-insert-@-with-arg (string &optional arg)  (if arg      (progn        (setq arg (prefix-numeric-value arg))        (if (< arg 0)            (progn              (skip-chars-backward " \t\n\r\f")              (save-excursion                (forward-sexp arg)                (insert "@" string "{"))              (insert "}"))          (skip-chars-forward " \t\n\r\f")          (insert "@" string "{")          (forward-sexp arg)          (insert "}")))    (insert "@" string "{}")    (backward-char)))(defun texinfo-insert-braces ()  "Make a pair of braces and be poised to type inside of them.Use \\[up-list] to move forward out of the braces."  (interactive)  (insert "{}")  (backward-char))(defun texinfo-insert-@code (&optional arg)  "Insert a `@code{...}' command in a Texinfo buffer.A numeric argument says how many words the braces should surround.The default is not to surround any existing words with the braces."  (interactive "P")  (texinfo-insert-@-with-arg "code" arg))(defun texinfo-insert-@dfn (&optional arg)  "Insert a `@dfn{...}' command in a Texinfo buffer.A numeric argument says how many words the braces should surround.The default is not to surround any existing words with the braces."  (interactive "P")  (texinfo-insert-@-with-arg "dfn" arg))(defun texinfo-insert-@example ()  "Insert the string `@example' in a Texinfo buffer."  (interactive)  (insert "@example\n"))(defun texinfo-insert-@file (&optional arg)  "Insert a `@file{...}' command in a Texinfo buffer.A numeric argument says how many words the braces should surround.The default is not to surround any existing words with the braces."  (interactive "P")  (texinfo-insert-@-with-arg "file" arg))(defun texinfo-insert-@item ()  "Insert the string `@item' in a Texinfo buffer."  (interactive)  (insert "@item")  (newline))(defun texinfo-insert-@kbd (&optional arg)  "Insert a `@kbd{...}' command in a Texinfo buffer.A numeric argument says how many words the braces should surround.The default is not to surround any existing words with the braces."  (interactive "P")  (texinfo-insert-@-with-arg "kbd" arg))(defun texinfo-insert-@node ()  "Insert the string `@node' in a Texinfo buffer.This also inserts on the following line a comment indicatingthe order of arguments to @node."  (interactive)  (insert "@node \n@comment  node-name,  next,  previous,  up")  (forward-line -1)  (forward-char 6))(defun texinfo-insert-@noindent ()  "Insert the string `@noindent' in a Texinfo buffer."  (interactive)  (insert "@noindent\n"))(defun texinfo-insert-@samp (&optional arg)  "Insert a `@samp{...}' command in a Texinfo buffer.A numeric argument says how many words the braces should surround.The default is not to surround any existing words with the braces."  (interactive "P")  (texinfo-insert-@-with-arg "samp" arg))(defun texinfo-insert-@table (&optional arg)  "Insert the string `@table' in a Texinfo buffer."  (interactive "P")  (insert "@table "))(defun texinfo-insert-@var (&optional arg)  "Insert a `@var{}' command in a Texinfo buffer.A numeric argument says how many words the braces should surround.The default is not to surround any existing words with the braces."  (interactive "P")  (texinfo-insert-@-with-arg "var" arg));;; Texinfo file structure;; These are defined in texnfo-upd.el.  defvars here avoid warnings.(defvar texinfo-section-types-regexp)(defvar texinfo-section-level-regexp)(defvar texinfo-subsection-level-regexp)(defvar texinfo-subsubsection-level-regexp)(defun texinfo-show-structure (&optional nodes-too)  "Show the structure of a Texinfo file.List the lines in the file that begin with the @-sign commands for@chapter, @section, and the like.With optional argument (prefix if interactive), list both the lineswith @-sign commands for @chapter, @section, and the like, and list@node lines.Lines with structuring commands beginning in them are displayed inanother buffer named `*Occur*'.  In that buffer, you can move point toone of those lines and then use \\<occur-mode-map>\\[occur-mode-goto-occurrence],to jump to the corresponding spot in the Texinfo source file."  (interactive "P")  (require 'texnfo-upd)  (save-excursion    (goto-char (point-min))    (if nodes-too        (occur (concat "\\(^@node\\)\\|" texinfo-section-types-regexp))      (occur texinfo-section-types-regexp)))  (pop-to-buffer "*Occur*")  (goto-char (point-min))  (flush-lines "-----")  ;; Now format the "*Occur*" buffer to show the structure.  ;; Thanks to ceder@signum.se (Per Cederqvist)  (goto-char (point-max))  (let ((margin 5))    (while (re-search-backward "^ *[0-9]*:" nil 0)      (re-search-forward ":")      (setq margin            (cond             ((looking-at               (concat "@\\(" texinfo-chapter-level-regexp "\\)")) 5)             ;; ((looking-at "@chapter ") 5)             ;; ((looking-at "@unnumbered ") 5)             ;; ((looking-at "@appendix ") 5)             ;; ((looking-at "@majorheading ") 5)             ;; ((looking-at "@chapheading ") 5)             ((looking-at               (concat "@\\(" texinfo-section-level-regexp "\\)")) 9)             ;; ((looking-at "@section ") 9)             ;; ((looking-at "@unnumberedsec ") 9)             ;; ((looking-at "@appendixsec ") 9)             ;; ((looking-at "@heading ") 9)             ((looking-at               (concat "@\\(" texinfo-subsection-level-regexp "\\)")) 13)             ;; ((looking-at "@subsection ") 13)             ;; ((looking-at "@unnumberedsubsec ") 13)             ;; ((looking-at "@appendixsubsec ") 13)             ;; ((looking-at "@subheading ") 13)             ((looking-at               (concat "@\\(" texinfo-subsubsection-level-regexp "\\)")) 17)             ;; ((looking-at "@subsubsection ") 17)             ;; ((looking-at "@unnumberedsubsubsec ") 17)             ;; ((looking-at "@appendixsubsubsec ") 17)             ;; ((looking-at "@subsubheading ") 17)             (t margin)))      (indent-to-column margin)      (beginning-of-line))));;; The  tex  and  print  function definitions:(defcustom texinfo-texi2dvi-command "texi2dvi"  "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer."  :type 'string  :group 'texinfo)(defcustom texinfo-tex-command "tex"  "*Command used by `texinfo-tex-region' to run TeX on a region."  :type 'string  :group 'texinfo)(defcustom texinfo-texindex-command "texindex"  "*Command used by `texinfo-texindex' to sort unsorted index files."  :type 'string  :group 'texinfo)(defcustom texinfo-delete-from-print-queue-command "lprm"  "*Command string used to delete a job from the line printer queue.Command is used by \\[texinfo-delete-from-print-queue] based onnumber provided by a previous \\[tex-show-print-queue]command."  :type 'string  :group 'texinfo)(defvar texinfo-tex-trailer "@bye"  "String appended after a region sent to TeX by `texinfo-tex-region'.")(defun texinfo-tex-region (beg end)  "Run TeX on the current region.This works by writing a temporary file (`tex-zap-file') in the directorythat is the value of `tex-directory', then running TeX on that file.The first line of the buffer is copied to thetemporary file; and if the buffer has a header, it is written to thetemporary file before the region itself.  The buffer's header is all linesbetween the strings defined by `tex-start-of-header' and `tex-end-of-header'inclusive.  The header must start in the first 100 lines.The value of `texinfo-tex-trailer' is appended to the temporary file after the region."  (interactive "r")  (require 'tex-mode)  (let ((tex-command texinfo-tex-command)	(tex-trailer "@bye\n"))    (tex-region beg end)))(defun texinfo-tex-buffer ()  "Run TeX on visited file, once or twice, to make a correct `.dvi' file."  (interactive)  (require 'tex-mode)  (let ((tex-command texinfo-texi2dvi-command))    (tex-buffer)))(defun texinfo-texindex ()  "Run `texindex' on unsorted index files.The index files are made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].This runs the shell command defined by `texinfo-texindex-command'."  (interactive)  (require 'tex-mode)  (tex-send-command texinfo-texindex-command (concat tex-zap-file ".??"))  ;; alternatively  ;; (send-string "tex-shell"  ;;              (concat texinfo-texindex-command  ;;                      " " tex-zap-file ".??" "\n"))  (tex-recenter-output-buffer nil))(defun texinfo-tex-print ()  "Print `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].This runs the shell command defined by `tex-dvi-print-command'."  (interactive)  (require 'tex-mode)  (tex-print))(defun texinfo-tex-view ()  "View `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].This runs the shell command defined by `tex-dvi-view-command'."  (interactive)  (require 'tex-mode)  (tex-view))(defun texinfo-quit-job ()  "Quit currently running TeX job, by sending an `x' to it."  (interactive)  (if (not (get-process "tex-shell"))      (error "No TeX shell running"))  (tex-send-command "x"));; alternatively:;; save-excursion;;   (set-buffer (get-buffer "*tex-shell*"));;   (goto-char (point-max));;   (insert "x");;   (comint-send-input)(defun texinfo-delete-from-print-queue (job-number)  "Delete job from the line printer spooling queue.You are prompted for the job number (use a number shown by a previous\\[tex-show-print-queue] command)."  (interactive "nPrinter job number for deletion: ")  (require 'tex-mode)  (if (tex-shell-running)      (tex-kill-job)    (tex-start-shell))  (tex-send-command texinfo-delete-from-print-queue-command job-number)  ;; alternatively  ;; (send-string "tex-shell"  ;;              (concat  ;;               texinfo-delete-from-print-queue-command  ;;               " "  ;;               job-number"\n"))  (tex-recenter-output-buffer nil))(provide 'texinfo);;; texinfo.el ends here

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -