diff lisp/w3/w3-menu.el @ 36:c53a95d3c46d r19-15b101

Import from CVS: tag r19-15b101
author cvs
date Mon, 13 Aug 2007 08:53:38 +0200
parents e04119814345
children 8d2a9b52c682
line wrap: on
line diff
--- a/lisp/w3/w3-menu.el	Mon Aug 13 08:53:21 2007 +0200
+++ b/lisp/w3/w3-menu.el	Mon Aug 13 08:53:38 2007 +0200
@@ -1,7 +1,7 @@
 ;;; w3-menu.el --- Menu functions for emacs-w3
 ;; Author: wmperry
-;; Created: 1997/03/13 19:25:10
-;; Version: 1.32
+;; Created: 1997/03/18 00:45:01
+;; Version: 1.34
 ;; Keywords: menu, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -27,6 +27,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (require 'w3-vars)
+(require 'w3-mouse)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Spiffy new menus (for both Emacs and XEmacs)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -676,47 +677,49 @@
 (defun w3-popup-menu (e)
   "Pop up a menu of common w3 commands"
   (interactive "e")
-  (mouse-set-point e)
-  (let* ((glyph (event-glyph e))
-	 (widget (or (and glyph (glyph-property glyph 'widget))
-		     (widget-at (point))))
-	 (parent (and widget (widget-get widget :parent)))
-	 (href (or (and widget (widget-get widget 'href))
-		   (and parent (widget-get parent 'href))))
-	 (imag (or (and widget (widget-get widget 'src))
-		   (and parent (widget-get parent 'src))))
-	 (menu (copy-tree w3-popup-menu))
-	 url val trunc-url)
-    (if href
-	(progn
-	  (setq url href)
-	  (if url (setq trunc-url (url-truncate-url-for-viewing
-				   url
-				   w3-max-menu-width)))
+  (if (not w3-popup-menu-on-mouse-3)
+      (call-interactively (lookup-key global-map (vector w3-mouse-button3)))
+    (mouse-set-point e)
+    (let* ((glyph (event-glyph e))
+	   (widget (or (and glyph (glyph-property glyph 'widget))
+		       (widget-at (point))))
+	   (parent (and widget (widget-get widget :parent)))
+	   (href (or (and widget (widget-get widget 'href))
+		     (and parent (widget-get parent 'href))))
+	   (imag (or (and widget (widget-get widget 'src))
+		     (and parent (widget-get parent 'src))))
+	   (menu (copy-tree w3-popup-menu))
+	   url val trunc-url)
+      (if href
+	  (progn
+	    (setq url href)
+	    (if url (setq trunc-url (url-truncate-url-for-viewing
+				     url
+				     w3-max-menu-width)))
+	    (setcdr menu (append (cdr menu)
+				 '("---")
+				 (mapcar
+				  (function
+				   (lambda (x)
+				     (vector (format (car x) trunc-url)
+					     (list (cdr x) url) t)))
+				  w3-hyperlink-menu)))))
+      (if imag
+	  (progn
+	    (setq url imag
+		  trunc-url (url-truncate-url-for-viewing url
+							  w3-max-menu-width))
+	    (setcdr menu (append (cdr menu)
+				 '("---")
+				 (mapcar
+				  (function
+				   (lambda (x)
+				     (vector (format (car x) trunc-url)
+					     (list (cdr x) url) t)))
+				  w3-graphlink-menu)))))
+      (if (not (w3-menubar-active))
 	  (setcdr menu (append (cdr menu)
-			       '("---")
-			       (mapcar
-				(function
-				 (lambda (x)
-				   (vector (format (car x) trunc-url)
-					   (list (cdr x) url) t)))
-				w3-hyperlink-menu)))))
-     (if imag
-	 (progn
-	   (setq url imag
-		 trunc-url (url-truncate-url-for-viewing url
-							 w3-max-menu-width))
-	   (setcdr menu (append (cdr menu)
-				'("---")
-				(mapcar
-				 (function
-				  (lambda (x)
-				    (vector (format (car x) trunc-url)
-					    (list (cdr x) url) t)))
-				 w3-graphlink-menu)))))
-     (if (not (w3-menubar-active))
-	 (setcdr menu (append (cdr menu)
-			      '("---" ["Show Menubar" w3-toggle-menubar t]))))
-     (popup-menu menu)))
+			       '("---" ["Show Menubar" w3-toggle-menubar t]))))
+      (popup-menu menu))))
 
 (provide 'w3-menu)