aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Tromey1995-05-09 21:36:53 +0000
committerTom Tromey1995-05-09 21:36:53 +0000
commite9e7f5f226df28ed883dc96324094437ea04563e (patch)
tree1d14735cc18a83c9b1654932ac293f4b908cf89b
parent3cbdcdc70f7694e5a884460b3984d63c79beb467 (diff)
downloademacs-e9e7f5f226df28ed883dc96324094437ea04563e.tar.gz
emacs-e9e7f5f226df28ed883dc96324094437ea04563e.zip
Changed "Lucid Emacs" to "XEmacs".
Tcl's popup menu now added to existing one, courtesy dfarmer@evolving.com (Doug Farmer)
-rw-r--r--lisp/progmodes/tcl.el67
1 files changed, 37 insertions, 30 deletions
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index 08a159ee256..518aa7e781d 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -6,7 +6,7 @@
6;; Author: Tom Tromey <tromey@busco.lanl.gov> 6;; Author: Tom Tromey <tromey@busco.lanl.gov>
7;; Chris Lindblad <cjl@lcs.mit.edu> 7;; Chris Lindblad <cjl@lcs.mit.edu>
8;; Keywords: languages tcl modes 8;; Keywords: languages tcl modes
9;; Version: $Revision: 1.27 $ 9;; Version: $Revision: 1.28 $
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
@@ -51,7 +51,7 @@
51;; LCD Archive Entry: 51;; LCD Archive Entry:
52;; tcl|Tom Tromey|tromey@busco.lanl.gov| 52;; tcl|Tom Tromey|tromey@busco.lanl.gov|
53;; Major mode for editing Tcl| 53;; Major mode for editing Tcl|
54;; $Date: 1994/10/11 02:01:27 $|$Revision: 1.27 $|~/modes/tcl.el.Z| 54;; $Date: 1995/04/08 19:52:50 $|$Revision: 1.28 $|~/modes/tcl.el.Z|
55 55
56;; CUSTOMIZATION NOTES: 56;; CUSTOMIZATION NOTES:
57;; * tcl-proc-list can be used to customize a list of things that 57;; * tcl-proc-list can be used to customize a list of things that
@@ -65,6 +65,11 @@
65 65
66;; Change log: 66;; Change log:
67;; $Log: tcl.el,v $ 67;; $Log: tcl.el,v $
68;; Revision 1.28 1995/04/08 19:52:50 tromey
69;; (tcl-outline-level): New function
70;; (tcl-mode): Added outline-handling stuff.
71;; From Jesper Pedersen <blackie@imada.ou.dk>
72;;
68;; Revision 1.27 1994/10/11 02:01:27 tromey 73;; Revision 1.27 1994/10/11 02:01:27 tromey
69;; (tcl-mode): imenu-create-index-function made buffer local. 74;; (tcl-mode): imenu-create-index-function made buffer local.
70;; 75;;
@@ -210,6 +215,7 @@
210;; Carl Witty <cwitty@ai.mit.edu> 215;; Carl Witty <cwitty@ai.mit.edu>
211;; T. V. Raman <raman@crl.dec.com> 216;; T. V. Raman <raman@crl.dec.com>
212;; Jesper Pedersen <blackie@imada.ou.dk> 217;; Jesper Pedersen <blackie@imada.ou.dk>
218;; dfarmer@evolving.com (Doug Farmer)
213 219
214;; KNOWN BUGS: 220;; KNOWN BUGS:
215;; * indent-region should skip blank lines. (It does in v19, so I'm 221;; * indent-region should skip blank lines. (It does in v19, so I'm
@@ -253,7 +259,6 @@
253;; * Consider writing code to find help files automatically (for 259;; * Consider writing code to find help files automatically (for
254;; common cases). 260;; common cases).
255;; * `#' shouldn't insert `\#' when point is in string. 261;; * `#' shouldn't insert `\#' when point is in string.
256;; * '}' doesn't seem to reindent.
257 262
258 263
259 264
@@ -262,15 +267,15 @@
262;; I sure wish Emacs had a package that made it easy to extract this 267;; I sure wish Emacs had a package that made it easy to extract this
263;; sort of information. 268;; sort of information.
264(defconst tcl-using-emacs-19 (string-match "19\\." emacs-version) 269(defconst tcl-using-emacs-19 (string-match "19\\." emacs-version)
265 "Nil unless using Emacs 19 (Lucid or FSF).") 270 "Nil unless using Emacs 19 (XEmacs or FSF).")
266 271
267;; FIXME this will break on Emacs 19.100. 272;; FIXME this will break on Emacs 19.100.
268(defconst tcl-using-emacs-19-23 273(defconst tcl-using-emacs-19-23
269 (string-match "19\\.\\(2[3-9]\\|[3-9][0-9]\\)" emacs-version) 274 (string-match "19\\.\\(2[3-9]\\|[3-9][0-9]\\)" emacs-version)
270 "Nil unless using Emacs 19-23 or later.") 275 "Nil unless using Emacs 19-23 or later.")
271 276
272(defconst tcl-using-lemacs-19 (string-match "Lucid" emacs-version) 277(defconst tcl-using-xemacs-19 (string-match "XEmacs" emacs-version)
273 "Nil unless using Lucid Emacs).") 278 "Nil unless using XEmacs).")
274 279
275(require 'comint) 280(require 'comint)
276 281
@@ -279,12 +284,12 @@
279(and (fboundp 'eval-when-compile) 284(and (fboundp 'eval-when-compile)
280 (eval-when-compile 285 (eval-when-compile
281 (if (and (string-match "19\\." emacs-version) 286 (if (and (string-match "19\\." emacs-version)
282 (not (string-match "Lucid" emacs-version))) 287 (not (string-match "XEmacs" emacs-version)))
283 (require 'imenu)) 288 (require 'imenu))
284 ())) 289 ()))
285 290
286(defconst tcl-version "$Revision: 1.27 $") 291(defconst tcl-version "$Revision: 1.28 $")
287(defconst tcl-maintainer "Tom Tromey <tromey@busco.lanl.gov>") 292(defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>")
288 293
289;; 294;;
290;; User variables. 295;; User variables.
@@ -400,8 +405,8 @@ quoted for Tcl.")
400(defvar inferior-tcl-mode-map nil 405(defvar inferior-tcl-mode-map nil
401 "Keymap used in Inferior Tcl mode.") 406 "Keymap used in Inferior Tcl mode.")
402 407
403;; Lucid Emacs menu. 408;; XEmacs menu.
404(defvar tcl-lucid-menu 409(defvar tcl-xemacs-menu
405 '("Tcl" 410 '("Tcl"
406 ["Beginning of function" tcl-beginning-of-defun t] 411 ["Beginning of function" tcl-beginning-of-defun t]
407 ["End of function" tcl-end-of-defun t] 412 ["End of function" tcl-end-of-defun t]
@@ -421,7 +426,7 @@ quoted for Tcl.")
421 "----" 426 "----"
422 ["Tcl help" tcl-help-on-word tcl-help-directory-list] 427 ["Tcl help" tcl-help-on-word tcl-help-directory-list]
423 ["Send bug report" tcl-submit-bug-report t]) 428 ["Send bug report" tcl-submit-bug-report t])
424 "Lucid Emacs menu for Tcl mode.") 429 "XEmacs menu for Tcl mode.")
425 430
426;; GNU Emacs does menus via keymaps. Do it in a function in case we 431;; GNU Emacs does menus via keymaps. Do it in a function in case we
427;; later decide to add it to inferior Tcl mode as well. 432;; later decide to add it to inferior Tcl mode as well.
@@ -429,7 +434,7 @@ quoted for Tcl.")
429 (define-key map [menu-bar] (make-sparse-keymap)) 434 (define-key map [menu-bar] (make-sparse-keymap))
430 ;; This fails in Emacs 19.22 and earlier. 435 ;; This fails in Emacs 19.22 and earlier.
431 (require 'lmenu) 436 (require 'lmenu)
432 (let ((menu (make-lucid-menu-keymap "Tcl" (cdr tcl-lucid-menu)))) 437 (let ((menu (make-xemacs-menu-keymap "Tcl" (cdr tcl-xemacs-menu))))
433 (define-key map [menu-bar tcl] (cons "Tcl" menu)) 438 (define-key map [menu-bar tcl] (cons "Tcl" menu))
434 ;; The following is intended to compute the key sequence 439 ;; The following is intended to compute the key sequence
435 ;; information for the menu. It doesn't work. 440 ;; information for the menu. It doesn't work.
@@ -464,11 +469,10 @@ quoted for Tcl.")
464 (define-key tcl-mode-map "\C-c\C-s" 'switch-to-tcl) 469 (define-key tcl-mode-map "\C-c\C-s" 'switch-to-tcl)
465 470
466 ;; Make menus. 471 ;; Make menus.
467 (if tcl-using-emacs-19 472 (if (and tcl-using-emacs-19 (not tcl-using-xemacs-19))
468 (if tcl-using-lemacs-19 473 (progn
469 ;; In Lucid, button 3 seems to be the standard for this. 474 ;; In FSF 19, there is no standard button for the popup menu,
470 (define-key tcl-mode-map 'button3 'tcl-popup-menu) 475 ;; so I use shift-button2.
471 ;; In FSF 19, there is no standard, so I use shift-button2.
472 (tcl-add-fsf-menu tcl-mode-map) 476 (tcl-add-fsf-menu tcl-mode-map)
473 (define-key tcl-mode-map [S-down-mouse-2] 'tcl-popup-menu)))) 477 (define-key tcl-mode-map [S-down-mouse-2] 'tcl-popup-menu))))
474 478
@@ -652,7 +656,7 @@ is a Tcl expression, and the last argument is Tcl commands.")
652;; We use this because Lemacs 19.9 has what we need. 656;; We use this because Lemacs 19.9 has what we need.
653(defconst tcl-pps-has-arg-6 657(defconst tcl-pps-has-arg-6
654 (or tcl-using-emacs-19 658 (or tcl-using-emacs-19
655 (and tcl-using-lemacs-19 659 (and tcl-using-xemacs-19
656 (condition-case nil 660 (condition-case nil
657 (progn 661 (progn
658 (parse-partial-sexp (point) (point) nil nil nil t) 662 (parse-partial-sexp (point) (point) nil nil nil t)
@@ -750,14 +754,14 @@ An end of a defun is found by moving forward from the beginning of one."
750 (backward-paragraph)) 754 (backward-paragraph))
751 755
752;; In GNU Emacs 19-23 and later, mark-defun works as advertised. I 756;; In GNU Emacs 19-23 and later, mark-defun works as advertised. I
753;; don't know about Lucid Emacs, so for now it and Emacs 18 just lose. 757;; don't know about XEmacs, so for now it and Emacs 18 just lose.
754(fset 'tcl-mark-defun 758(fset 'tcl-mark-defun
755 (if tcl-using-emacs-19-23 759 (if tcl-using-emacs-19-23
756 'mark-defun 760 'mark-defun
757 'tcl-internal-mark-defun)) 761 'tcl-internal-mark-defun))
758 762
759;; In GNU Emacs 19, mark takes an additional "force" argument. I 763;; In GNU Emacs 19, mark takes an additional "force" argument. I
760;; don't know about Lucid Emacs, so I'm just assuming it is the same. 764;; don't know about XEmacs, so I'm just assuming it is the same.
761;; Emacs 18 doesn't have this argument. 765;; Emacs 18 doesn't have this argument.
762(defun tcl-mark () 766(defun tcl-mark ()
763 "Return mark, or nil if none." 767 "Return mark, or nil if none."
@@ -896,10 +900,10 @@ Commands:
896 900
897 (if tcl-using-emacs-19 901 (if tcl-using-emacs-19
898 (progn 902 (progn
899 ;; This can only be set to t in Emacs 19 and Lucid Emacs. 903 ;; This can only be set to t in Emacs 19 and XEmacs.
900 ;; Emacs 18 and Epoch lose. 904 ;; Emacs 18 and Epoch lose.
901 (setq parse-sexp-ignore-comments t) 905 (setq parse-sexp-ignore-comments t)
902 ;; Lucid Emacs has defun-prompt-regexp, but I don't believe 906 ;; XEmacs has defun-prompt-regexp, but I don't believe
903 ;; that it works for end-of-defun -- only for 907 ;; that it works for end-of-defun -- only for
904 ;; beginning-of-defun. 908 ;; beginning-of-defun.
905 (make-local-variable 'defun-prompt-regexp) 909 (make-local-variable 'defun-prompt-regexp)
@@ -910,14 +914,17 @@ Commands:
910 (setq add-log-current-defun-function 'add-log-tcl-defun)) 914 (setq add-log-current-defun-function 'add-log-tcl-defun))
911 (setq parse-sexp-ignore-comments nil)) 915 (setq parse-sexp-ignore-comments nil))
912 916
913 ;; Put Tcl menu into menubar for Lucid Emacs. This happens 917 ;; Put Tcl menu into menubar for XEmacs. This happens
914 ;; automatically for GNU Emacs. 918 ;; automatically for GNU Emacs.
915 (if (and tcl-using-lemacs-19 919 (if (and tcl-using-xemacs-19
916 current-menubar 920 current-menubar
917 (not (assoc "Tcl" current-menubar))) 921 (not (assoc "Tcl" current-menubar)))
918 (progn 922 (progn
919 (set-buffer-menubar (copy-sequence current-menubar)) 923 (set-buffer-menubar (copy-sequence current-menubar))
920 (add-menu nil "Tcl" tcl-lucid-menu))) 924 (add-menu nil "Tcl" tcl-lucid-menu)))
925 ;; Append Tcl menu to popup menu for XEmacs.
926 (if (and tcl-using-xemacs-19 (not (boundp 'mode-popup-menu)))
927 (setq mode-popup-menu tcl-xemacs-menu))
921 928
922 (run-hooks 'tcl-mode-hook)) 929 (run-hooks 'tcl-mode-hook))
923 930
@@ -1959,17 +1966,17 @@ The first line is assumed to look like \"#!.../program ...\"."
1959 1966
1960 1967
1961;; 1968;;
1962;; Lucid menu support. 1969;; XEmacs menu support.
1963;; Taken from schmid@fb3-s7.math.TU-Berlin.DE (Gregor Schmid), 1970;; Taken from schmid@fb3-s7.math.TU-Berlin.DE (Gregor Schmid),
1964;; who wrote a different Tcl mode. 1971;; who wrote a different Tcl mode.
1965;; We also have support for menus in FSF. We do this by 1972;; We also have support for menus in FSF. We do this by
1966;; loading the Lucid menu emulation code. 1973;; loading the XEmacs menu emulation code.
1967;; 1974;;
1968 1975
1969(defun tcl-popup-menu (e) 1976(defun tcl-popup-menu (e)
1970 (interactive "@e") 1977 (interactive "@e")
1971 (and tcl-using-emacs-19 1978 (and tcl-using-emacs-19
1972 (not tcl-using-lemacs-19) 1979 (not tcl-using-xemacs-19)
1973 (if tcl-using-emacs-19-23 1980 (if tcl-using-emacs-19-23
1974 (require 'lmenu) 1981 (require 'lmenu)
1975 ;; CAVEATS: 1982 ;; CAVEATS:
@@ -1980,7 +1987,7 @@ The first line is assumed to look like \"#!.../program ...\"."
1980 ;; using an Emacs before that just suffer. 1987 ;; using an Emacs before that just suffer.
1981 (require 'menubar "lmenu"))) ;; This is annoying 1988 (require 'menubar "lmenu"))) ;; This is annoying
1982 ;; IMHO popup-menu should be autoloaded in FSF Emacs. Oh well. 1989 ;; IMHO popup-menu should be autoloaded in FSF Emacs. Oh well.
1983 (popup-menu tcl-lucid-menu)) 1990 (popup-menu tcl-xemacs-menu))
1984 1991
1985 1992
1986 1993
@@ -2031,7 +2038,7 @@ The first line is assumed to look like \"#!.../program ...\"."
2031 inferior-tcl-source-command 2038 inferior-tcl-source-command
2032 tcl-using-emacs-19 2039 tcl-using-emacs-19
2033 tcl-using-emacs-19-23 2040 tcl-using-emacs-19-23
2034 tcl-using-lemacs-19 2041 tcl-using-xemacs-19
2035 tcl-proc-list 2042 tcl-proc-list
2036 tcl-proc-regexp 2043 tcl-proc-regexp
2037 tcl-typeword-list 2044 tcl-typeword-list