]> git.eshelyaron.com Git - emacs.git/commitdiff
(speedbar-handle-delete-frame): Don't try to delete the speedbar frame if nil;
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 28 Jun 2007 09:00:51 +0000 (09:00 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 28 Jun 2007 09:00:51 +0000 (09:00 +0000)
that deletes the current frame or causes an error if it is the only frame.

lisp/ChangeLog
lisp/speedbar.el

index a8d83c208b998977548390184b686b8640ee4249..9b2fece8b161e674bc82a534d69964fac5936a1a 100644 (file)
@@ -1,3 +1,10 @@
+2007-06-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * speedbar.el (speedbar-handle-delete-frame): Don't try to delete
+       the speedbar frame if nil; that deletes the current frame or
+       causes an error if it is the only frame.
+       Reported by Angelo Graziosi <Angelo.Graziosi@roma1.infn.it>.
+
 2007-06-28  Kevin Ryde  <user42@zip.com.au>
 
        * textmodes/nroff-mode.el: Groff \# comments.
 
 2007-06-24  Jay Belanger  <jay.p.belanger@gmail.com>
 
-       * calc/calc-comb.el (math-init-random-base,math-prime-test):
+       * calc/calc-comb.el (math-init-random-base, math-prime-test):
        Use math-read-number-simple to insert constants.
        (math-prime-test): Redo calculation of sum.
 
        (math-normalize, math-bignum-big, math-make-float)
        (math-div10-bignum, math-scale-left, math-scale-left-bignum)
        (math-scale-right, math-scale-right-bignum, math-scale-rounding)
-       (math-add, math-add-bignum, math-sub-bignum, math-sub,math-mul)
+       (math-add, math-add-bignum, math-sub-bignum, math-sub, math-mul)
        (math-mul-bignum, math-mul-bignum-digit, math-idivmod)
        (math-quotient, math-div-bignum, math-div-bignum-digit)
        (math-div-bignum-part, math-format-bignum-decimal)
index 87176d0c1c89bc2d86edde3f9c8bea2ea2d2db2b..4ecb0ec7dd376fdc474a5a2c11a32a29ecf980bd 100644 (file)
@@ -10,7 +10,7 @@
   "The current version of speedbar.")
 (defvar speedbar-incompatible-version "0.14beta4"
   "This version of speedbar is incompatible with this version.
-Due to massive API changes (removing the use of the word PATH) 
+Due to massive API changes (removing the use of the word PATH)
 this version is not backward compatible to 0.14 or earlier.")
 
 ;; This file is part of GNU Emacs.
@@ -915,7 +915,7 @@ This basically creates a sparse keymap, and makes its parent be
                     (looking-at "[0-9]+: *\\[[+-]\\] [^ \n]+ \\*?[!#]$"))]
     )
   "Additional menu items while in file-mode.")
+
 (defvar speedbar-easymenu-definition-trailer
   (append
    (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
@@ -958,13 +958,13 @@ directories.")
 (defalias 'speedbar-make-overlay
   (if (featurep 'xemacs) 'make-extent 'make-overlay))
 
-(defalias 'speedbar-overlay-put 
+(defalias 'speedbar-overlay-put
   (if (featurep 'xemacs) 'set-extent-property 'overlay-put))
 
-(defalias 'speedbar-delete-overlay 
+(defalias 'speedbar-delete-overlay
   (if (featurep 'xemacs) 'delete-extent 'delete-overlay))
 
-(defalias 'speedbar-mode-line-update 
+(defalias 'speedbar-mode-line-update
   (if (featurep 'xemacs) 'redraw-modeline 'force-mode-line-update))
 \f
 ;;; Mode definitions/ user commands
@@ -1053,10 +1053,10 @@ supported at a time.
   "Handle a delete frame event E.
 If the deleted frame is the frame SPEEDBAR is attached to,
 we need to delete speedbar also."
-  (let ((frame-to-be-deleted (car (car (cdr e)))))
-    (if (eq frame-to-be-deleted dframe-attached-frame)
-       (delete-frame speedbar-frame)))
-  )
+  (when (and speedbar-frame
+            (eq (car (car (cdr e))) ;; frame to be deleted
+                dframe-attached-frame))
+    (delete-frame speedbar-frame)))
 
 ;;;###autoload
 (defun speedbar-get-focus ()
@@ -1158,7 +1158,7 @@ return true without a query."
 ;; Backwards compatibility
 (defalias 'speedbar-with-attached-buffer 'dframe-with-attached-buffer)
 (defalias 'speedbar-maybee-jump-to-attached-frame 'dframe-maybee-jump-to-attached-frame)
+
 (defun speedbar-set-mode-line-format ()
   "Set the format of the mode line based on the current speedbar environment.
 This gives visual indications of what is up.  It EXPECTS the speedbar
@@ -2055,7 +2055,7 @@ position to insert a new item, and that the new item will end with a CR."
                            (if tag-button-function 'speedbar-highlight-face nil)
                            tag-button-function tag-button-data))
     ))
-  
+
 (defun speedbar-change-expand-button-char (char)
   "Change the expansion button character to CHAR for the current line."
   (save-excursion
@@ -2100,7 +2100,7 @@ cell of the form ( 'DIRLIST .  'FILELIST )."
 
 (defun speedbar-default-directory-list (directory index)
   "Insert files for DIRECTORY with level INDEX at point."
-  (speedbar-insert-files-at-point 
+  (speedbar-insert-files-at-point
    (speedbar-file-lists directory) index)
   (speedbar-reset-scanners)
   (if (= index 0)
@@ -2454,7 +2454,7 @@ name will have the function FIND-FUN and not token."
   (speedbar-insert-generic-list indent lst
                                'speedbar-tag-expand
                                'speedbar-tag-find))
-                               
+
 (defun speedbar-insert-etags-list (indent lst)
   "At level INDENT, insert the etags generated LST."
   (speedbar-insert-generic-list indent lst
@@ -2729,7 +2729,7 @@ If new functions are added, their state needs to be updated here."
   "Go to the line where FILE is."
 
   (set-buffer speedbar-buffer)
-  
+
   (goto-char (point-min))
   (let ((m nil))
     (while (and (setq m (re-search-forward
@@ -3220,7 +3220,7 @@ directory with these items.  This function is replaceable in
     (widen)
     (let ((rf (speedbar-fetch-replacement-function 'speedbar-line-directory)))
       (if rf (funcall rf depth) default-directory))))
-      
+
 (defun speedbar-files-line-directory (&optional depth)
   "Retrieve the directoryname associated with the current line.
 This may require traversing backwards from DEPTH and combining the default
@@ -3305,12 +3305,12 @@ With universal argument ARG, flush cached data."
          (forward-char -2)
          (speedbar-do-function-pointer))
       (error (speedbar-position-cursor-on-line)))))
-  
+
 (defun speedbar-flush-expand-line ()
   "Expand the line under the cursor and flush any cached information."
   (interactive)
   (speedbar-expand-line 1))
-  
+
 (defun speedbar-contract-line ()
   "Contract the line under the cursor."
   (interactive)
@@ -3559,11 +3559,11 @@ This assumes that the cursor is on a file, or tag of a file which the user is
 interested in."
 
   (save-selected-window
-  
+
     (select-window (get-buffer-window speedbar-buffer t))
-    
+
     (set-buffer speedbar-buffer)
-    
+
     (if (<= (count-lines (point-min) (point-max))
            (1- (window-height (selected-window))))
        ;; whole buffer fits