Loads more updates -- large assortment of stuffs
[syinit] / 05-latex-sy.el
index e18a1bb..18fc584 100644 (file)
@@ -5,10 +5,10 @@
 ;;     Author: Steve Youngs <steve@sxemacs.org>
 ;; Maintainer: Steve Youngs <steve@sxemacs.org>
 ;;    Created: <2007-12-02>
-;; Time-stamp: <Wednesday Feb 12, 2020 16:45:05 steve>
+;; Time-stamp: <Monday Mar 16, 2020 12:51:47 steve>
 ;;   Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
 ;;   HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/05-latex-sy.html>
-;;   Git Repo: git clone http://git.sxemacs.org/syinit
+;;   Git Repo: git clone https://git.sxemacs.org/syinit
 ;;   Keywords: init, compile
 
 ;; This file is part of SYinit
@@ -73,6 +73,7 @@
 ;; incompatible GNUisms of some kind.  Explicitly loading the .el gets
 ;; around it.
 (require 'font-latex "font-latex.el")
+(require 'latex-toolbar)
 
 ;:*=======================
 ;:* Shutup the byte-compiler
@@ -193,13 +194,13 @@ Replacement for count-lines-region."
             " "
             (substring time -4) " ")))
 
-;:*=======================
-;:* outl-mouse-minor-mode for all LaTeX files
-(defun turn-on-outl-mouse-minor-mode ()
-  (outl-mouse-minor-mode 1))
-
 ;:*=======================
 ;* Hooks.
+(defun sy-LaTeX-toolbar ()
+  (interactive)
+  (set-specifier left-toolbar-width (cons (current-buffer) 32))
+  (latex-toolbar-install))
+
 (defun sy-LaTeX-mode-hook ()
   (turn-on-auto-fill)
   (setq TeX-shell "/bin/zsh")
@@ -212,19 +213,12 @@ Replacement for count-lines-region."
               '("gv" "gv %s.ps" TeX-run-silent t nil))
   (add-to-list 'TeX-command-list
               '("pdflatex" "pdflatex -interaction=nonstopmode %t"
-                TeX-run-command nil t)))
-
-(add-hook 'LaTeX-mode-hook #'sy-LaTeX-mode-hook)
-
+                TeX-run-command nil t))
+  (when (device-on-window-system-p)
+    (outl-mouse-minor-mode 1)
+    (local-set-key [(super hyper t)] #'sy-LaTeX-toolbar)))
 
-;; Add a couple more things if we're in X
-;;(when (and (device-on-window-system-p)
-;;        (featurep 'latex-toolbar)
-;;        (featurep 'outl-mouse))
-;;  (add-hook 'LaTeX-mode-hook
-;;         #'(lambda ()
-;;             (turn-on-outl-mouse-minor-mode)
-;;             (latex-toolbar-install))))
+(add-hook 'LaTeX-mode-hook #'sy-LaTeX-mode-hook 'append)
 
 (setq LaTeX-section-hook
       '(LaTeX-section-heading
@@ -235,16 +229,16 @@ Replacement for count-lines-region."
 
 ;:*=======================
 ;:* Texinfo
-;; This is _NOT_ the texinfo-mode that comes with AucTeX, because that
-;; sucks.  AucTeX actually loads `texinfo.el' and then overwrites
-;; everything with the DAK-inspired crap!  So I explicitly load it
-;; here to reinstate the better `texinfo-mode'.
-(require 'texinfo)
+;; Jumping through hoops to ensure that we DO NOT get the AUCTeX
+;; tex-info.  The texinfo.el from the "texinfo" (S)XEmacs package is
+;; older, but far, far, superior.  Honestly, the AUCTeX / GNU people
+;; have no idea what they're missing.
+(eval-after-load 'tex-info
+  (progn
+    (delq 'texinfo-mode TeX-modes)
+    (defalias 'texinfo-mode #'ignore)
+    (require 'texinfo)))
 
-;; `texinfo.el' uses the GNU `:inherit' property which (S)XEmacs
-;; doesn't have... a quick `set-face-parent' fixes that.
-;; Update: SXEmacs does have `:inherit' now, at least, I'm pretty sure
-;; it does
 (set-face-parent 'texinfo-heading-face 'font-lock-function-name-face)
 
 ;; Perdy colours!