annotate lisp/energize/energize-menus.el @ 71:bae944334fa4

Added tag r20-0b30 for changeset 131b0175ea99
author cvs
date Mon, 13 Aug 2007 09:03:07 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; -*- Mode:Emacs-Lisp -*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Copyright (C) 1992, 1993, 1994 by Lucid, Inc. All Rights Reserved.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;; Copyright (C) 1995 by INS Engineering.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; The names of the menu items (as emacs sees them) are short and ugly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; These are the names by which the Energize protocol knows the commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; The menu items are made to display in a more human-friendly way via the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; X resource database, which is expected to contain entries like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; *buildanddebug.labelString: Build and Debug
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; in the Emacs app-defaults file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; We need to map these short Energize-names to the functions which invoke
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; them; we do this via the energize-menu-item-table, which is an obarray
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; hash table associating the names with the functions. We do the reverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; association via an 'energize-name property on the function's name symbol.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; Sometimes the short ugly names show up in error messages; probably we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; should read the resource database to get the pretty names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 (require 'menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 (defvar sc-mode nil) ; just so it has a value even if not loaded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 (defvar font-lock-mode nil) ; likewise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (defconst energize-menu-item-table (make-vector 511 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 "obarray used for fast mapping of symbolic energize request-names to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 functions that invoke them.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (defvar energize-default-menu-state ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 "List of the Energize menu items associated with every buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (defvar energize-menu-state ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 "Buffer local variable listing the menu items associated with a buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; When it is made local, don't kill it when kill-all-local-variables is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; called (as from the major mode via revert-buffer) or else we tend to lose
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; the information, as the ProposeChoicesRequest comes in at an inopportune
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (put 'energize-menu-state 'permanent-local t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;;; Hook to update the menu state when the kernel tells us it changed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (defun energize-update-menu-state (items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (let ((buffer (car items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (previous-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (if (null buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (setq energize-default-menu-state items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (setq energize-menu-state items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (set-buffer previous-buffer)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (setq energize-menu-update-hook 'energize-update-menu-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;;; The energize-with-timeout macro is used to show to the user that we are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;;; waiting for a reply from the energize kernel when it is too slow.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (defvar initial-energize-timeout-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (let ((l '("." ".." "..." "...." "....." "......" "......." "........")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (nconc l l)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (defvar energize-timeout-state initial-energize-timeout-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (defun energize-warn-kernel-slow (pair)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (setq energize-timeout-state (cdr energize-timeout-state))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (message "%s Type %c to cancel%s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (car pair) (quit-char) (car energize-timeout-state))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (rplacd pair t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (defmacro energize-with-timeout (notice &rest body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (list 'let* (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (list 'timeout-pair (list 'cons notice nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 '(timeout (add-timeout 1.5 'energize-warn-kernel-slow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 timeout-pair 1.5)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (list 'unwind-protect (cons 'progn body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 '(disable-timeout timeout)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 '(setq energize-timeout-state initial-energize-timeout-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 '(if (cdr timeout-pair) (message "")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defun energize-def-menu-item (name function &optional dont-define)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;; function->name mapping is on the function name's plist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ;; name->function mapping is via an obarray
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ;; dont-define means it already has a function definition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (put function 'energize-name (purecopy name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (set (intern name energize-menu-item-table) function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;; Define the (trivial) function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;; It's ok that this function is interpreted, because it contains only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;; one function call with constant args, so it's just as fast as it would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;; be if it were byte-coded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (if (not dont-define)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (fset function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (` (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (, (format "Executes the Energize \"%s\" command." name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (energize-execute-command (, name)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ;; Return the menu-item descriptor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (vector (purecopy name) function nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (defmacro energize-def-menu (menu-name &rest items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (` (list (, menu-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (,@ (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 '(lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (if (and (consp x) (stringp (car x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (cons 'energize-def-menu-item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (mapcar '(lambda (xx)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (if (stringp xx)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (purecopy xx)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (list 'quote xx)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 items)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (put 'energize-def-menu 'lisp-indent-function 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;; If menubar-religion is 'winning, the menubar looks like jwz likes it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;; If menubar-religion is 'losing, the menubar looks like Gareth and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; documentation folks like it. See also menubar.el - it consults this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; variable for the layout of the File menu which is inherited here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (defconst energize-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (purecopy-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ["sheet" energize-toggle-psheet nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ;; Perform some surgery on the default File menu to insert our items.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;; This is to avoid having to duplicate it here... Don't try this at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;; home, kids!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;;; (let* ((file (copy-sequence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;;; (car (find-menu-item default-menubar '("File")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;;; (print (car (find-menu-item file '("Print Buffer"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;;; (exit (car (find-menu-item file '("Exit XEmacs"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;;; (print-cons (memq print file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;;; (exit-cons (memq exit file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;; )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;;; ;; Insert "Print Annotated" just after "Print"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;;; (setcdr print-cons (cons '["Print Annotated Buffer"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ;;; energize-annotate-print-ps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;;; t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ;;; (cdr print-cons)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;;; ;; Insert "Checkpoint" and "Shutdown" just before "Exit XEmacs".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ;;; (setcar exit-cons ["Connect to Energize" energize-menu-connect-directly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ;;; (not (connected-to-energize-p))])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ;;; (setcdr exit-cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ;;; (nconc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ;;; (list (energize-def-menu-item "checkpoint"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;;; 'energize-checkpoint-database)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;;; ["Disconnect from Energize" disconnect-from-energize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;;; (connected-to-energize-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ;;; "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ;;; (energize-def-menu-item "energizeShutdownServer"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;;; 'energize-kill-server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;;; )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;;; (if (not (eq menubar-religion 'winning))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ;;; (list "----"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;;; (list exit)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ;;; file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ;; this is the losing menubar-religion...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (` ("File"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ["New Frame" make-frame t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 ["Open..." find-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ["Save" save-buffer nil "menubar.el"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ["Save As..." write-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ["Save Some Buffers" save-some-buffers t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ["Insert File..." insert-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ["Print Buffer" lpr-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ["Print Annotated Buffer" energize-annotate-print-ps t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ["Delete Frame" delete-frame t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ["Kill Buffer" kill-this-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ["Revert Buffer" revert-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ("Compare"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ["Two Files ..." ediff-files t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ["Two Buffers ..." ediff-buffers t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ["Three Files ..." ediff-files3 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ["Three Buffers ..." ediff-buffers3 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ["Windows ..." ediff-windows t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ["Small Regions ..." ediff-small-regions t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ["Large Regions ..." ediff-large-regions t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ["File with Revision ..." ediff-revision t])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ("Merge"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ["Files ..." ediff-merge-files t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ["Files with Ancestor ..." ediff-merge-files-with-ancestor t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ["Buffers ..." ediff-merge-buffers t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ["Buffers with Ancestor ..." ediff-merge-buffers-with-ancestor t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ["Revisions ..." ediff-merge-revisions t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 ["Revisions with Ancestor ..." ediff-merge-revisions-with-ancestor t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ("Apply Patch"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 ["To a file ..." ediff-patch-file t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 ["To a buffer ..." ediff-patch-buffer t])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ["Connect to Energize" energize-menu-connect-directly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (not (connected-to-energize-p))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (, (energize-def-menu-item "checkpoint" 'energize-checkpoint-database))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ["Disconnect from Energize" disconnect-from-energize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (connected-to-energize-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (, (energize-def-menu-item "energizeShutdownServer" 'energize-kill-server))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ["Exit XEmacs" save-buffers-kill-emacs t]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ;; Energize also adds some menu items to the middle of the "Edit" menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ;; Someday these should be moved to the default menubar, maybe, once it's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ;; easier to define `energize-search' in a non-Energize world.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (let* ((edit (copy-sequence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (car (find-menu-item default-menubar '("Edit")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (clear (car (find-menu-item edit '("Clear"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (clear-cons (memq clear edit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ;; Insert these just after "Clear"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (setcdr clear-cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (append '("-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 ["Search and Replace..." energize-search t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 ["Search Selection Forward" ow-find
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (or ow-find-last-string (x-selection-owner-p))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 ["Search Selection Backward" ow-find-backward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (or ow-find-last-string (x-selection-owner-p))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (cdr clear-cons)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 edit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (energize-def-menu "Browse"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ["editdef" energize-edit-definition t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 ("editdec" energize-edit-declaration-dbox)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 ("calltreebrowser" energize-browse-tree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 ("classbrowser" energize-browse-class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ("lebrowser" energize-browse-language-elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 ("includers" energize-where-included)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ;; Make Energize control the selectability of these, but don't define
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;; the functions here (they are defined in lisp, not as aliases for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;; an Energize command.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;; No, this doesn't seem to work. Energize disowns all knowledge.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ["visituse" energize-next-use-start (connected-to-energize-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ["nextuse" energize-next-use-command (connected-to-energize-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ["List History" energize-history (connected-to-energize-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ["Step Back in History" energize-history-previous (connected-to-energize-p)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ("energize" energize-pop-to-energize-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ("showsystemlog" energize-browse-system-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 ("errorbrowser" energize-browse-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ("toolstatus" energize-browse-toolstat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ["Shell" shell t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (if (eq menubar-religion 'winning)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; Winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 "Options"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (energize-def-menu-item "debuggerpanel" 'energize-show-debugger-panel)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ["Read Only" toggle-read-only :style toggle :selected buffer-read-only]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 ["Case Sensitive Search" (setq case-fold-search (not case-fold-search))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 :style toggle :selected (not case-fold-search)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 ["Case Sensitive Replace" (setq case-replace (not case-replace))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 :style toggle :selected (not case-replace)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 ["Overstrike" overwrite-mode :style toggle :selected overwrite-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ["Auto Delete Selection" (if (memq 'pending-delete-pre-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 pre-command-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (pending-delete-off nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (pending-delete-on nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 :style toggle :selected (memq 'pending-delete-pre-hook pre-command-hook)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 ["Teach Extended Commands" (setq teach-extended-commands-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (not teach-extended-commands-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 :style toggle :selected teach-extended-commands-p]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ["Debug On Error" (setq debug-on-error (not debug-on-error))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 :style toggle :selected debug-on-error]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ; ["Line Numbers" (line-number-mode nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ; :style toggle :selected line-number-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (append '("Syntax Highlighting"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ["None" (font-lock-mode 0) :style radio :selected (null font-lock-mode)])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (and (not (string-match "Widec" emacs-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (list ["Fonts" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (font-lock-use-default-fonts)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (equal (find-face 'italic) ; kind of a kludge...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (find-face 'font-lock-comment-face)))]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ["Colors" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (font-lock-use-default-colors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (not (equal (find-face 'italic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (find-face 'font-lock-comment-face))))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ["Less" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (font-lock-use-default-minimal-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (font-lock-mode 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (eq c++-font-lock-keywords c-font-lock-keywords-1))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 ["More" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (font-lock-use-default-maximal-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (font-lock-mode 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (eq c++-font-lock-keywords c-font-lock-keywords-2))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 ["Fast" (progn (require 'fast-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (if fast-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (fast-lock-mode 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 ;; this shouldn't be necessary so there has to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 ;; be a redisplay bug lurking somewhere (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 ;; possibly another event handler bug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (force-mode-line-update))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (if font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (fast-lock-mode 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (force-mode-line-update)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 :style toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 :selected fast-lock-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 '("Paren Highlighting"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 ["None" (paren-set-mode -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 :style radio :selected (not paren-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 ["Blinking Paren" (paren-set-mode 'blink-paren)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 :style radio :selected (eq paren-mode 'blink-paren)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 ["Steady Paren" (paren-set-mode 'paren)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 :style radio :selected (eq paren-mode 'paren)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ["Expression" (paren-set-mode 'sexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 :style radio :selected (eq paren-mode 'sexp)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 ["Nested Shading" (paren-set-mode 'nested)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 :style radio :selected (eq paren-mode 'nested) :enabled nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 '("Font" "initialized later")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 '("Size" "initialized later")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 '("Weight" "initialized later")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 ["Edit faces" edit-faces t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ["Energize Edit Modes..." energize-set-edit-modes t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (energize-def-menu-item "setprojectdisplay"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 'energize-set-project-display)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (list "Target Display"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (energize-def-menu-item "fulltargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 'energize-full-targets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (energize-def-menu-item "abbreviatetargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 'energize-abbreviate-targets))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 '("Source Control"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 ["None" (sc-mode nil) :style radio :selected (eq sc-mode nil)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ["SCCS" (sc-mode 'SCCS) :style radio :selected (eq sc-mode 'SCCS)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 ["RCS" (sc-mode 'RCS) :style radio :selected (eq sc-mode 'RCS)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 ["CVS" (sc-mode 'CVS) :style radio :selected (eq sc-mode 'CVS)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 ["ClearCase" (sc-mode 'CCASE):style radio :selected (eq sc-mode 'CCASE)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 ["Buffers Menu Length..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (setq buffers-menu-max-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 "Enter number of buffers to display (or 0 for unlimited): "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (if (eq buffers-menu-max-size 0) (setq buffers-menu-max-size nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 ["Buffers Sub-Menus" (setq complex-buffers-menu-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (not complex-buffers-menu-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 :style toggle :selected complex-buffers-menu-p]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 ["Save Options" save-options-menu-settings t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 ;; Non-winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 "Options"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 ["Split Screen" split-window-vertically t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 ["Unsplit" delete-other-windows t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (energize-def-menu-item "debuggerpanel" 'energize-show-debugger-panel)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 ["Read Only" toggle-read-only :style toggle :selected buffer-read-only]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 ["Overstrike " overwrite-mode :style toggle :selected overwrite-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 ["Auto Delete Selection" (if (memq 'pending-delete-pre-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 pre-command-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (pending-delete-off nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (pending-delete-on nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 :style toggle :selected (memq 'pending-delete-pre-hook pre-command-hook)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 ["Teach Extended" (setq teach-extended-commands-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (not teach-extended-commands-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 :style toggle :selected teach-extended-commands-p]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 '("Font" "initialized later")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 '("Size" "initialized later")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 '("Weight" "initialized later")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 "------"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (append '("Syntax Highlighting"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 ["None" (font-lock-mode 0) :style radio :selected (null font-lock-mode)])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (and (not (string-match "Widec" emacs-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (list ["Fonts" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (font-lock-use-default-fonts)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (equal (find-face 'italic) ; kind of a kludge...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (find-face 'font-lock-comment-face)))]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 ["Colors" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (font-lock-use-default-colors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (not (equal (find-face 'italic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (find-face 'font-lock-comment-face))))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ["Less" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (font-lock-use-default-minimal-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (font-lock-mode 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (eq c++-font-lock-keywords c-font-lock-keywords-1))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 ["More" (progn (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (font-lock-use-default-maximal-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (font-lock-mode 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (font-lock-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 :selected (and font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (eq c++-font-lock-keywords c-font-lock-keywords-2))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 ["Fast" (progn (require 'fast-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (if fast-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (fast-lock-mode 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 ;; this shouldn't be necessary so there has to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 ;; be a redisplay bug lurking somewhere (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 ;; possibly another event handler bug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (force-mode-line-update))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (if font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (fast-lock-mode 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (force-mode-line-update)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 :active font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 :style toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 :selected fast-lock-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 '("Paren Highlighting"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 ["None" (blink-paren 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 :selected (not (memq 'blink-paren-pre-command pre-command-hook))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 ["Blink" (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (setq highlight-paren-expression nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (blink-paren 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 :selected (and (not highlight-paren-expression)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (memq 'blink-paren-pre-command pre-command-hook))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 ["Highlight" (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (setq highlight-paren-expression t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (blink-paren 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 :style radio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 :selected (and highlight-paren-expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (memq 'blink-paren-pre-command pre-command-hook))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 ["Energize Edit Modes..." energize-set-edit-modes t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (energize-def-menu-item "setprojectdisplay"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 'energize-set-project-display)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (list "Target Display"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (energize-def-menu-item "fulltargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 'energize-full-targets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (energize-def-menu-item "abbreviatetargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 'energize-abbreviate-targets))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 ["Buffers Length..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (setq buffers-menu-max-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 "Enter number of buffers to display (or 0 for unlimited): "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (if (eq buffers-menu-max-size 0) (setq buffers-menu-max-size nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 ["Buffers Menus" (setq complex-buffers-menu-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (not complex-buffers-menu-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 :style toggle :selected complex-buffers-menu-p]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 '("Source Control"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 ["None" (sc-mode nil) :style radio :selected (eq sc-mode nil)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 ["SCCS" (sc-mode 'SCCS) :style radio :selected (eq sc-mode 'SCCS)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 ["RCS" (sc-mode 'RCS) :style radio :selected (eq sc-mode 'RCS)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 ["CVS" (sc-mode 'CVS) :style radio :selected (eq sc-mode 'CVS)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ["ClearCase" (sc-mode 'CCASE):style radio :selected (eq sc-mode 'CCASE)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 ["Save Options" save-options-menu-settings t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (if (eq menubar-religion 'winning)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (energize-def-menu "Debug"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 ;; Winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 ("debugprogram" energize-debug-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 ("runprogram" energize-run-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 ;; Make Energize control the selectability of the setbreakpoint item, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 ;; don't define the function here (it just runs the existing gdb-break
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 ;; command, which is advised to hack Energize.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 ("setbreakpoint" gdb-break t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 ("breaklist" energize-list-breakpoints)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 ["Next Error" next-error t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 ["Previous Error" previous-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 :keys "\\[universal-argument] \\[next-error]"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 ("errorbrowser" energize-browse-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 ("clearerrorlog" energize-clear-error-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 ("cleardebuggerlog" energize-clear-debugger-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ("closeprogram" energize-debugger-kill-program)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 ("quitdebugger" energize-quit-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (energize-def-menu "Debug"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 ;; Non-winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 ("debugprogram" energize-debug-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 ("runprogram" energize-run-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 ;; Make Energize control the selectability of the setbreakpoint item, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 ;; don't define the function here (it just runs the existing gdb-break
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 ;; command, which is advised to hack Energize.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 ("setbreakpoint" gdb-break t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 ("debuggerpanel" energize-show-debugger-panel)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 ("breaklist" energize-list-breakpoints)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 ("cleardebuggerlog" energize-clear-debugger-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 ("errorbrowser" energize-browse-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 ("clearerrorlog" energize-clear-error-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 ["Next Error" next-error t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 ["Previous Error" previous-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 :keys "\\[universal-argument] \\[next-error]"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 ("closeprogram" energize-debugger-kill-program)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 ("quitdebugger" energize-quit-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (if (eq menubar-religion 'winning)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (energize-def-menu "Compile"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 ;; Winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 ("buildatarget" energize-build-a-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 ("custombuildatarget" energize-custom-build-a-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 ;; Matthieu believed that this could be done now; however it would seem that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 ;; it still can't. So out it goes for the time being.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 ;; "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 ;; ("Terminate Build" energize-abort-build)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 ["Next Error" next-error t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 ["Previous Error" previous-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 :keys "\\[universal-argument] \\[next-error]"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 ("errorbrowser" energize-browse-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 ("clearerrorlog" energize-clear-error-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 ("defaultcompile" energize-default-compile-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 ("custombuildfile" energize-custom-build-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 ("deleteallobjects" energize-delete-object-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (energize-def-menu "Compile"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 ;; Non-winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 ("buildatarget" energize-build-a-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 ("custombuildatarget" energize-custom-build-a-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 ("defaultcompile" energize-default-compile-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 ("custombuildfile" energize-custom-build-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 ("errorbrowser" energize-browse-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 ("clearerrorlog" energize-clear-error-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 ["Next Error" next-error t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 ["Previous Error" previous-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 :keys "\\[universal-argument] \\[next-error]"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ;; Matthieu believed that this could be done now; however it would seem that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 ;; it still can't. So out it goes for the time being.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 ;; "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 ;; ("Terminate Build" energize-abort-build)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 ("deleteallobjects" energize-delete-object-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (if (eq menubar-religion 'winning)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (list "Project"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 ;; Winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (energize-def-menu-item "newproject" 'energize-new-project)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (energize-def-menu-item "findproject" 'energize-find-project)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 ["Save Project" save-buffer (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 ["Current Project" energize-pop-to-project-buffer nil nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (energize-def-menu-item "energize" 'energize-pop-to-energize-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 '("addprojectentry"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 ["addobjectfiletarget" energize-insert-object-file-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 ["addexecutabletarget" energize-insert-executable-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 ["addlibrarytarget" energize-insert-library-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 ["addcollectiontarget" energize-insert-collection-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 ["addtargettarget" energize-insert-target-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 ["addfiletarget" energize-insert-file-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 ["addrule" energize-insert-rule
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (energize-def-menu-item "instrumentatarget" 'energize-instrument-a-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (energize-def-menu-item "importproject" 'energize-import-project)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (energize-def-menu-item "importprojectlist" 'energize-import-project-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (energize-def-menu-item "writeprojectlist" 'energize-write-project-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (energize-def-menu-item "setprojectdisplay"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 'energize-set-project-display)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 (list "Target Display"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (energize-def-menu-item "fulltargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 'energize-full-targets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (energize-def-menu-item "abbreviatetargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 'energize-abbreviate-targets))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (energize-def-menu-item "revertproject"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 'energize-fully-revert-project-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 (list "Project"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 ;; Non-winning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 (energize-def-menu-item "newproject" 'energize-new-project)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (energize-def-menu-item "findproject" 'energize-find-project)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 ["Save Project" save-buffer (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (energize-def-menu-item "energize" 'energize-pop-to-energize-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 ["Current Project" energize-pop-to-project-buffer nil nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 ["New C/C++ File" energize-insert-object-file-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 '("addprojectentry"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 ["addobjectfiletarget" energize-insert-object-file-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 ["addexecutabletarget" energize-insert-executable-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 ["addlibrarytarget" energize-insert-library-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 ["addcollectiontarget" energize-insert-collection-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 ["addtargettarget" energize-insert-target-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 ["addfiletarget" energize-insert-file-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 ["addrule" energize-insert-rule
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 (eq major-mode 'energize-project-mode)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 (energize-def-menu-item "instrumentatarget" 'energize-instrument-a-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 (energize-def-menu-item "importproject" 'energize-import-project)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (energize-def-menu-item "importprojectlist" 'energize-import-project-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (energize-def-menu-item "writeprojectlist" 'energize-write-project-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 (energize-def-menu-item "setprojectdisplay"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 'energize-set-project-display)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 (list "Target Display"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (energize-def-menu-item "fulltargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 'energize-full-targets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 (energize-def-menu-item "abbreviatetargets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 'energize-abbreviate-targets))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (energize-def-menu-item "revertproject"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 'energize-fully-revert-project-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 '("Buffers" ["List All Buffers" list-buffers t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 "--!here" ; anything after this will be nuked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 nil ; the partition: menus after this are flushright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 ;; We don't make any changes to the Help menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 ;; WelcomeMat requires one change: added separately though
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (car (find-menu-item default-menubar '("Help")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 ;; For this command, the menu name (the resource) is "currentproject"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 ;; but the Energize command is "project". the Energize command is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 ;; historical, and the resource name was changed so that the "Project"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 ;; menu and the "Project" menu item don't necessarily have to be the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 ;; same text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (energize-def-menu-item "project" 'energize-pop-to-project-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 ;; code for tighter integration with specific tools
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 (defun energize-menu-connect-directly ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (connect-to-energize nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (defvar energize-instrument-menu-options nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 "List of menu items which are instruments for Energize targets")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (defun energize-define-instrumentatarget-using-tool (tool)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 "Add a menu item (and function) supporting instrumenting a particular tool"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (let ((function (intern (concat "energize-instrumentatarget-using-" tool)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (l energize-instrument-menu-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (name (if (equal tool "") "DBX Compatible" (capitalize tool))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 (add-menu-item '("Project") (cons name "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 '(connected-to-energize-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 "instrumentatarget")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (add-hook 'energize-hack-popup-hook 'energize-hack-instruments-in-popup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (while (and l (not (equal (car l) tool)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (setq l (cdr l)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (if (null l) (setq energize-instrument-menu-options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (cons tool energize-instrument-menu-options)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (fset function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 (` (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (, (format "Instruments a target using \"%s\"" tool))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (energize-execute-command "instrumentatarget" nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (, tool) t))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (defun energize-hack-instruments-in-popup (ex m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (let ((l (cdr m)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (while l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (if (equal (aref (car l) 0) "instrument")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (let ((r energize-instrument-menu-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 v)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (while r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (setq v (vconcat (car l)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 (let ((name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (if (equal (car r) "") "DBX Compatible"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (capitalize (car r)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (aset (car l) 0 name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (aset (car l) 1 (intern (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 "energize-instrumentatarget-using-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 (car r))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (setcdr l (cons v (cdr l)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (setq r (cdr r)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 (setq l nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 (setq l (cdr l))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (defun energize-sensitize-instruments-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 "Sensitize the menubar by adding the executable to any derived
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 instrumented targets"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (condition-case nil ; in case Project menu doesn't exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (let* ((l energize-instrument-menu-options)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (institem
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (car (find-menu-item current-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 '("Project" "instrumentatarget"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (exenable (aref institem 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (exname (aref institem 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (while l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 (let ((citem (if (equal (car l) "") "DBX Compatible" (car l))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (setq item (car (find-menu-item current-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (list "Project" citem)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (aset item 2 exenable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (aset item 3 exname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 (setq l (cdr l))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (error nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (defun energize-set-default-menubar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (set-menubar energize-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 (add-hook 'activate-menubar-hook 'build-buffers-menu-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 (add-hook 'activate-menubar-hook 'sensitize-file-and-edit-menus-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (add-hook 'activate-menubar-hook 'energize-sensitize-instruments-hook 't)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (setq buffers-menu-max-size 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (setq complex-buffers-menu-p nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (energize-set-default-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 ;; enable purify & plain dbx by default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 ;; you can enable the others by copying to .emacs and uncommenting ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 ;; can't do this here because this file comes preloaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (energize-define-instrumentatarget-using-tool "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 (energize-define-instrumentatarget-using-tool "purify")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 ;; (energize-define-instrumentatarget-using-tool "quantify")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 ;; (energize-define-instrumentatarget-using-tool "sentinel")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 ;; (energize-define-instrumentatarget-using-tool "tc")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 ;; (energize-define-instrumentatarget-using-tool "time")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 ;; (energize-define-instrumentatarget-using-tool "xproba")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 ;; add the menu item Help->About Energize for the Energize Welcome Mat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (add-menu-item '("Help") (purecopy "About Energize")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 'energize-about-energize t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 (defun energize-about-energize ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 (start-process "about-energize" nil "about_energize"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 (defun energize-kill-server ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 "Kill the Energize server and all buffers associated with it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (energize-execute-command "energizeShutdownServer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (error nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 (defun energize-unix-manual ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 "Display a manual entry; if connected to Energize, uses the Energize version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 Otherwise, just runs the normal emacs `manual-entry' command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (if (connected-to-energize-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 (energize-execute-command "manual")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (call-interactively 'manual-entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 ;;; These functions are used in the menubar activate hook to update the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 ;;; enable state of the menu items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 (defvar active-items) ; quiet compiler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 (defsubst activate-energize-menu-item-internal (item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 ((vectorp item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (let ((fn (aref item 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (if (not (and (symbolp fn) (get fn 'energize-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 ;; Referencing special binding of `active-items' from a-e-m-i-hook.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 ;; If the function which this item invokes is an Energize function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 ;; (determined by the presence of an 'energize-name property) then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 ;; make it be active iff it's on the active-items list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 (let ((active-p (assq fn active-items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 (change-p nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (if (not (eq (not active-p) (not (aref item 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 (aset item 2 (not (not active-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (setq change-p t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (if (and active-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (not (equal (cdr active-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 (if (> (length item) 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (aref item 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (aset item 3 (cdr active-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (setq change-p t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 change-p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 ((consp item) ; descend nested submenus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (activate-energize-menu-items-internal (cdr item)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (defun activate-energize-menu-items-internal (items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (let ((change-p nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (if (not (consp items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 (activate-energize-menu-item-internal items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (while items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (setq change-p (or (activate-energize-menu-item-internal (car items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 change-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 items (cdr items)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 change-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (defun energize-build-menubar-names ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 ;;; makes the list of currently active menu items.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (let* ((selection-p (x-selection-exists-p 'PRIMARY))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 (if (< (cdr (energize-protocol-level)) 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (energize-with-timeout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 "Getting updated menubar from Energize server..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 (energize-list-menu (current-buffer) () selection-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (append energize-menu-state energize-default-menu-state))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (delq nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 (mapcar '(lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 (and (vectorp x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 (if (/= 0 (logand 1 (aref x 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 (symbol-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 (intern-soft (aref x 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 energize-menu-item-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 (aref x 4)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 menubar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 (defun activate-energize-menu-items-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 ;; This is O^2 because of the `rassq', but it looks like the elisp part
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 ;; of it only takes .03 seconds.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (if (connected-to-energize-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 (let* ((items current-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 (change-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 ;; dynamically used by activate-energize-menu-item-internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 (active-items (energize-build-menubar-names))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 (while items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 (setq item (car items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 change-p (or (and item (activate-energize-menu-items-internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 (if (consp item) (cdr item) item)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 change-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 items (cdr items)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 (not change-p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 (add-hook 'activate-menubar-hook 'activate-energize-menu-items-hook t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (defun deactivate-all-energize-menu-items ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 (let ((items current-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 ;; dynamically used by activate-energize-menu-item-internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 (active-items nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 (while items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 (if (setq item (car items))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 (activate-energize-menu-items-internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 (if (consp item) (cdr item) item)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 (setq items (cdr items)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 ;;; The Options menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 (setq options-menu-saved-forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 options-menu-saved-forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 '((list 'energize-set-edit-modes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 (if energize-external-editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 (symbol-name energize-external-editor))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 (list 'quote energize-vi-terminal-emulator)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 (list 'quote energize-internal-viewer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (list 'quote energize-internal-editor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 (cond ((get 'browser 'instance-limit) ''multi)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 ((get 'energize-top-level-mode 'screen-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 ''several)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 (t ''single))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 (list 'quote energize-split-screens-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 (if sc-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 (list 'sc-mode (list 'quote sc-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 '(if (featurep 'generic-sc) (sc-mode nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 ;;; Popup-menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (defvar energize-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (defvar energize-hack-popup-hook '()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 "Hook for all functions that want to hack at the Energize popup menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 Each function takes two arguments: an extent (or nil if none) and a menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 (or nil if none currently). It should return a menu (or nil)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (defun energize-popup-menu (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (if (popup-menu-up-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 (if (null (event-over-text-area-p event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 ;; clicking in non-text areas was causing errors...way bogus!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (popup-mode-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 (let* ((buffer (event-buffer event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 (extent (if (extentp (event-glyph-extent event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 (event-glyph-extent event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 (energize-menu-extent-at (event-point event) buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 choices)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 (select-window (event-window event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 (energize-with-timeout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 "Asking Energize server for menu contents..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (setq choices
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (energize-list-menu buffer extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (x-selection-exists-p 'PRIMARY))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (if (or (null extent) (null choices))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (if (null (setq energize-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 (energize-extent-run-hook energize-hack-popup-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 nil nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 (error "No menu to pop up"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (force-highlight-extent extent t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (sit-for 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (setq energize-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 (cons "energizePopup"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (function (lambda (item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 (vector
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 (aref item 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (list 'energize-execute-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 (aref item 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 (= 0 (logand 1 (aref item 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (aref item 4))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 choices)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (setq energize-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (external-editor-hack-popup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (energize-extent-run-hook energize-hack-popup-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 extent energize-popup-menu))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 (if (equal (car energize-popup-menu) "energizePopup")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 (let ((popup-menu-titles nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (popup-menu 'energize-popup-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 (popup-menu 'energize-popup-menu))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 (defun energize-extent-run-hook (f ex m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 (if f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 (energize-extent-run-hook (cdr f) ex (funcall (car f) ex m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 ;;; Functions to interactively execute menu items by their names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 (defun energize-menu-extent-at (pos buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 (if (null pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (let ((extent (energize-extent-at pos buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 (if (and extent (energize-extent-menu-p extent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 ;;; functions to execute the menu with the keyboard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (defun default-selection-value-for-item (menu-item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 (let ((flags (aref menu-item 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 (cond ((= (logand flags 2) 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 (if (x-selection-owner-p 'PRIMARY)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (x-get-selection-internal 'PRIMARY 'STRING)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 ((= (logand flags 4) 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (if (x-selection-owner-p 'PRIMARY)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 (x-get-selection-internal 'PRIMARY 'ENERGIZE_OBJECT)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 ((= (logand flags 128) 128)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 (if (x-selection-owner-p 'SECONDARY)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 (x-get-selection-internal 'SECONDARY 'STRING)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 ((= (logand flags 256) 256)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 (if (x-selection-owner-p 'SECONDARY)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 (x-get-selection-internal 'SECONDARY 'ENERGIZE_OBJECT))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 (defun energize-execute-menu-item-with-selection (buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 selection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 no-confirm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (if (/= 0 (logand 1 (aref item 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 (error "The `%s' command is inappropriate in this context"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 (aref item 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 (if (null selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 (setq selection (default-selection-value-for-item item)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 (energize-execute-menu-item buffer extent item selection no-confirm))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 (defun energize-find-item (name list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 (let ((l list) i (found ()))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (while (and l (not found))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 (setq i (car l) l (cdr l))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 (if (and (vectorp i) (equal (aref i 0) name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 (setq found i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 found))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 (defun energize-menu-item-for-name (extent name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 (if (or extent (< (cdr (energize-protocol-level)) 7))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 (energize-with-timeout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 "Checking Energize command with kernel..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 (energize-list-menu (current-buffer) extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 (x-selection-exists-p 'PRIMARY) name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 (or (energize-find-item name energize-menu-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 (energize-find-item name energize-default-menu-state))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 (defun energize-execute-command (name &optional extent selection no-confirm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 ;; add completion here...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 (interactive "sExecute Energize command named: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 (if (not (stringp name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 (error "Can't execute a choice, %s, that is not a string" name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 (or (connected-to-energize-p) (error "Not connected to Energize"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 ;; patch the selection argument for "setbreakpoint"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 (if (and (equal name "setbreakpoint")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 (null selection))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 (setq selection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 (vector (energize-buffer-id (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 (progn (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 (energize-file-position (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 (progn (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 (energize-file-position (point))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (let* ((buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (extent (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 (if (extentp extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 (energize-menu-extent-at (point) buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 (if (< (cdr (energize-protocol-level)) 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 ;; old way
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 (let ((item (energize-menu-item-for-name extent name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 (if (not item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 (error "No Energize command named %s" name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 (energize-execute-menu-item-with-selection buffer extent item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 selection no-confirm))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 ;; new way
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 (if (and (null selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 (x-selection-exists-p 'PRIMARY))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 (setq selection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 (condition-case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 (x-get-selection-internal 'PRIMARY 'STRING)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 (error ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 (let ((energize-make-many-buffers-visible-should-enqueue-event
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 (equal name "save")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 (energize-execute-command-internal buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 selection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 no-confirm)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 ;;; Buffer modified the first time hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 ;;; Should be in energize-init.el but is here to benefit from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 ;;; add-timeout macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 (defun energize-check-if-buffer-locked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 (if (connected-to-energize-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 (energize-with-timeout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 "Asking Energize server if buffer is editable..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 (energize-barf-if-buffer-locked))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 (add-hook 'first-change-hook 'energize-check-if-buffer-locked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 ;;; Here's a converter that makes emacs understand how to convert to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 ;;; selections of type ENERGIZE. Eventually the Energize server won't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 ;;; be using the selection mechanism any more, I hope.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 (defun xselect-convert-to-energize (selection type value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 (let (str id start end tmp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 (cond ((and (consp value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (markerp (car value))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 (markerp (cdr value)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 (setq id (energize-buffer-id (marker-buffer (car value)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 start (1- (marker-position (car value))) ; zero based
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 end (1- (marker-position (cdr value)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 ((extentp value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 (setq id (extent-to-generic-id value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 start 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 (if (null id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (setq str (make-string 12 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (if (< end start) (setq tmp start start end end tmp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 (aset str 0 (logand (ash (car id) -8) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 (aset str 1 (logand (car id) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 (aset str 2 (logand (ash (cdr id) -8) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 (aset str 3 (logand (cdr id) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 (aset str 4 (logand (ash start -24) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 (aset str 5 (logand (ash start -16) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 (aset str 6 (logand (ash start -8) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 (aset str 7 (logand start 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 (aset str 8 (logand (ash end -24) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 (aset str 9 (logand (ash end -16) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 (aset str 10 (logand (ash end -8) 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (aset str 11 (logand end 255))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 (cons 'ENERGIZE_OBJECT str))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (or (assq 'ENERGIZE_OBJECT selection-converter-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (setq selection-converter-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 (cons '(ENERGIZE_OBJECT . xselect-convert-to-energize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 selection-converter-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 ;;; Function keys.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (defun energize-define-function-keys ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 "Define some Borland/Motif-like `F' keys for Energize."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (define-key global-map 'f1 'help-for-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 (define-key global-map 'f3 'energize-search)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 (define-key global-map '(shift delete) 'x-kill-primary-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (define-key global-map '(control insert) 'x-copy-primary-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 (define-key global-map '(shift insert) 'x-yank-clipboard-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 (define-key global-map '(control delete) 'x-delete-primary-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 (define-key global-map 'f7 'energize-browse-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (define-key global-map '(meta f7) 'next-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (define-key global-map '(meta f8) 'previous-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 (define-key global-map 'f9 'energize-build-a-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (define-key global-map '(meta f9) 'energize-default-compile-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (define-key global-map '(control f9) 'energize-run-target)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (define-key global-map '(meta shift f9) 'energize-abort-build)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (define-key global-map '(meta control ?.) 'energize-edit-declaration-dbox)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 (define-key global-map 'f5 'energize-browse-language-elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (define-key global-map '(shift f5) 'energize-next-use-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (define-key global-map '(control f5) 'energize-next-use-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207