]> code.delx.au - gnu-emacs/blobdiff - lisp/dframe.el
Merge from mainline.
[gnu-emacs] / lisp / dframe.el
index 2086347dc90740659624ac3a93d166fc07183514..312f49f60536e3bdfc4b330ec1ce3b7b27d6ae81 100644 (file)
@@ -1,7 +1,6 @@
 ;;; dframe --- dedicate frame support modes
 
-;;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;    2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2011  Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: file, tags, tools
@@ -173,7 +172,7 @@ Valid clicks are mouse 2, our double mouse 1.")
 (make-variable-buffer-local 'dframe-mouse-click-function)
 
 (defvar dframe-mouse-position-function nil
-  "*A function to called to position the cursor for a mouse click.")
+  "*A function to call to position the cursor for a mouse click.")
 (make-variable-buffer-local 'dframe-mouse-position-function)
 
 (defvar dframe-power-click nil
@@ -424,13 +423,14 @@ LOCATION can be one of 'random, 'left, 'right, 'left-right, or 'top-bottom."
 (defun dframe-reposition-frame-emacs (new-frame parent-frame location)
   "Move NEW-FRAME to be relative to PARENT-FRAME.
 LOCATION can be one of 'random, 'left-right, 'top-bottom, or
-a cons cell indicationg a position of the form (LEFT . TOP)."
+a cons cell indicating a position of the form (LEFT . TOP)."
   ;; Position dframe.
   ;; Do no positioning if not on a windowing system,
   (unless (or (not window-system) (eq window-system 'pc))
     (let* ((pfx (dframe-frame-parameter parent-frame 'left))
           (pfy (dframe-frame-parameter parent-frame 'top))
-          (pfw (frame-pixel-width parent-frame))
+          (pfw (+ (tool-bar-pixel-width parent-frame)
+                  (frame-pixel-width parent-frame)))
           (pfh (frame-pixel-height parent-frame))
           (nfw (frame-pixel-width new-frame))
           (nfh (frame-pixel-height new-frame))
@@ -459,7 +459,7 @@ a cons cell indicationg a position of the form (LEFT . TOP)."
                      (- (x-display-pixel-height) (car (cdr pfy)) pfh)
                    (car (cdr pfy)))))
       (cond ((eq location 'right)
-            (setq newleft (+ pfx pfw 5)
+            (setq newleft (+ pfx pfw 10)
                   newtop pfy))
            ((eq location 'left)
             (setq newleft (- pfx 10 nfw)
@@ -471,7 +471,7 @@ a cons cell indicationg a position of the form (LEFT . TOP)."
                   ;; extra 10 is just dressings for window
                   ;; decorations.
                   (let* ((left-guess (- pfx 10 nfw))
-                         (right-guess (+ pfx pfw 5))
+                         (right-guess (+ pfx pfw 10))
                          (left-margin left-guess)
                          (right-margin (- (x-display-pixel-width)
                                           right-guess 5 nfw)))
@@ -766,7 +766,7 @@ Evaluates all cached timer functions in sequence."
          (fboundp 'function-max-args)
          (setq max-args (function-max-args 'popup-mode-menu))
          (not (zerop max-args))))
-  "The EVENT arg to 'popup-mode-menu' was introduced in XEmacs 21.4.0.")
+  "The EVENT arg to `popup-mode-menu' was introduced in XEmacs 21.4.0.")
 
 ;; In XEmacs, we make popup menus work on the item over mouse (as
 ;; opposed to where the point happens to be.)  We attain this by
@@ -783,8 +783,8 @@ Must be bound to EVENT."
               (popup-mode-menu event)
             (goto-char (event-closest-point event))
             (beginning-of-line)
-            (forward-char (min 5 (- (save-excursion (end-of-line) (point))
-                                    (save-excursion (beginning-of-line) (point)))))
+            (forward-char (min 5 (- (line-end-position)
+                                    (line-beginning-position))))
             (popup-mode-menu))
           ;; Wait for menu to bail out.  `popup-mode-menu' (and other popup
           ;; menu functions) return immediately.
@@ -852,7 +852,7 @@ BUFFER and POSITION are optional because XEmacs doesn't use them."
          (funcall dframe-help-echo-function))))))
 
 (defun dframe-mouse-set-point (e)
-  "Set POINT based on event E.
+  "Set point based on event E.
 Handles clicking on images in XEmacs."
   (if (and (featurep 'xemacs)
            (save-excursion
@@ -990,5 +990,4 @@ mode-line.  This is only useful for non-XEmacs."
 
 (provide 'dframe)
 
-;; arch-tag: df9b91b6-e85e-4a76-a02e-b3cb5b686bd4
 ;;; dframe.el ends here