annotate lisp/w3/w3-menu.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 8d2a9b52c682
children 1ce6082ce73f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1 ;;; w3-menu.el --- Menu functions for emacs-w3
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Author: wmperry
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
3 ;; Created: 1996/07/21 18:29:01
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
4 ;; Version: 1.7
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Keywords: menu, hypermedia
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;; You should have received a copy of the GNU General Public License
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
23 ;;; along with GNU Emacs; see the file COPYING. If not, write to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
24 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (require 'w3-vars)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; Spiffy new menus (for both Emacs and XEmacs)
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 w3-menu-fsfemacs-bookmark-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (defvar w3-menu-fsfemacs-debug-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (defvar w3-menu-fsfemacs-edit-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (defvar w3-menu-fsfemacs-file-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defvar w3-menu-fsfemacs-go-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (defvar w3-menu-fsfemacs-help-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defvar w3-menu-fsfemacs-view-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (defvar w3-menu-fsfemacs-options-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (defvar w3-menu-fsfemacs-style-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (defvar w3-menu-w3-menubar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defvar w3-links-menu nil "Menu for w3-mode in XEmacs.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (make-variable-buffer-local 'w3-links-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
44 (defvar w3-use-menus '(file edit view go bookmark options
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
45 buffers style emacs nil help)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 "*Non-nil value causes W3 to provide a menu interface.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 A value that is a list causes W3 to install its own menubar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 A value of 1 causes W3 to install a \"W3\" item in the Emacs menubar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 If the value of w3-use-menus is a list, it should be a list of symbols.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 The symbols and the order that they are listed determine what menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 will be in the menubar and how they are ordered. Valid symbol values
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 file -- A list of file related commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 edit -- Various standard editing commands (copy/paste)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 view -- Controlling various things about the document view
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 go -- Navigation control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 bookmark -- Bookmark / hotlist control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 options -- Various options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 buffers -- The standard buffers menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 emacs -- A toggle button to switch back to normal emacs menus
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
63 style -- Control fonts and who gets to set them
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
64 help -- The help
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 nil -- ** special **
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 If nil appears in the list, it should appear exactly once. All
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 menus after nil in the list will be displayed flushright in the
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
69 menubar.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (defun w3-menu-hotlist-constructor (menu-items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (or (cdr w3-html-bookmarks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (let ((hot-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (hot w3-hotlist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (while hot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (setq hot-menu (cons (vector
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (w3-truncate-menu-item (car (car hot)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (list 'w3-fetch (car (cdr (car hot))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 t) hot-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 hot (cdr hot)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
81 (or hot-menu '(["No Hotlist" undefined nil])))))
0
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 w3-menu-links-constructor (menu-items)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (or menu-items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (let ((widgets (w3-only-links))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 widget href menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (while widgets
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (setq widget (car widgets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 widgets (cdr widgets)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 href (widget-get widget 'href)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 menu (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (vector (w3-truncate-menu-item
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
93 (w3-fix-spaces
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
94 (buffer-substring
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
95 (widget-get widget :from)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
96 (widget-get widget :to))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (list 'url-maybe-relative href) t) menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (setq menu (w3-breakup-menu menu w3-max-menu-length))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
99 (or menu '(["No Links" undefined nil])))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defun w3-toggle-minibuffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (w3-running-xemacs
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
105 (set-frame-property (selected-frame) 'minibuffer
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
106 (not (frame-property (selected-frame) 'minibuffer))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (defun w3-toggle-location ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (let ((on (specifier-instance has-modeline-p (selected-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (set-specifier has-modeline-p (not on) (selected-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (defun w3-toggle-menubar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;; XEmacs style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (w3-running-xemacs
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
122 (set-specifier menubar-visible-p (cons (current-buffer)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
123 (not (specifier-instance
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
124 menubar-visible-p)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;; Emacs 19 style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (menu-bar-mode (if (w3-menubar-active) -1 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (defun w3-location-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (specifier-instance has-modeline-p (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (defun w3-menubar-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (if w3-running-xemacs
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
136 (and (featurep 'menubar) (specifier-instance menubar-visible-p))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (and (boundp 'menu-bar-mode) menu-bar-mode)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (defun w3-menu-global-menubar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (default-value 'default-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (lookup-key (current-global-map) [menu-bar])))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (defconst w3-menu-file-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 "File"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ["Open Location..." w3-fetch t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ["Open File..." w3-open-local t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ["Open in New Window..." w3-fetch-other-frame t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ["New Window" make-frame t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 "---"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ["Save" save-buffer t nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "Save As..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ["HTML" (w3-save-as "HTML Source") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ["Formatted Text" (w3-save-as "Formatted Text") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ["LaTeX" (w3-save-as "LaTeX Source") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ["PostScript" (w3-save-as "PostScript") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ["Binary" (w3-save-as "Binary") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "---"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 "Print As..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 ["PostScript" (w3-print-this-url nil "PostScript") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ["Formatted Text" (w3-print-this-url nil "Formatted Text") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 ["HTML Source" (w3-print-this-url nil "HTML Source") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ["LaTeX'd" (w3-print-this-url nil "LaTeX'd") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 "Mail Document..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ["HTML" (w3-mail-current-document nil "HTML Source") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ["Formatted Text" (w3-mail-current-document nil "Formatted Text") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ["PostScript" (w3-mail-current-document nil "PostScript") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ["LaTeX Source" (w3-mail-current-document nil "LaTeX Source") t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 )
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
176 ["Add Annotation" w3-annotation-add w3-personal-annotation-directory]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "---:shadowDoubleEtchedIn"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 "---")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ["Close" delete-frame (not (eq (next-frame) (selected-frame)))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ["Exit" save-buffers-kill-emacs t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 "W3 file menu list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (defconst w3-menu-edit-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 "Edit"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ["Undo" advertised-undo nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ["Cut" kill-region nil]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ["Copy" copy-region-as-kill t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ["Search..." w3-search-forward t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ["Search Again..." w3-search-again w3-last-search-item]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 "W3 edit menu list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defconst w3-menu-view-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 "View"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ["Document Information" w3-document-information t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ["Document Source" w3-source-document t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ["Load Images" w3-load-delayed-images w3-delayed-images]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ["Refresh" w3-refresh-buffer w3-current-parse]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ["Reload" w3-reload-document (and (url-view-url t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (not (equal (url-view-url t) "")))]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ["Show URL" url-view-url t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ["Show URL At Point" w3-view-this-url 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 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 "W3 menu view list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (defconst w3-menu-debug-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 "Debugging"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ["View Parse Tree" (w3-display-parse-tree w3-current-parse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 w3-current-parse]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ["View Stylesheet" w3-display-stylesheet w3-current-stylesheet]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 "W3 menu debug list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (defconst w3-menu-go-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 "Go"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
226 ["Forward" w3-forward-in-history t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
227 ["Backward" w3-backward-in-history t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ["Home" w3 w3-default-homepage]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 ["View History..." w3-show-history-list url-keep-history]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 '("Links" :filter w3-menu-links-constructor)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
233 ["Link..." w3-e19-show-links-menu t])
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 "W3 menu go list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (defconst w3-menu-bookmark-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 "Bookmark"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ["View Bookmarks..." w3-show-hotlist w3-hotlist]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ["Add Bookmark" w3-hotlist-add-document t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ["Delete Bookmark" w3-hotlist-delete t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ["Rename Bookmark" w3-hotlist-rename-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ["Append Bookmark List" w3-hotlist-append t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 '("Bookmarks" :filter w3-menu-hotlist-constructor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ["Bookmarks" w3-e19-show-hotlist-menu t])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 "W3 menu bookmark list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (defconst w3-menu-options-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (list "Options"
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
254 ["Edit Preferences" w3-preferences-edit t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
255 "---"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ["Show Menubar" w3-toggle-menubar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 :style toggle :selected (w3-menubar-active)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (if (and w3-running-xemacs (featurep 'toolbar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ["Show Toolbar" w3-toggle-toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 :style toggle :selected (w3-toolbar-active)]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
261 nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ["Show Location" w3-toggle-location
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 :style toggle :selected (w3-location-active)]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
265 nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 ["Show Status Bar" w3-toggle-minibuffer
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
268 :style toggle :selected nil]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
269 nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 ["Incremental Display"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (setq w3-do-incremental-display (not w3-do-incremental-display))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 :style toggle :selected w3-do-incremental-display]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ["Auto Load Images"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (setq w3-delay-image-loads (not w3-delay-image-loads))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 :style toggle :selected (not w3-delay-image-loads)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 ["Flush Image Cache" (setq w3-graphics-list nil) w3-graphics-list]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 ["Download to disk" (setq w3-dump-to-disk (not w3-dump-to-disk))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 :style toggle :selected w3-dump-to-disk]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 ["Caching" (setq url-automatic-caching (not url-automatic-caching))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 :style toggle :selected url-automatic-caching]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ["Use Cache Only"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (setq url-standalone-mode (not url-standalone-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 :style toggle :selected url-standalone-mode]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 "----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 ["Save Options" w3-menu-save-options t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 "W3 menu options list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (defconst w3-menu-style-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 "Style"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ["Allow Document Stylesheets" (setq w3-honor-stylesheets
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (not w3-honor-stylesheets))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 :style toggle :selected w3-honor-stylesheets]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
297 ["IE 3.0 Compatible Parsing" (setq w3-style-ie-compatibility
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
298 (not w3-style-ie-compatibility))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
299 :style toggle :selected (and w3-honor-stylesheets
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
300 w3-style-ie-compatibility)]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ["Honor Color Requests" (setq w3-user-colors-take-precedence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (not w3-user-colors-take-precedence))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 :style toggle :selected (not w3-user-colors-take-precedence)]
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
304 "---"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
305 ["Reload Stylesheets" w3-refresh-stylesheets t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 "W3 menu style list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (defconst w3-menu-buffer-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (if w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 '("Buffers"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 :filter buffers-menu-filter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 ["List All Buffers" list-buffers t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 "--!here")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 "W3 menu buffer list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (defconst w3-menu-emacs-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (vector
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (if w3-running-xemacs "XEmacs" "Emacs") 'w3-menu-toggle-menubar t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (defconst w3-menu-help-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 "Help"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 ["About Emacs-w3" (w3-fetch "about:") t]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
326 ["Manual" (w3-fetch (concat w3-documentation-root "w3_toc.html")) t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 "---"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 ["Version Information..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (w3-fetch
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
330 (concat w3-documentation-root "help_on_" w3-version-number ".html"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 t]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
332 ["On Window" (w3-fetch (concat w3-documentation-root "help/window.html")) t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
333 ["On FAQ" (w3-fetch (concat w3-documentation-root"help/FAQ.html")) t]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 "---"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 ["Mail Developer(s)" w3-submit-bug t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 "W3 menu help list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (defvar w3-mode-menu-map nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (defun w3-menu-initialize-w3-mode-menu-map ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (if (null w3-mode-menu-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (let ((map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (dummy (make-sparse-keymap)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (require 'easymenu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 ;; initialize all the w3-menu-fsfemacs-*-menu variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 ;; with the menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (easy-menu-define w3-menu-fsfemacs-bookmark-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 w3-menu-bookmark-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (easy-menu-define w3-menu-fsfemacs-debug-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 w3-menu-debug-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (easy-menu-define w3-menu-fsfemacs-edit-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 w3-menu-edit-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (easy-menu-define w3-menu-fsfemacs-file-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 w3-menu-file-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (easy-menu-define w3-menu-fsfemacs-go-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 w3-menu-go-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (easy-menu-define w3-menu-fsfemacs-help-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 w3-menu-help-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (easy-menu-define w3-menu-fsfemacs-view-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 w3-menu-view-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (easy-menu-define w3-menu-fsfemacs-options-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 w3-menu-options-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (easy-menu-define w3-menu-fsfemacs-style-menu (list dummy) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 w3-menu-style-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 ;; block the global menubar entries in the map so that W3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 ;; can take over the menubar if necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (define-key map [rootmenu] (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (define-key map [rootmenu w3] (cons "W3" (make-sparse-keymap "W3")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (define-key map [rootmenu w3 file] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (define-key map [rootmenu w3 files] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (define-key map [rootmenu w3 search] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (define-key map [rootmenu w3 edit] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (define-key map [rootmenu w3 options] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (define-key map [rootmenu w3 buffer] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (define-key map [rootmenu w3 tools] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (define-key map [rootmenu w3 help] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (define-key map [rootmenu w3 help-menu] 'undefined)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 ;; now build W3's menu tree.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (let ((menu-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (bookmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (cons "Bookmark" w3-menu-fsfemacs-bookmark-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (debug
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (cons "Debug" w3-menu-fsfemacs-debug-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (cons "Edit" w3-menu-fsfemacs-edit-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (cons "File" w3-menu-fsfemacs-file-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (go
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (cons "Go" w3-menu-fsfemacs-go-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (cons "Help" w3-menu-fsfemacs-help-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (cons "Options" w3-menu-fsfemacs-options-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (view
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (cons "View" w3-menu-fsfemacs-view-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (cons "Style" w3-menu-fsfemacs-style-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (emacs
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
402 (cons "[Emacs]" 'w3-menu-toggle-menubar))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (vec (vector 'rootmenu 'w3 nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 ;; menus appear in the opposite order that we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 ;; define-key them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (menu-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (if (consp w3-use-menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (reverse w3-use-menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (list 'help nil 'emacs 'buffers 'options 'bookmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 'go 'view 'edit 'file))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (while menu-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (if (null (car menu-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 nil;; no flushright support in FSF Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (aset vec 2 (intern (concat "w3-menu-fsfemacs-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (symbol-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (car menu-list)) "-menu")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (setq cons (assq (car menu-list) menu-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (if cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (define-key map vec (eval (car (cdr cons))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (setq menu-list (cdr menu-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (setq w3-mode-menu-map map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (run-hooks 'w3-menu-setup-hook))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (defun w3-menu-make-xemacs-menubar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (let ((menu-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 '((bookmark . w3-menu-bookmark-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (style . w3-menu-style-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (buffer . w3-menu-buffer-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (debug . w3-menu-debug-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (edit . w3-menu-edit-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (emacs . w3-menu-emacs-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (file . w3-menu-file-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (go . w3-menu-go-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (help . w3-menu-help-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (options . w3-menu-options-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (view . w3-menu-view-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (menubar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (menu-list w3-use-menus))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (while menu-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (if (null (car menu-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (setq menubar (cons nil menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (setq cons (assq (car menu-list) menu-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (if cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (setq menubar (cons (symbol-value (cdr cons)) menubar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (setq menu-list (cdr menu-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (nreverse menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (defun w3-menu-install-menubar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (if (not (featurep 'menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 nil ; No menus available
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (setq w3-menu-w3-menubar (w3-menu-make-xemacs-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (set-buffer-menubar w3-menu-w3-menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 ((not (fboundp 'vm-menu-undo-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (w3-menu-initialize-w3-mode-menu-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (define-key w3-mode-map [menu-bar]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (lookup-key w3-mode-menu-map [rootmenu w3])))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (defun w3-menu-install-menubar-item ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (if (not (featurep 'menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 nil ; No menus available
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (set-buffer-menubar (copy-sequence (w3-menu-global-menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (add-menu nil "W3" (cdr w3-menu-w3-menubar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ((not (fboundp 'w3-menu-fsfemacs-edit-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (w3-menu-initialize-w3-mode-menu-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (define-key w3-mode-map [menu-bar]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (lookup-key w3-mode-menu-map [rootmenu])))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (defun w3-menu-install-menus ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
477 (cond ((= emacs-minor-version 28) ; Hey, get with the times people!!
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
478 nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
479 ((consp w3-use-menus)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (w3-menu-install-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 ((eq w3-use-menus 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (w3-menu-install-menubar-item))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (defun w3-menu-set-menubar-dirty-flag ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (cond (w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (set-menubar-dirty-flag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (force-mode-line-update))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (defun w3-menu-toggle-menubar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 ;;((eq w3-use-menus 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 ;;nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (w3-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (if (null (car (find-menu-item current-menubar '("XEmacs"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (set-buffer-menubar w3-menu-w3-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (set-buffer-menubar (copy-sequence (w3-menu-global-menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (add-menu-button nil ["W3" w3-menu-toggle-menubar t] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (void-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (add-menu-item nil "W3" 'w3-menu-toggle-menubar t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (w3-menu-set-menubar-dirty-flag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (if (not (eq (lookup-key w3-mode-map [menu-bar])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (lookup-key w3-mode-menu-map [rootmenu w3])))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (define-key w3-mode-map [menu-bar]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (lookup-key w3-mode-menu-map [rootmenu w3]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (define-key w3-mode-map [menu-bar]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (define-key w3-mode-map [menu-bar w3]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (cons "[W3]" 'w3-menu-toggle-menubar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (w3-menu-set-menubar-dirty-flag))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (defun w3-menu-save-options ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (let ((output-buffer (find-file-noselect w3-default-configuration-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 output-marker)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (set-buffer output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 ;; Find and delete the previously saved data, and position to write.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (if (re-search-forward "^;; W3 Options Settings *\n" nil 'move)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (let ((p (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (goto-char p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (or (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 "^;; End of W3 Options Settings *\\(\n\\|\\'\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (error "can't find END of saved state in .emacs"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (delete-region p (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (setq output-marker (point-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (let ((print-readably t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (print-escape-newlines t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (standard-output output-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (princ ";; W3 Options Settings\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (princ ";; ===================\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (lambda (var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (princ " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (if (and (symbolp var) (boundp var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (prin1 (list 'setq-default var
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (let ((val (symbol-value var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (if (or (memq val '(t nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (and (not (symbolp val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (not (listp val))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 val
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (list 'quote val))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (if var (princ "\n"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 ps-print-color-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 url-automatic-caching
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
557 url-be-asynchronous
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
558 url-honor-refresh-requests
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
559 url-privacy-level
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 url-proxy-services
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
561 url-standalone-mode
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
562 url-use-hypertext-dired
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
563 url-use-hypertext-gopher
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
564 w3-color-filter
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
565 w3-color-use-reducing
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 w3-default-homepage
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
567 w3-default-stylesheet
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
568 w3-delay-image-loads
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
569 w3-do-incremental-display
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
570 w3-dump-to-disk
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
571 w3-file-done-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
572 w3-file-prepare-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
573 w3-honor-stylesheets
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
574 w3-image-mappings
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
575 w3-load-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
576 w3-mode-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
577 w3-netscape-compatible-comments
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
578 w3-preferences-cancel-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
579 w3-preferences-default-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
580 w3-preferences-ok-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
581 w3-preferences-setup-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
582 w3-source-file-hook
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
583 w3-style-ie-compatibility
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 w3-toolbar-orientation
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
585 w3-toolbar-type
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
586 w3-use-menus
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
587 w3-user-colors-take-precedence
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (princ ";; ==========================\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (princ ";; End of W3 Options Settings\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (set-marker output-marker nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (set-buffer output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 (save-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 ;;; Context-sensitive popup menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (if (not (fboundp 'event-glyph))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (fset 'event-glyph 'ignore))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (defun w3-popup-menu (e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 "Pop up a menu of common w3 commands"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (interactive "e")
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
607 (mouse-set-point e)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
608 (let* ((glyph (event-glyph e))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
609 (widget (or (and glyph (glyph-property glyph 'widget))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
610 (widget-at (point))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
611 (href (and widget (widget-get widget 'href)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
612 (imag (and widget (widget-get widget 'src)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
613 (menu (copy-tree w3-popup-menu))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
614 url val trunc-url)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
615 (if href
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
616 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
617 (setq url href)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
618 (if url (setq trunc-url (url-truncate-url-for-viewing
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
619 url
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
620 w3-max-menu-width)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (setcdr menu (append (cdr menu)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
622 '("---")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
623 (mapcar
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
624 (function
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
625 (lambda (x)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
626 (vector (format (car x) trunc-url)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
627 (list (cdr x) url) t)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
628 w3-hyperlink-menu)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
629 (if imag
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
630 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
631 (setq url imag
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
632 trunc-url (url-truncate-url-for-viewing url
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
633 w3-max-menu-width))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
634 (setcdr menu (append (cdr menu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
635 '("---")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
636 (mapcar
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
637 (function
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
638 (lambda (x)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
639 (vector (format (car x) trunc-url)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
640 (list (cdr x) url) t)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
641 w3-graphlink-menu)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
642 (if (not (w3-menubar-active))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
643 (setcdr menu (append (cdr menu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
644 '("---" ["Show Menubar" w3-toggle-menubar t]))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 44
diff changeset
645 (popup-menu menu)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (provide 'w3-menu)