comparison lisp/w3/w3-menu.el @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents 0293115a14e9
children 8fc7fe29b841
comparison
equal deleted inserted replaced
19:ac1f612d5250 20:859a2309aef8
1 ;;; w3-menu.el --- Menu functions for emacs-w3 1 ;;; w3-menu.el --- Menu functions for emacs-w3
2 ;; Author: wmperry 2 ;; Author: wmperry
3 ;; Created: 1997/01/21 20:54:49 3 ;; Created: 1997/02/08 05:30:56
4 ;; Version: 1.25 4 ;; Version: 1.27
5 ;; Keywords: menu, hypermedia 5 ;; Keywords: menu, hypermedia
6 6
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu) 8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. 9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
42 (defvar w3-menu-fsfemacs-search-menu nil) 42 (defvar w3-menu-fsfemacs-search-menu nil)
43 (defvar w3-menu-w3-menubar nil) 43 (defvar w3-menu-w3-menubar nil)
44 (defvar w3-links-menu nil "Menu for w3-mode in XEmacs.") 44 (defvar w3-links-menu nil "Menu for w3-mode in XEmacs.")
45 (make-variable-buffer-local 'w3-links-menu) 45 (make-variable-buffer-local 'w3-links-menu)
46 46
47 (defvar w3-use-menus '(file edit view go bookmark options 47 (defvar w3-use-menus '(file edit view go bookmark options buffers style
48 buffers style emacs nil help) 48 emacs nil help)
49 "*Non-nil value causes W3 to provide a menu interface. 49 "*Non-nil value causes W3 to provide a menu interface.
50 A value that is a list causes W3 to install its own menubar. 50 A value that is a list causes W3 to install its own menubar.
51 A value of 1 causes W3 to install a \"W3\" item in the Emacs menubar. 51 A value of 1 causes W3 to install a \"W3\" item in the Emacs menubar.
52 52
53 If the value of w3-use-menus is a list, it should be a list of symbols. 53 If the value of w3-use-menus is a list, it should be a list of symbols.
68 help -- The help menu 68 help -- The help menu
69 nil -- ** special ** 69 nil -- ** special **
70 70
71 If nil appears in the list, it should appear exactly once. All 71 If nil appears in the list, it should appear exactly once. All
72 menus after nil in the list will be displayed flushright in the 72 menus after nil in the list will be displayed flushright in the
73 menubar.") 73 menubar.
74
75 NOTE! The current port of Emacs to Windows NT/95 does not support
76 buttons in the menubar, so the 'emacs' keyword is currently ignored
77 on that platform.")
74 78
75 (defun w3-menu-hotlist-constructor (menu-items) 79 (defun w3-menu-hotlist-constructor (menu-items)
76 (or (cdr w3-html-bookmarks) 80 (or (cdr w3-html-bookmarks)
77 (let ((hot-menu nil) 81 (let ((hot-menu nil)
78 (hot w3-hotlist)) 82 (hot w3-hotlist))
224 ["HTML" (w3-mail-current-document nil "HTML Source") t] 228 ["HTML" (w3-mail-current-document nil "HTML Source") t]
225 ["Formatted Text" (w3-mail-current-document nil "Formatted Text") t] 229 ["Formatted Text" (w3-mail-current-document nil "Formatted Text") t]
226 ["PostScript" (w3-mail-current-document nil "PostScript") t] 230 ["PostScript" (w3-mail-current-document nil "PostScript") t]
227 ["LaTeX Source" (w3-mail-current-document nil "LaTeX Source") t] 231 ["LaTeX Source" (w3-mail-current-document nil "LaTeX Source") t]
228 ) 232 )
229 ["Add Annotation" w3-annotation-add w3-personal-annotation-directory]
230 (if w3-running-xemacs 233 (if w3-running-xemacs
231 "---:shadowDoubleEtchedIn" 234 "---:shadowDoubleEtchedIn"
232 "---") 235 "---")
233 ["Close" delete-frame (not (eq (next-frame) (selected-frame)))] 236 ["Close" delete-frame (not (eq (next-frame) (selected-frame)))]
234 ["Exit" save-buffers-kill-emacs t] 237 ["Exit" save-buffers-kill-emacs t]
275 "W3 menu debug list.") 278 "W3 menu debug list.")
276 279
277 (defconst w3-menu-go-menu 280 (defconst w3-menu-go-menu
278 (list 281 (list
279 "Go" 282 "Go"
280 ["Forward" w3-forward-in-history t] 283 ["Forward" w3-history-forward (cdr (w3-history-find-url-internal (url-view-url t)))]
281 ["Backward" w3-backward-in-history t] 284 ["Back" w3-history-backward (car (w3-history-find-url-internal (url-view-url t)))]
282 ["Home" w3 w3-default-homepage] 285 ["Home" w3 w3-default-homepage]
283 ["View History..." w3-show-history-list url-keep-history] 286 ["View History..." w3-show-history-list url-keep-history]
284 "----" 287 "----"
285 (if w3-running-xemacs 288 (if w3-running-xemacs
286 '("Links" :filter w3-menu-links-constructor) 289 '("Links" :filter w3-menu-links-constructor)
464 (style 467 (style
465 (cons "Style" w3-menu-fsfemacs-style-menu)) 468 (cons "Style" w3-menu-fsfemacs-style-menu))
466 (search 469 (search
467 (cons "Search" w3-menu-fsfemacs-search-menu)) 470 (cons "Search" w3-menu-fsfemacs-search-menu))
468 (emacs 471 (emacs
469 (cons "[Emacs]" 'w3-menu-toggle-menubar)))) 472 ;; FIXME!!! Currently, win32 doesn't support buttons
473 ;; in menubars, so we hack around it and ignore the
474 ;; 'emacs keyword on that platform. REMOVE THIS CODE
475 ;; as soon as that is fixed. 19.35 timeframe?
476 (if (eq (device-type) 'win32)
477 nil
478 (cons "[Emacs]" 'w3-menu-toggle-menubar)))))
470 cons 479 cons
471 (vec (vector 'rootmenu 'w3 nil)) 480 (vec (vector 'rootmenu 'w3 nil))
472 ;; menus appear in the opposite order that we 481 ;; menus appear in the opposite order that we
473 ;; define-key them. 482 ;; define-key them.
474 (menu-list 483 (menu-list