# HG changeset patch # User HIROSE Yuuji # Date 1785560251 -32400 # Node ID 0018833906a16c8886613d6f102f40cf29e71f18 # Parent d58c4f69369b0b8d8a3d2611a1640a41e4f6c43e# Parent 6a0fea36298fdfdd32e8346eaa252cc358ec807a merged diff -r d58c4f69369b -r 0018833906a1 yahtml.el --- a/yahtml.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yahtml.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,5 +1,5 @@ -;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*- -;;; (c) 1994-2025 by HIROSE Yuuji [yuuji(@)yatex.org] +;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis; lexical-binding: nil -*- +;;; (c) 1994-2026 by HIROSE Yuuji [yuuji(@)yatex.org] ;;; $Id$ (defconst yahtml-revision-number "1.84" @@ -202,8 +202,8 @@ (defvar yahtml-path-url-alist nil "*Alist of unix path name vs. URL name of WWW server. Ex. -'((\"/usr/home/yuuji/http\" . \"http://www.comp.ae.keio.ac.jp/~yuuji\") - (\"/home/yuuji/http\" . \"http://www.gentei.org/~yuuji\"))") +((\"/usr/home/yuuji/http\" . \"http://www.comp.ae.keio.ac.jp/~yuuji\") + (\"/home/yuuji/http\" . \"http://www.gentei.org/~yuuji\"))") (defvar yahtml-directory-index "index.html" "*Directory index file name; Consult your site's WWW administrator.") @@ -263,7 +263,7 @@ "*Non-nil for translate hyphens to - when comment-region") (defvar yahtml-escape-chars 'ask "*Escape reserved characters to URL-encoding or not. -Nil for never, t for everytime, and 'ask for inquiring +Nil for never, t for everytime, and `ask' for inquiring at each reserved chars.") (defvar yahtml-use-font-lock (and (featurep 'font-lock) @@ -297,6 +297,8 @@ (or (and (boundp 'shell-command-option) shell-command-option) (if (eq system-type 'ms-dos) "/c" "-c"))) (defvar yahtml-use-highlighting (or yahtml-use-font-lock yahtml-use-hilit19)) +(defvar yahtml-current-file-name nil) +(defvar yahtml-css-class-alist nil "Alist of elements vs. their classes") (defun yahtml-define-begend-key-normal (key env &optional map func) "Define short cut yahtml-insert-begend key." @@ -307,10 +309,11 @@ (list func 'arg env)) map))) -(defun yahtml-define-begend-region-key (key env &optional map) +(defun yahtml-define-begend-region-key (key env &optional map func) "Define short cut yahtml-insert-begend-region key." (YaTeX-define-key key (list 'lambda nil '(interactive) - (list 'yahtml-insert-begend t env)) map)) + (list (or func 'yahtml-insert-begend) + t env)) map)) (defun yahtml-define-begend-key (key env &optional map) "Define short cut key for begin type completion. @@ -328,7 +331,7 @@ (yahtml-define-begend-key-normal key tag map 'yahtml-insert-tag) (if YaTeX-inhibit-prefix-letter nil (yahtml-define-begend-region-key - (concat (upcase (substring key 0 1)) (substring key 1)) env map + (concat (upcase (substring key 0 1)) (substring key 1)) tag map 'yahtml-insert-tag))) (if yahtml-mode-map nil @@ -602,8 +605,7 @@ (setq charset 1)) ((string-match "utf-8" charset) (setq charset 4)) - (t (setq charset nil))) - (setq dir ""))) + (t (setq charset nil))))) (if (featurep 'mule) (setq charset (cdr (assq charset YaTeX-kanji-code-alist)))) charset)) @@ -651,7 +653,7 @@ (setq kanji-fileio-code coding)))) (setq major-mode 'yahtml-mode mode-name "yahtml" - YaTeX-current-file-name (file-name-nondirectory + yahtml-current-file-name (file-name-nondirectory (or (buffer-file-name) "")) local-abbrev-table yahtml-mode-abbrev-table) (mapcar @@ -755,6 +757,7 @@ (defvar yahtml-menu-map-listing nil "Menu map of yahtml(listing)") (defvar yahtml-menu-map-logical nil "Menu map of yahtml(logical tags)") (defvar yahtml-menu-map-typeface nil "Menu map of yahtml(typeface tags)") +(defvar yahtml-menu-map-item nil) ;;; Variables for mosaic url history (defvar yahtml-urls nil "Alist of global history") @@ -1359,7 +1362,7 @@ (defun yahtml-get-image-info (file) "Return the information on the image file FILE. -Returns list of '(WIDTH HEIGHT BYTES DEPTH COMMENTLIST)." +Returns list of `(WIDTH HEIGHT BYTES DEPTH COMMENTLIST)'." (save-excursion (let*((tmpbuf (get-buffer-create " *imgheader*")) width height bytes depth comment @@ -1826,6 +1829,16 @@ (if (or yahtml-always-/p arg) (yahtml-insert-tag arg "p") (yahtml-insert-single "p"))) +;;; ---------- translate to entity references ---------- +(defvar yahtml-entity-reference-chars-alist-default + ;'((?> . "gt") (?< . "lt") (?& . "amp") (?\" . "quot") (?' . "apos")) + '((?> . "gt") (?< . "lt") (?& . "amp") (?\" . "quot")) + "Default translation table from character to entity reference") +(defvar yahtml-entity-reference-chars-alist nil + "*Translation table from character to entity reference") +(defvar yahtml-entity-reference-chars-regexp nil) +(defvar yahtml-entity-reference-chars-reverse-regexp nil) + (defun yahtml-insert-amps (arg) "Insert char-entity references via ampersand" ;; Thanks; http://www.tsc.co.jp/~asada/html/wdg40_f/entities/ @@ -1835,9 +1848,9 @@ yahtml-entity-reference-chars-alist)) (l list)) (while l - (setq mess (format "%s %c" mess (car (car l)) (cdr (car l))) + (setq mess (format "%s %c=%s" mess (car (car l)) (cdr (car l))) l (cdr l))) - (message "Char-entity reference: %s SPC=& RET=&; BS=%s Other=&#..;" + (message "Char-entity: %s RET=&; BS=%s Other=&#..;" mess (if YaTeX-japan "直前の文字" "Preceding-Char")) (setq c (read-char)) (cond @@ -1850,7 +1863,7 @@ (insert ?&)) ((and (memq c '(127 8)) (setq c (preceding-char)) - (delete-backward-char 1) + (delete-char -1) nil)) ;Fall through to the next 't block (t (insert (format "&#x%x;" c)))))) @@ -2022,7 +2035,8 @@ t))))) (defun yahtml-jump-to-name (name) - "Jump to html's named tag." + "Jump to html's named tag. +Using dynamic variable in yahtml-goto-corresponding-href()." (setq name (format "\\(name\\|id\\)\\s *=\\s *\"?%s\\>\"?" name)) (or (and (re-search-forward name nil t) (goto-char (match-beginning 0))) (and (re-search-backward name nil t) (goto-char (match-beginning 0))) @@ -2386,7 +2400,6 @@ ((yahtml-change-command)))) ;;; ---------- commenting ---------- - (defun yahtml-comment-region (&optional uncom) "Comment out region or environment." (interactive) @@ -2427,15 +2440,6 @@ (interactive) (yahtml-comment-region t)) -;;; ---------- translate to entity references ---------- -(defvar yahtml-entity-reference-chars-alist-default - ;'((?> . "gt") (?< . "lt") (?& . "amp") (?\" . "quot") (?' . "apos")) - '((?> . "gt") (?< . "lt") (?& . "amp") (?\" . "quot")) - "Default translation table from character to entity reference") -(defvar yahtml-entity-reference-chars-alist nil - "*Translation table from character to entity reference") -(defvar yahtml-entity-reference-chars-regexp nil) -(defvar yahtml-entity-reference-chars-reverse-regexp nil) (defun yahtml-entity-reference-chars-setup () (let ((list (append yahtml-entity-reference-chars-alist-default @@ -2510,7 +2514,8 @@ (cond ((string-match revrex right) (setq ch (YaTeX-rassoc - (substring right (match-beginning 1) (match-end 1))) + (substring right (match-beginning 1) (match-end 1)) + ct) b0 (substring right 0 (match-beginning 0)) right (substring right (match-end 0)) left (concat left @@ -2755,7 +2760,7 @@ (itms "<\\(dt\\|dd\\|li\\|t[rdh]\\|option\\)\\b") (excludes "\\b\\(a\\|p\\|span\\|code\\|tt\\|em\\|u\\|i\\|big\\|small\\|font\\)\\b") - inenv p col peol (case-fold-search t)) + inenv p col peol op (case-fold-search t)) (save-excursion (beginning-of-line) (setq inenv (or (yahtml-inner-environment-but excludes t) @@ -2869,8 +2874,8 @@ (defun yahtml-lint-buffer (buf) "Call lint on buffer BUF." + (interactive "bCall lint on buffer: ") (require 'yatexprc) - (interactive "bCall lint on buffer: ") (setq buf (get-buffer buf)) (YaTeX-save-buffers) (let ((bcmd (YaTeX-get-builtin "lint"))) @@ -3179,7 +3184,7 @@ (end-of-line) (if (re-search-backward yahtml-error-line-regexp nil t) (let ((f (if (string= "" (YaTeX-match-string 1)) - YaTeX-current-file-name + yahtml-current-file-name (YaTeX-match-string 1))) (l (YaTeX-str2int (or (YaTeX-match-string 2) (YaTeX-match-string 3))))) @@ -3190,9 +3195,6 @@ (message "No line number usage")))) ;;; ---------- Style Sheet Support ---------- -(defvar yahtml-css-class-alist nil - "Alist of elements vs. their classes") - (defun yahtml-css-collect-classes-region (beg end &optional initial) (save-excursion (save-restriction diff -r d58c4f69369b -r 0018833906a1 yatex.el --- a/yatex.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatex.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,6 +1,6 @@ -;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*- -;;; (c)1991-2025 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Mon Feb 24 19:01:20 2025 on firestorm +;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis; lexical-binding: nil -*- +;;; (c)1991-2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:46:01 2026 on firestorm ;;; $Id$ ;;; The latest version of this software is always available at; ;;; https://www.yatex.org/ @@ -16,7 +16,7 @@ ;;; Code: (require 'yatexlib) -(defconst YaTeX-revision-number "1.84" +(defconst YaTeX-revision-number "1.84.1" "Revision number of running yatex.el") ;---------- Local variables ---------- @@ -263,6 +263,8 @@ "*(for Emacs 24.4+) Pass this value to electric-indent-local-mode. -1 means `off'.") +(defvar YaTeX-saved-screen-height nil "Not used in Unix systems") + ;;-- Math mode values -- (defvar YaTeX-math-key-list-default @@ -785,10 +787,6 @@ (or (featurep 'xemacs) (set (make-local-variable 'font-lock-defaults) (get 'yatex-mode 'font-lock-defaults))) - (and (boundp 'global-font-lock-mode) - global-font-lock-mode - ;; Workaround for Emacs30 on which global-font-lock ignored - (font-lock-mode 1)) )) (use-local-map YaTeX-mode-map) (set-syntax-table YaTeX-mode-syntax-table) @@ -802,7 +800,9 @@ (and (= 0 (buffer-size)) (file-exists-p YaTeX-template-file) (y-or-n-p (format "Insert %s?" YaTeX-template-file)) (insert-file-contents (expand-file-name YaTeX-template-file))) - (run-hooks 'text-mode-hook 'yatex-mode-hook)) + (if (fboundp 'run-mode-hooks) (run-mode-hooks)) + (run-hooks 'text-mode-hook 'yatex-mode-hook) + ) ;---------- Define YaTeX-mode functions ---------- (defvar YaTeX-ec "\\" "Escape character of current mark-up language.") @@ -853,7 +853,7 @@ (autoload 'YaTeX-on-parenthesis-p "yatexmth" "Check if on math-parens" t) (autoload 'YaTeX-goto-open-paren "yatexmth" "Goto opening paren" t) (autoload 'YaTeX-change-parentheses "yatexmth" "Change corresponding parens" t) -(autoload 'YaTeX-goto-corresponding-paren "yatexmth" "\bigl\bigr jumps" t) +(autoload 'YaTeX-goto-corresponding-paren "yatexmth" "\\bigl\\bigr jumps" t) (autoload 'YaTeX-typeset-math-region "yatexmth" "Typeset math-region" t) ;;autoload from yatexhlp.el @@ -873,7 +873,7 @@ (autoload 'YaTeX-what-column "yatexenv" "YaTeX env. specific funcs" t) (autoload 'YaTeX-intelligent-newline "yatexenv" "YaTeX env. specific funcs" t) (autoload 'YaTeX-indent-line-equation "yatexenv" "Indent equation lines." t) -(autoload 'YaTeX-goto-corresponding-leftright "yatexenv" "\left\right jumps" t) +(autoload 'YaTeX-goto-corresponding-leftright "yatexenv" "\\left\\right jumps" t) ;;autoload from yatexhie.el (autoload 'YaTeX-display-hierarchy "yatexhie" @@ -1965,7 +1965,7 @@ (if YaTeX-emacs-19 (setq regexp-search-ring (cons string (delete string regexp-search-ring))) - (setq search-last-regexp string))) + (setq search-last-regexp string))) ;; For older emacsen (t nil)))) ;;YaTeX-goto-corresponding-environment was moved to yatexlib @@ -2330,8 +2330,8 @@ (YaTeX-goto-corresponding-* t)) (defun YaTeX-comment-region (alt-prefix) - "Comment out region by '%'. -If you call this function on the 'begin{}' or 'end{}' line, + "Comment out region by `%'. +If you call this function on the `begin{}' or `end{}' line, it comments out whole environment" (interactive "P") (if (not (YaTeX-on-begin-end-p)) @@ -2504,7 +2504,7 @@ (goto-char end) (set-marker end nil) (kill-append (buffer-substring (point) (1- (point))) nil) - (delete-backward-char 1))))) + (delete-char -1))))) (defun YaTeX-kill-paren (kill-contents) "Kill parentheses leaving its contents. @@ -2531,9 +2531,9 @@ ((save-excursion (forward-char -2) (looking-at (concat YaTeX-ec-regexp "/"))) - (backward-delete-char 2)) + (delete-char -2)) ((= (char-after (1- (point))) ?\\) - (backward-delete-char 1))) + (delete-char -1))) (goto-char p) (if (looking-at (concat "{" YaTeX-ec-regexp @@ -2753,34 +2753,6 @@ ((YaTeX-change-math-image)) (t (message "I don't know what to change.")))) -;;; -;Check availability of add-in functions -;;; -(cond - ((featurep 'yatexadd) nil) ;Already provided. - ((progn (load "yatexadd" t) (featurep 'yatexadd)) nil) - (t (message "YaTeX add-in functions not supplied."))) - -(defun YaTeX-addin (name) - "Check availability of addin function and call it if exists." - (if (and (not (get 'YaTeX-generate 'disabled)) - (intern-soft (concat YaTeX-addin-prefix name)) - (fboundp (intern-soft (concat YaTeX-addin-prefix name)))) - (let ((s (funcall (intern (concat YaTeX-addin-prefix name))))) - (if (stringp s) s "")) - "")) ;Add in function is not bound. - - -(defun YaTeX-on-item-p (&optional point) - "Return t if POINT (default is (point)) is on \\item." - (let ((p (or point (point)))) - (save-excursion - (goto-char p) - (end-of-line) - (setq p (point)) - (re-search-backward YaTeX-paragraph-delimiter nil t) - (re-search-forward YaTeX-item-regexp p t)))) - (defun YaTeX-in-verb-p (&optional point) "Check if POINT is in verb or verb*. Default of POINT is (point)." (setq point (or point (point))) @@ -3221,8 +3193,6 @@ (YaTeX-indent-line-equation)) ;autoload-ed from yatexenv (;(YaTeX-in-environment-p '("itemize" "enumerate" "description" "list")) (string-match YaTeX-itemizing-env-regexp inenv) - ;;(YaTeX-on-item-p) ?? - ;;(setq iteminfo (YaTeX-get-item-info t)) (if (save-excursion (beginning-of-line) (re-search-forward YaTeX-item-regexp peol t)) @@ -3348,6 +3318,24 @@ (set-buffer b)))) (provide 'yatex) +;;; +;Check availability of add-in functions +;;; +(cond + ((featurep 'yatexadd) nil) ;Already provided. + ((progn (load "yatexadd" t) (featurep 'yatexadd)) nil) + (t (message "YaTeX add-in functions not supplied."))) + +(defun YaTeX-addin (name) + "Check availability of addin function and call it if exists." + (if (and (not (get 'YaTeX-generate 'disabled)) + (intern-soft (concat YaTeX-addin-prefix name)) + (fboundp (intern-soft (concat YaTeX-addin-prefix name)))) + (let ((s (funcall (intern (concat YaTeX-addin-prefix name))))) + (if (stringp s) s "")) + "")) ;Add in function is not bound. + + (defvar yatex-mode-load-hook nil "*List of functions to be called when yatex.el is loaded.") (if (and YaTeX-emacs-19 YaTeX-display-color-p (not (featurep 'yatex19))) diff -r d58c4f69369b -r 0018833906a1 yatex.new --- a/yatex.new Mon Feb 24 19:34:47 2025 +0900 +++ b/yatex.new Sat Aug 01 13:57:31 2026 +0900 @@ -1,6 +1,11 @@ What's new in YaTeX/yahtml 野鳥/yahtml - 各バージョンの変更点について +1.85 == yatex == + Emacs31のlexical-binding警告対応 + 変数参照の整理 + == yateml == + Emacs31のlexical-binding警告対応 1.84 == yatex == verbatimtab, verbatimtabinput, listinginput補完追加 Emacs30でデフォルトでfont-lockが効かない対処を追加 diff -r d58c4f69369b -r 0018833906a1 yatex19.el --- a/yatex19.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatex19.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,6 +1,6 @@ -;;; yatex19.el -- YaTeX facilities for Emacs 19 or later -*- coding: sjis -*- -;;; (c)1994-2017 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Sep 17 10:22:54 2017 on firestorm +;;; yatex19.el -- YaTeX facilities for Emacs 19 or later -*- coding: sjis; lexical-binding: nil -*- +;;; (c)1994-2017,2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 11:25:35 2026 on firestorm ;;; $Id$ ;;; Code: @@ -811,10 +811,7 @@ (boundp 'byte-compile-current-file) byte-compile-current-file (progn - (if YaTeX-emacs-20 (require 'font-lock)) - (if (and (boundp 'window-system) window-system) - (require 'hilit19) - (error "Byte compile this file on window system! Not `-nw'!")))) + (if YaTeX-emacs-20 (require 'font-lock)))) (provide 'yatex19) diff -r d58c4f69369b -r 0018833906a1 yatex23.el --- a/yatex23.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatex23.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,6 +1,6 @@ -;;; yatex23.el --- YaTeX facilities for Emacs 23 or later -*- coding: sjis -*- -;;; (c)2014-2017 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Sep 17 10:23:02 2017 on firestorm +;;; yatex23.el --- YaTeX facilities for Emacs 23 or later -*- coding: sjis; lexical-binding: nil -*- +;;; (c)2014-2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 11:09:19 2026 on firestorm ;;; $Id$ (require 'yatex19) diff -r d58c4f69369b -r 0018833906a1 yatexadd.el --- a/yatexadd.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexadd.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,12 +1,15 @@ -;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*- -;;; (c)1991-2022 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Nov 24 21:01:58 2024 on firestorm +;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis; lexical-binding: nil -*- +;;; (c)1991-2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:55:44 2026 on firestorm ;;; $Id$ ;;; Code: ;;; ;;Sample functions for LaTeX environment. ;;; +(and (fboundp 'eval-when-compile) + (eval-when-compile (require 'yatex))) + (defvar YaTeX:tabular-default-rule "@{\\vrule width 1pt\\ }c|c|c@{\\ \\vrule width 1pt}" "*Your favorite default rule format.") @@ -233,7 +236,7 @@ (or (equal (aref width 0) ?\[) (setq width (concat "[" width "]"))) (concat width (YaTeX:read-position - (if YaTeX-use-LaTeX2e "lrs" "lr"))))))))) + (if YaTeX-use-LaTeX2e "lrcs" "lr"))))))))) ;; (defun YaTeX:framebox () ;; (if (YaTeX-quick-in-environment-p "picture") @@ -2030,8 +2033,7 @@ (setq str (YaTeX-read-string-or-skip "Grayscale values(0.0 - 1.0): ")) (if (<= (string-to-number str) 1) str - (message "%s may be an error. Values from 0.0 to 1.0 are acceptable") - str)) + (message "%s may be an error. Values from 0.0 to 1.0 are acceptable" str))) ((equal model "named") (YaTeX::color-completing-read (concat type " color"))) )))) @@ -2143,9 +2145,11 @@ (string< "" info) (setq bb (format "bb=%s" info))) (setq info (yahtml-get-image-info imgfilepath)) - (car info) ;if has width value - (car (cdr info)) ;if has height value - (setq bb (format "bb=%d %d %d %d" 0 0 (car info) (car (cdr info))))) + (and + (car info) ;if has width value + (car (cdr info)) ;if has height value + (setq bb (format "bb=%d %d %d %d" + 0 0 (car info) (car (cdr info)))))) (save-excursion (cond ((and (save-excursion diff -r d58c4f69369b -r 0018833906a1 yatexenv.el --- a/yatexenv.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexenv.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,6 +1,6 @@ -;;; yatexenv.el --- YaTeX environment-specific functions -;;; (c) 1994-2019 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat May 25 14:46:33 2019 on firestorm +;;; yatexenv.el --- YaTeX environment-specific functions -*- lexical-binding: nil -*- +;;; (c) 1994-2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 11:40:53 2026 on firestorm ;;; $Id$ ;;; Code: @@ -361,7 +361,7 @@ ;;;###autoload (defun YaTeX-goto-corresponding-leftright () - "Go to corresponding \left or \right." + "Go to corresponding \\left or \\right." (let ((YaTeX-struct-begin "\\left%1") (YaTeX-struct-end "\\right%1") (YaTeX-struct-name-regexp "[][(){}\\.|]") diff -r d58c4f69369b -r 0018833906a1 yatexflt.el --- a/yatexflt.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexflt.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexflt.el --- YaTeX filter command utilizer -*- coding: sjis -*- +;;; yatexflt.el --- YaTeX filter command utilizer -*- coding: sjis; lexical-binding: nil -*- ;;; -;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat Jun 2 18:12:41 2018 on firestorm +;;; (c)1993-2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 10:57:45 2026 on firestorm ;;; $Id$ ;;; Commentary: @@ -15,7 +15,7 @@ ;;; Example: ;;; ;;; [[LaTeX Source]] -;;; %#BEGIN FILTER{foo.pdf}{dot -T %t -o o} +;;; %#BEGIN FILTER{foo.pdf}{dot -T %t -o foo.pdf} ;;; \if0 ;;; === ;;; digraph { @@ -99,13 +99,16 @@ (defvar YaTeX-filter-special-env-alist (append YaTeX-filter-special-env-alist-private YaTeX-filter-special-env-alist-default)) +(defvar YaTeX-write-file-hookvar + (if (boundp 'write-file-functions) 'write-file-functions + 'write-file-hooks)) (defun YaTeX-filter-filter-set-conversion-flag () (let ((ovl (get 'YaTeX-filter-filter-sentinel 'overlay))) (if ovl ;; When successful conversion met, (progn ;; (1)Set conversion complete flag (add-hook ;; (2)Add hook of seim-automatic - 'write-file-hooks ;; update of convert to write- + YaTeX-write-file-hookvar ;; update of convert to write- 'YaTeX-filter-update-all) ;; file hook. (overlay-put ovl 'converted t))))) diff -r d58c4f69369b -r 0018833906a1 yatexgen.el --- a/yatexgen.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexgen.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexgen.el --- YaTeX add-in function generator(rev.5) +;;; yatexgen.el --- YaTeX add-in function generator(rev.5) -*- lexical-binding: nil -*- -;;; (c)1991-1995,1999,2000,2017 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Dec 21 14:04:49 2014 on firestorm +;;; (c)1991-1995,1999,2000,2017,2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:17:51 2026 on firestorm ;;; $Id$ ;;; Code: @@ -13,14 +13,15 @@ (put 'YaTeX-setq 'lisp-indent-hook 1) +(defvar YaTeX-generate-initial-message nil) (YaTeX-setq YaTeX-generate-initial-message " 自動生成モードへようこそ!! -初めてやる人はこのバッファの例にしたがって指示通りにやって練習してね。 -本番の時もこのバッファに出るメッセージを *よく読んで* 操作しないとう -まく関数が作れないよ!! +初めてやる人はこのバッファの例にしたがって指示通りにやって練習するよろし。 +本番の時もこのバッファに出る案内を *よく読んで* 操作されたし。 +さらば具合よき関数は得られぬ!! - ではリターンキーを押して下さい。" + ではEnterを。" " Welcome to auto-generation mode!! If this is your first trial, exercise this according to example and @@ -30,68 +31,79 @@ Hit return key!") +(defvar YaTeX-generate-start-message nil) (YaTeX-setq YaTeX-generate-start-message - "さぁはじめるよ.\n1.登録したい補完をやってみて. + "ではとりかかろう.\n1.アドインを登録したい補完を入力されたし. たとえば section 型補完の \\documentstyle だったら \\documentstyle{} -だけをいれてみてね. ちゃんと『〜型補完』を使わないとダメよ!。 -で、おわったらりたーん!!" +だけを入れることになる. ぬかりなく『〜型補完』を使わねばならぬ!。 +その上でEnter!!" "Let's begin completion for which you want to make add-in function. If you want to make add-in function for \\documentstyle input only `\\documentstyle{}' *with* completion of yatex-mode. If you finish this, please press RET.") +(defvar YaTeX-generate-abort-message nil) (YaTeX-setq YaTeX-generate-abort-message - "やめた、やめた〜いめんどくせ〜" + "もはや撤退のときである、しからばごめん" "Aborted.") +(defvar YaTeX-generate-same-message nil) (YaTeX-setq YaTeX-generate-same-message - "それじゃ、なにも変わってねぇだろーが! やめた。" + "なにも変わってないでござるな! 中止にて候。" "I found no difference between them. So I'm quitting.") +(defvar YaTeX-generate-invalid-message nil) (YaTeX-setq YaTeX-generate-invalid-message "それは、ちと無理というものじゃ." "It's impossible.") +(defvar YaTeX-generate-idontknow-message nil) (YaTeX-setq YaTeX-generate-idontknow-message - "う〜ん、難しくてよくわからないなぁ。ばかでごめんねェ〜" + "ぐぬぬ、難しくてよくわからんでござる。拙者には四千年早かったようだ。" "Sorry I can't tell your adding method.") +(defvar YaTeX-generate-confirm-message nil) (YaTeX-setq YaTeX-generate-confirm-message - "ということは、付け足したい部分はこれでいいのね" + "さすれば、付け足したい部分はこれでよかろうか" "Is it additional string of add-in function?") +(defvar YaTeX-generate-output-message nil) (YaTeX-setq YaTeX-generate-output-message - "2.じゃ、それにくっつけたいものを *カーソルの位置に* 足してみて. -さっきの \\documentstyle{} の例だと \\documentstyle[12pt]{} とかにするの。 -しつこいようだけど、今の位置からカーソル動かしちゃダメよ!! -で、またおわったらりたーん!!" + "2.せば、それに結合したきものを *カーソルの位置に* 足されよ。 +先刻の \\documentstyle{} の例だと \\documentstyle[12pt]{} となろう。 +執拗御免被りたいが、今の位置からカーソル動かすのは御法度でござるぞ!! +しこうして、完了後にEnterじゃ!!" "2.Then input additional string *at CURSOR POSITION* According to last example \\documentstyle{}, modify it \\documentstyle[12pt]{}. RET to finish.") +(defvar YaTeX-generate-put-arg-message nil) (YaTeX-setq YaTeX-generate-put-arg-message - "3.このうち、キーボードから読み込んで欲しい文字列を順に入れて。 -さっきの \\documentstyle[12pt]{} だったら、付加する文字は[12pt]だけど -手で入れたいのは 12pt の部分だけですね。 -で、全部入れ終ったら、りたーんだけうってね!!" + "3.これのうち、キーボードから読み込んで欲しい文字列を順に入れてくだされ。 +先刻の \\documentstyle[12pt]{} であらば、付加する文字は[12pt]じゃが +手で入れたいのは 12pt の部分だけであろう。 +全部入れ終ったら、Enterで完了である!!" "3.In this string, extract string which you want to input from key board with quiry afterwards. For example, though additional string is \\documentstyle[12pt]{}, but you want enter only `12pt' by hand. RET to finish!") +(defvar YaTeX-generate-read-prompt-message nil) (YaTeX-setq YaTeX-generate-read-prompt-message - "4.では、あとでこれらの文字列を読み込む時に、どういうプロンプトを -出したいですか? 順に入れて下さい。面倒なら単にリターンを打ってね。 -さっきの 12pt の部分だったら、『サイズは』とかがおすすめ。" + "4.では、後にこれらの文字列を読み込む時に、案内として出すべきプロンプトを +順に入れてくだされ。面倒なら単にEnterでよき。 +先の 12pt の部分だったら、『サイズは』とかを推奨致す。" "4.When you use this add-in function afterwards, what message do you like to be prompted with to enter these values. In last example `12pt', typical prompt string may be `Size?: '.") +(defvar YaTeX-generate-done-message nil) (YaTeX-setq YaTeX-generate-done-message - "よし! これが、君の作りたかった関数だ。~/.emacs にでも入れてせいぜい -楽してくれ。このバッファ(*ご案内*)を yatex-mode にしておくから -できた関数が本当にお望みの動作をするか確かめてみるといいかもね。 - ところで、この関数こんなに簡単だろう? そろそろ自分で書いたらどう? + "よし! これが、うぬの作りたかった関数だ。~/.emacs にでも入れてせいぜい +楽するがよかろう。このバッファ(*ご案内*)を yatex-mode にしておくゆえ +できた関数が本当にお望みの動作をするか確かめてみるがよかろう。 + ところで、この関数こんなに簡単と察せられたのではなかろうか? +そろそろ自分で書いたら如何であるか? " "OK! This is the definition of function you want to make! Add this description to your ~/.emacs or so. Use this buffer(*Guide*) @@ -100,26 +112,31 @@ write your most favorite add-in function yourself! ") +(defvar YaTeX-generate-nomatch-message nil) (YaTeX-setq YaTeX-generate-nomatch-message - "こらこら、そんな文字列どこにもねーぞ!!" + "こらこら、そんな文字列どこにも見当たらぬ。!!" "No such string in additional string.") +(defvar YaTeX-generate-buffer nil) (YaTeX-setq YaTeX-generate-buffer "*付加関数生成バッファ*" "*Generate-add-in-function*") +(defvar YaTeX-generate-message-buffer nil) (YaTeX-setq YaTeX-generate-message-buffer "*ご案内*" "*Guide*") +(defvar YaTeX-generate-bug-message nil) (YaTeX-setq YaTeX-generate-bug-message - "ごめ〜ん!! ちょっと、このアドイン関数つくるの失敗しちゃったみたい!! -作者まで連絡してくださ〜〜〜い!" + "これは痛恨の極み!! 拙者、このアドイン関数作成をし損なったようである!! +何卒作者まで連絡してくださらぬか!" "Sorry I failed to make add-in function for you... Send bug report to me.") +(defvar YaTeX-generate-narrow-message nil) (YaTeX-setq YaTeX-generate-narrow-message - "画面がせますぎるような気がします。" + "画面が窮屈である。広げてはくださらぬか。" "Too narrow screen height.") (defvar YaTeX-generate-message-height @@ -127,8 +144,8 @@ ;; Do you need learning for generated function? ;; If you need, please tell me (yuuji@yatex.org) -;;(defvar YaTeX-generate-variables-for-learning nil) -;;(defvar YaTeX-generate-current-completion-table nil) +(defvar YaTeX-generate-variables-for-learning nil) +(defvar YaTeX-generate-current-completion-table nil) ;;; ;Generate mode. @@ -231,7 +248,7 @@ (YaTeX-generate-display-message YaTeX-generate-done-message) (switch-to-buffer YaTeX-generate-buffer) (condition-case error - (eval-current-buffer) + (YaTeX-eval-buffer) (error (insert YaTeX-generate-bug-message))) (pop-to-buffer YaTeX-generate-message-buffer)) @@ -520,7 +537,7 @@ (insert "))\n") ;close defun (goto-char (point-min)) (while (not (eobp)) (lisp-indent-line) (forward-line 1)) - (eval-current-buffer) + (YaTeX-eval-buffer) buf)) (defun YaTeX-generate-argument-type (command argc) @@ -551,7 +568,7 @@ (insert "))\n") (goto-char (point-min)) (while (not (eobp)) (lisp-indent-line) (forward-line 1)) - (eval-current-buffer) + (YaTeX-eval-buffer) (set-buffer cb) (YaTeX-update-table (if (> argc 1) (list command argc) (list command)) diff -r d58c4f69369b -r 0018833906a1 yatexhie.el --- a/yatexhie.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexhie.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexhie.el --- YaTeX hierarchy browser +;;; yatexhie.el --- YaTeX hierarchy browser -*- lexical-binding: nil -*- ;;; -;;; (c)1995-2013 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Sun Dec 21 14:05:20 2014 on firestorm +;;; (c)1995-2013,2026 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:48:10 2026 on firestorm ;;; $Id$ ;;; Code: @@ -19,6 +19,7 @@ (if (and YaTeX-emacs-19 window-system) " Mouse2)select" "") " ?)help")) (defvar YaTeX-hierarchy-saved-wc nil "Saved window configuration.") +(defvar YaTeX-hierarchy-mode-map nil "Keymap used in YaTeX-hierarchy-mode.") ;; ----- Functions for parsing hierarchy ----- @@ -391,7 +392,6 @@ ) ;; ----- Setting up keymap ----- -(defvar YaTeX-hierarchy-mode-map nil "Keymap used in YaTeX-hierarchy-mode.") (if YaTeX-hierarchy-mode-map nil (setq YaTeX-hierarchy-mode-map (make-sparse-keymap)) (define-key YaTeX-hierarchy-mode-map "n" 'YaTeX-hierarchy-next) diff -r d58c4f69369b -r 0018833906a1 yatexhks.el --- a/yatexhks.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexhks.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,4 +1,4 @@ -;;; -*- Emacs-Lisp -*- +;;; -*- mode: Emacs-Lisp; lexical-binding: nil -*- ;;; Hooks for YaTeX ;;; 野鳥に関連する記述(たとえばアドイン関数)は yatexhks.el という名前の diff -r d58c4f69369b -r 0018833906a1 yatexhlp.el --- a/yatexhlp.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexhlp.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexhlp.el --- YaTeX helper for LaTeX -*- coding: sjis -*- +;;; yatexhlp.el --- YaTeX helper for LaTeX -*- coding: sjis; lexical-binding: nil -*- ;;; -;;; (c)1994,1998,2004,2014,2015,2018 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat Jun 2 16:45:45 2018 on firestorm +;;; (c)1994,1998,2004,2014,2015,2018,2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:49:42 2026 on firestorm ;;; $Id$ ;;; Code: diff -r d58c4f69369b -r 0018833906a1 yatexinf.el --- a/yatexinf.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexinf.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,6 +1,6 @@ -;;; yatexinf.el -- YaTeX interfaces for Texinfo mode -;;; (c)1994-2013 by HIROSE, Yuuji [yuuji@yatex.org] -;;; Last modified Mon Apr 1 22:43:58 2013 on firestorm +;;; yatexinf.el -- YaTeX interfaces for Texinfo mode -*- lexical-binding: t -*- +;;; (c)1994-2013,2026 by HIROSE, Yuuji [yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:50:21 2026 on firestorm ;;; Code: (require 'yatex) diff -r d58c4f69369b -r 0018833906a1 yatexlib.el --- a/yatexlib.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexlib.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*- +;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis; lexical-binding: nil -*- ;;; -;;; (c)1994-2022 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Fri Dec 2 08:41:16 2022 on firestorm +;;; (c)1994-2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 13:14:19 2026 on firestorm ;;; $Id$ ;;; Code: @@ -90,7 +90,7 @@ (defvar YaTeX-use-italic-bold (string< "20" emacs-version) "*Non-nil tries to find italic/bold fontset. This variable is effective when font-lock is used. -\it, \bf 内部での日本語が□になってしまう場合はこれをnilにして下さい。") +\\it, \\bf 内部での日本語が□になってしまう場合はこれをnilにして下さい。") ;----------- work variables ---------------------------------------- (defvar YaTeX-minibuffer-completion-map nil @@ -207,7 +207,8 @@ (interactive) (let*((user-table (expand-file-name YaTeX-user-completion-table)) (local-table (expand-file-name (file-name-nondirectory user-table))) - var localvar localbuf (curbuf (current-buffer)) sexp) + var localvar localbuf (curbuf (current-buffer)) sexp + (warning-suppress-log-types '((files missing-lexbind-cookie)))) (if YaTeX-user-table-is-read nil (message "Loading user completion table") (if (file-exists-p user-table) (load-file user-table) @@ -891,7 +892,7 @@ (defun YaTeX-split-string (str &optional sep null) "Split string STR by every occurrence of SEP(regexp). -If the optional second argument SEP is nil, it defaults to \"[ \f\t\n\r\v]+\". +If the optional second argument SEP is nil, it defaults to \"[ \\f\\t\\n\\r\\v]+\". Do not include null string by default. Non-nil for optional third argument NULL includes null string in a list." (let ((sep (or sep "[ \f\t\n\r\v]+")) @@ -929,6 +930,14 @@ (fset 'YaTeX-member (symbol-function 'member)) (fset 'YaTeX-member (symbol-function 'YaTeX-member1))) +;;; interactive-p +(if (fboundp 'called-interactively-p) + (defun YaTeX-interactive-p() + (called-interactively-p 'interactive)) + (fset 'YaTeX-interactive-p 'interactive-p)) +(fset 'YaTeX-eval-buffer + (if (fboundp 'eval-current-buffer) 'eval-current-buffer 'eval-buffer)) + ;;; ;; Interface function for windows.el ;;; @@ -1105,7 +1114,7 @@ (defun YaTeX-goto-corresponding-environment (&optional allow-mismatch noerr bg) "Go to corresponding begin/end enclosure. Optional argument ALLOW-MISMATCH allows mismatch open/clese. Use this -for \left(, \right). +for \\left(, \\right). Optional third argument NOERR causes no error for unballanced environment." (interactive) (if (not (YaTeX-on-begin-end-p)) nil @@ -1220,7 +1229,7 @@ (progn (goto-char (get 'YaTeX-inner-environment 'point)) (and end (YaTeX-goto-corresponding-environment)) - (if (interactive-p) (push-mark op)) + (if (YaTeX-interactive-p) (push-mark op)) (point))))) (defun YaTeX-end-of-environment (&optional limit-search-bound) diff -r d58c4f69369b -r 0018833906a1 yatexm-o.el --- a/yatexm-o.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexm-o.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexm-o.el --- Sample to invoke yatex-mode with outline-minor mode - -;;; (c)1993 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Sun Dec 21 14:15:47 2014 on firestorm +;;; yatexm-o.el --- Sample to invoke yatex-mode with outline-minor mode -*- lexical-binding: nil -*- +;;; (maybe obsoleted) +;;; (c)1993,2026 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:51:57 2026 on firestorm ;;; Code: ;;; diff -r d58c4f69369b -r 0018833906a1 yatexmth.el --- a/yatexmth.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexmth.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexmth.el --- YaTeX math-mode-specific functions -*- coding: sjis -*- +;;; yatexmth.el --- YaTeX math-mode-specific functions -*- coding: sjis; lexical-binding: nil -*- ;;; ;;; (c)1993-2022 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Sun Dec 25 13:56:02 2022 on firestorm +;;; Last modified Sat Aug 1 13:45:38 2026 on firestorm ;;; $Id$ ;;; Commentary: @@ -90,7 +90,7 @@ (eq dos-machine-type 'pc98))) (defmacro YaTeX-setq-math-sym (sym old new) - (list 'setq sym (list 'if 'YaTeX-jisold old new))) + (list 'defvar sym (list 'if 'YaTeX-jisold old new))) (YaTeX-setq-math-sym YaTeX-image-in "E" "∈") (YaTeX-setq-math-sym YaTeX-image-ni "ヨ" "∋") diff -r d58c4f69369b -r 0018833906a1 yatexpkg.el --- a/yatexpkg.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexpkg.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexpkg.el --- YaTeX package manager -*- coding: sjis -*- +;;; yatexpkg.el --- YaTeX package manager -*- coding: sjis; lexical-binding: nil -*- ;;; -;;; (c)2003-2022 by HIROSE, Yuuji [yuuji@yatex.org] -;;; Last modified Sun Nov 24 20:43:19 2024 on firestorm +;;; (c)2003-2022,2026 by HIROSE, Yuuji [yuuji@yatex.org] +;;; Last modified Sat Aug 1 12:54:02 2026 on firestorm ;;; $Id$ ;;; Code: diff -r d58c4f69369b -r 0018833906a1 yatexprc.el --- a/yatexprc.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexprc.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*- +;;; yatexprc.el --- YaTeX process handler -*- coding: sjis; lexical-binding: nil -*- ;;; -;;; (c)1993-2022 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Dec 1 19:13:20 2022 on firestorm +;;; (c)1993-2022,2026 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sat Aug 1 13:21:56 2026 on firestorm ;;; $Id$ ;;; Code: @@ -1254,6 +1254,7 @@ (raise-frame edit-frame) (select-frame edit-frame))) ) + ;; Keep these code below for future thinking... (error-win (select-window error-win)) ((eq (get-lru-window) typeset-win) (YaTeX-switch-to-buffer error-buffer)) @@ -1523,7 +1524,7 @@ Use set-buffer instead of switch-to-buffer if the optional argument SETBUF is t(Use it only from Emacs-Lisp program)." (interactive "P") - (if (and (interactive-p) setbuf) (setq YaTeX-parent-file nil)) + (if (and (YaTeX-interactive-p) setbuf) (setq YaTeX-parent-file nil)) (let ((ff (function (lambda (f) (if setbuf (set-buffer (find-file-noselect f)) (find-file f))))) @@ -1535,7 +1536,7 @@ (setq main-file ;;(get-file-buffer YaTeX-parent-file) YaTeX-parent-file)) (if (YaTeX-main-file-p) - (if (interactive-p) (message "I think this is main LaTeX source.") nil) + (if (YaTeX-interactive-p) (message "I think this is main LaTeX source.") nil) (cond ((and ;;(interactive-p) main-file diff -r d58c4f69369b -r 0018833906a1 yatexsec.el --- a/yatexsec.el Mon Feb 24 19:34:47 2025 +0900 +++ b/yatexsec.el Sat Aug 01 13:57:31 2026 +0900 @@ -1,7 +1,7 @@ -;;; yatexsec.el --- YaTeX sectioning browser +;;; yatexsec.el --- YaTeX sectioning browser -*- lexical-binding: nil -*- ;;; -;;; (c) 1994-2017 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Wed May 30 13:29:50 2018 on firestorm +;;; (c) 1994-2017,2026 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Sat Aug 1 13:35:14 2026 on firestorm ;;; $Id$ ;;; Code: @@ -26,8 +26,7 @@ (let ((ch ?0)) (while (<= ch ?9) (define-key map (char-to-string ch) 'YaTeX-sectioning-hide) - (setq ch (1+ ch)))) -) + (setq ch (1+ ch))))) (defvar YaTeX-sectioning-minibuffer-map nil "Key map used in minibuffer for sectioning.") @@ -62,8 +61,7 @@ 'YaTeX-sectioning-recenter) (define-key YaTeX-sectioning-minibuffer-map "?" 'YaTeX-sectioning-help) - (YaTeX-sectioning-map-hide YaTeX-sectioning-minibuffer-map) -) + (YaTeX-sectioning-map-hide YaTeX-sectioning-minibuffer-map)) (defvar YaTeX-sectioning-buffer-map nil "Key map used in YaTeX-sectioning-buffer.") @@ -91,8 +89,7 @@ (and YaTeX-emacs-19 (boundp 'window-system) (eq window-system 'x) (define-key YaTeX-sectioning-buffer-map [?\C-/] 'YaTeX-shift-section-undo)) - (YaTeX-sectioning-map-hide YaTeX-sectioning-buffer-map) -) + (YaTeX-sectioning-map-hide YaTeX-sectioning-buffer-map)) (defun YaTeX-sectioning-mode () "Mode for browsing document's sectioning structure. @@ -110,8 +107,7 @@ (interactive) (setq major-mode 'YaTeX-sectioning-mode mode-name "sectioning") - (use-local-map YaTeX-sectioning-buffer-map) -) + (use-local-map YaTeX-sectioning-buffer-map)) (defvar YaTeX-sectioning-buffer-parent nil) (defun YaTeX-sectioning-buffer-jump-internal (&optional keep) @@ -152,14 +148,12 @@ (if (and YaTeX-sectioning-buffer-parent (get-buffer YaTeX-sectioning-buffer-parent)) (YaTeX-sectioning-buffer-jump-internal keep) - (message "No line number expression.")) -) + (message "No line number expression."))) (defun YaTeX-sectioning-buffer-show () "Show corresponding sectioning unit with current line." (interactive) - (YaTeX-sectioning-buffer-jump-internal t) -) + (YaTeX-sectioning-buffer-jump-internal t)) (defun YaTeX-sectioning-hide-under (n) "Hide sectioning commands under level N." @@ -176,8 +170,8 @@ (if (numberp selective-display) (setq mode-name (format "level %d" (1- selective-display))) (setq mode-name (format "all"))) - (select-window cw)) -) + (select-window cw))) + (defun YaTeX-sectioning-hide () "Call YaTeX-sectioning-hide-under with argument according to pressed key." (interactive) @@ -212,8 +206,7 @@ (momentary-string-display "" (point-min))) (bury-buffer hb) (switch-to-buffer sb) - (select-window cw))) -) + (select-window cw)))) (defun YaTeX-sectioning-up (n) "Up section level. @@ -233,14 +226,12 @@ (if (or (< level 0) (>= level (length alist))) (ding) (YaTeX-minibuffer-erase) - (insert (concat (car (nth level alist)) (if aster "*" "")))))) -) + (insert (concat (car (nth level alist)) (if aster "*" ""))))))) (defun YaTeX-sectioning-down (n) "Down section level." (interactive "p") - (YaTeX-sectioning-up (- n)) -) + (YaTeX-sectioning-up (- n))) (defun YaTeX-sectioning-scroll-up (n) (interactive "P") @@ -249,8 +240,7 @@ (YaTeX-showup-buffer section-buffer nil t) (unwind-protect (scroll-up (or n (- (window-height) 2))) - (select-window cw))) -) + (select-window cw)))) (defun YaTeX-sectioning-scroll-down (n) (interactive "P") @@ -259,8 +249,7 @@ (YaTeX-showup-buffer section-buffer nil t) (unwind-protect (scroll-down (or n (- (window-height) 2))) - (select-window cw))) -) + (select-window cw)))) (defun YaTeX-sectioning-recenter (arg) "Recenter `<<--' line" @@ -272,8 +261,7 @@ (or (search-forward "<<--" nil t) (search-backward "<<--" nil)) (recenter (or arg (/ (window-height) 2)))) - (select-window cw))) -) + (select-window cw)))) (defvar YaTeX-sectioning-minibuffer " *sectioning*" "Miniuffer used for sectioning") @@ -282,16 +270,14 @@ (interactive) (let ((minibuffer-completion-table table)) (read-from-minibuffer - prompt default YaTeX-sectioning-minibuffer-map)) -) + prompt default YaTeX-sectioning-minibuffer-map))) (defun YaTeX-get-sectioning-level () "Get section-level on the cursor." (cdr-safe (assoc (buffer-substring (point) (progn (skip-chars-forward "a-z") (point))) - YaTeX-sectioning-level)) -) + YaTeX-sectioning-level))) (defvar YaTeX-sectioning-buffer "*Sectioning lines*") (defvar YaTeX-sectioning-indent 1) @@ -330,8 +316,7 @@ (setq YaTeX-sectioning-buffer-parent cb) (if (numberp selective-display) (setq mode-name (format "level %d" (1- selective-display)))) - YaTeX-sectioning-buffer)) -) + YaTeX-sectioning-buffer))) (defvar YaTeX-pending-undo nil) (defun YaTeX-section-overview () @@ -360,8 +345,7 @@ (forward-line 1) (if (eobp) (recenter -1) (recenter -3)) (select-window cw) - command)) -) + command))) ;;;###autoload (defun YaTeX-make-section-with-overview () @@ -373,21 +357,19 @@ "Sectioning(Up=C-p, Down=C-n, Help=?): " YaTeX-sectioning-level (YaTeX-section-overview)) "{}") - (forward-char -1) -) + (forward-char -1)) (defun YaTeX-shifted-section (sc n) "Get SC's N-shifted sectioning command." (let (lv) (setq lv (- (cdr (assoc sc YaTeX-sectioning-level)) n) lv (max (min YaTeX-sectioning-max-level lv) 0)) - (car (nth lv YaTeX-sectioning-level))) -) + (car (nth lv YaTeX-sectioning-level)))) (defun YaTeX-shift-section-up (n) "Shift sectioning command down by level N." (interactive "p") - (let ((cb (current-buffer)) sc nsc lv) + (let ((cb (current-buffer)) nsc lv) (if (and YaTeX-sectioning-buffer-parent (get-buffer YaTeX-sectioning-buffer-parent) (save-excursion @@ -421,13 +403,13 @@ (undo-boundary)) (set-buffer-modified-p nil) (setq YaTeX-pending-undo pending-undo-list) - ))) -) + )))) + (defun YaTeX-shift-section-down (n) "Shift sectioning command down by level N." (interactive "p") - (YaTeX-shift-section-up (- n)) -) + (YaTeX-shift-section-up (- n))) + (defun YaTeX-shift-section-undo (arg) "Undo YaTeX-shift-section-up/down." (interactive "p") @@ -449,8 +431,8 @@ (undo arg) (setq YaTeX-pending-undo pending-undo-list)) (goto-buffer-window cb) - (setq this-command 'YaTeX-shift-section-undo))) -) + (setq this-command 'YaTeX-shift-section-undo)))) + (defun YaTeX-sync-section-buffer () "Synchronize *Sectioning Lines* buffer with parent buffer." (interactive) @@ -460,8 +442,8 @@ (set-buffer (get-buffer YaTeX-sectioning-buffer-parent)) (YaTeX-section-overview) (switch-to-buffer cb) - (goto-char p))) -) + (goto-char p)))) + (defun YaTeX-shift-section-up-region (beg end n) "Shift sectioning commands in region down by level N." (interactive "r\np") @@ -503,22 +485,22 @@ (insert (cdr (car repllist))) (goto-char (match-beginning 0)))) (setq repllist (cdr repllist)))) - (goto-buffer-window cb))) -) + (goto-buffer-window cb)))) + (defun YaTeX-shift-section-down-region (beg end n) "Shift sectioning commands in region down by level N." (interactive "r\np") - (YaTeX-shift-section-up-region beg end (- n)) -) + (YaTeX-shift-section-up-region beg end (- n))) + (defun YaTeX-sectioning-buffer-next-line (n) "Move to next line in *Sectioning Lines* buffer." (interactive "p") (forward-line n) - (skip-chars-forward " \t%") -) + (skip-chars-forward " \t%")) + (defun YaTeX-sectioning-buffer-prev-line (n) "Move to previous line in *Sectioning Lines* buffer." (interactive "p") - (YaTeX-sectioning-buffer-next-line (- n)) -) + (YaTeX-sectioning-buffer-next-line (- n))) + (provide 'yatexsec)