home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / alt / lucidem / help / 868 < prev    next >
Encoding:
Text File  |  1993-01-12  |  4.7 KB  |  134 lines

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!atlantis.psu.edu!psuvax1!hsdndev!rossini
  2. From: rossini@biosun1.harvard.edu (Anthony Rossini)
  3. Newsgroups: alt.lucid-emacs.help
  4. Subject: AucTex modifications
  5. Message-ID: <ROSSINI.93Jan12172741@biosun1.harvard.edu>
  6. Date: 12 Jan 93 22:27:41 GMT
  7. Sender: usenet@hsdndev.UUCP
  8. Distribution: alt
  9. Organization: Biostat Dept, HSPH, Boston MA, USA.
  10. Lines: 122
  11.  
  12.  
  13. Well - sufficient people asked, so I'm going to post the code.  It was my
  14. first attempt at this type of thing, and it contains a small (1/2 line!)
  15. diff to auc-tex.el, and a new file, auc-tex-lucid.el.  Ideas are shamelessly
  16. stolen from gnus-lucid.el (or whatever the file containing mods in the gnus
  17. package was called).  If you modify it significantly, I'd love to see the
  18. changes, other than that, enjoy!
  19.  
  20. It's also an acceptable example of how to add menus to an existing package,
  21. for those who have recently asked the question...  (the diff is a switch to
  22. load/require the mouse code, called from the primary start-up for AUC-TeX.
  23.  
  24. Enjoy!
  25.  
  26. -tony
  27. ------------ cut here ----------- (but beware of sig at the end)
  28.  
  29. #! /bin/sh
  30. # Strip off top stuff and run this through /bin/sh to produce:
  31. # auc-tex.el.patch
  32. # auc-tex-lucid.el
  33. # Produced by Chris's stupid and simple sh shar.
  34. echo 'auc-tex.el.patch'
  35. if [ -f auc-tex.el.patch ] 
  36. then
  37.   echo auc-tex.el.patch already exists; exit 1
  38. fi
  39. sed 's/^X//' >'auc-tex.el.patch' <<'ENDIT' 
  40. X479,481d478
  41. X<   ;; added by ajr, 102692, for button stuff
  42. X<   (if (string-match "Lucid" emacs-version) (require 'auc-tex-lucid))
  43. X< 
  44. ENDIT
  45. echo 'auc-tex-lucid.el'
  46. if [ -f auc-tex-lucid.el ] 
  47. then
  48.   echo auc-tex-lucid.el already exists; exit 1
  49. fi
  50. sed 's/^X//' >'auc-tex-lucid.el' <<'ENDIT' 
  51. X;;; Mouse support for AUC-TeX version 6.1 running in Lucid (GNU?) Emacs,
  52. X;;; at least for version 19.3.  By Anthony Rossini, rossini@hsph.harvard.edu
  53. X;;; 
  54. X;;; This program is free software; you can redistribute it and/or modify
  55. X;;; it under the terms of the GNU General Public License as published by
  56. X;;; the Free Software Foundation; either version 1, or (at your option)
  57. X;;; any later version.
  58. X;;;
  59. X;;; This program is distributed in the hope that it will be useful,
  60. X;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  61. X;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  62. X;;; GNU General Public License for more details.
  63. X;;;
  64. X;;; The GNU General Public License is available by anonymouse ftp from
  65. X;;; prep.ai.mit.edu in pub/gnu/COPYING.  Alternately, you can write to
  66. X;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  67. X;;; USA.
  68. X;;;
  69. X;;; If you modify it in any significant way, I'd appreciate getting a copy
  70. X;;; though it isn't required! :-).
  71. X
  72. X
  73. X(defvar auctex-menu
  74. X  '("AUC-TeX Commands"
  75. X    ["(La)TeX Buffer" TeX-buffer t]
  76. X    ["LaCheck Buffer" TeX-run-lacheck t]
  77. X    ["Kill Compilation" TeX-kill-job t]
  78. X    "----"
  79. X    ["Preview Buffer (need to TeX-buffer first)" TeX-preview t]
  80. X    ["Print Buffer (need to TeX-buffer first)" TeX-print t]
  81. X    ["Spell Buffer" ispell-buffer t]
  82. X    ["BibTeX" LaTeX-bibtex t]
  83. X    "----"
  84. X    ["Toggle Math mode" LaTeX-math-mode t]
  85. X    ["TeX help" TeX-mode-help t]
  86. X    ["Toggle extended debug" TeX-toggle-debug-boxes t]
  87. X    "----"
  88. X    ["Insert section heading" LaTeX-section t]
  89. X    ["Insert environment" LaTeX-environment t]
  90. X    ["Insert LaTeX item" LaTeX-insert-item t]
  91. X    "----"
  92. X    ["Comment out region" TeX-comment-out-region t]
  93. X    ["Comment out paragraph" TeX-comment-out-paragraph t]
  94. X    ["Uncomment out region" TeX-un-comment-region t]
  95. X    "----"
  96. X    ["Insert TeX-bold" TeX-bold t]
  97. X    ["Insert TeX-italic" TeX-italic t]
  98. X    ["Insert TeX-slanted" TeX-slanted t]
  99. X    ["Insert TeX-roman" TeX-roman t]
  100. X    ["Insert TeX-emphasize" TeX-emphasize t]
  101. X    ["Insert TeX-typewriter" TeX-typewriter t]
  102. X    ["Insert TeX-small-caps" TeX-small-caps t]
  103. X    ))
  104. X
  105. X(defun auctex-mouse-menu (e)
  106. X  (interactive "e")
  107. X  (mouse-set-point e)
  108. X  (beginning-of-line)
  109. X  (search-forward ":" nil t)
  110. X  (popup-menu auctex-menu))
  111. X
  112. X
  113. X;;; Put the AUC-TeX menus in the menubar
  114. X
  115. X(defun auctex-install-menubar ()
  116. X  (if default-menubar
  117. X      (let ((menu (cond ((eq major-mode 'LaTeX-mode) auctex-menu)
  118. X            (t (error "not in auctex mode")))))
  119. X    (set-buffer-menubar (copy-sequence default-menubar))
  120. X    (add-menu nil "AUC-TeX" (cdr menu)))))
  121. X
  122. X(add-hook 'LaTeX-mode-hook 'auctex-install-menubar)
  123. X
  124. X(define-key TeX-mode-map 'button3 'auctex-mouse-menu)
  125. X(define-key LaTeX-mode-map  'button3 'auctex-mouse-menu)
  126. X
  127. X(provide 'auc-tex-lucid)
  128. ENDIT
  129. exit 0
  130. --
  131. Anthony Rossini       -       rossini@biostat.harvard.edu
  132. Department of Biostatistics, Harvard School of Public Health
  133. 677 Huntington Ave, Boston MA 02115  617-432-1056
  134.