unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Minor problem with calc-quit
@ 2006-05-30 11:32 Slawomir Nowaczyk
  2006-05-30 12:55 ` Robert J. Chassell
  0 siblings, 1 reply; 4+ messages in thread
From: Slawomir Nowaczyk @ 2006-05-30 11:32 UTC (permalink / raw)


Hello,

When quitting calc (using calc-quit, i.e. "q") I get an error:

setq: Wrong type argument: stringp, nil

The following patch makes the error go away, but I have no idea if
this is the right fix:

diff -c "c:/Emacs/lisp/calc/calc.el" "c:/temp/buffer-content-4808WrC"
*** c:/Emacs/lisp/calc/calc.el	Sun May 21 11:35:21 2006
--- c:/temp/buffer-content-4808WrC	Tue May 30 13:21:58 2006
***************
*** 1377,1383 ****
              (setq calc-window-height (- (window-height win) 2)))
          (progn
            (delete-windows-on buf)
!           (delete-windows-on kbuf))
          (bury-buffer buf)
          (bury-buffer calc-trail-buffer)
          (and kbuf (bury-buffer kbuf))))))
--- 1377,1383 ----
              (setq calc-window-height (- (window-height win) 2)))
          (progn
            (delete-windows-on buf)
!           (if kbuf (delete-windows-on kbuf)))
          (bury-buffer buf)
          (bury-buffer calc-trail-buffer)
          (and kbuf (bury-buffer kbuf))))))

Diff finished.  Tue May 30 13:21:59 2006

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( slawomir.nowaczyk.847@student.lu.se )

If at first you don't succeed, skydiving is not for you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Minor problem with calc-quit
  2006-05-30 11:32 Minor problem with calc-quit Slawomir Nowaczyk
@ 2006-05-30 12:55 ` Robert J. Chassell
  2006-05-30 22:51   ` Slawomir Nowaczyk
  0 siblings, 1 reply; 4+ messages in thread
From: Robert J. Chassell @ 2006-05-30 12:55 UTC (permalink / raw)
  Cc: emacs-devel

    When quitting calc (using calc-quit, i.e. "q") I get an error:

I can run and quit calc with no trouble using
this morning's GNU Emacs CVS snapshot, Tue, 2006 May 30 09:50 UTC
GNU Emacs 22.0.50.84 (i686-pc-linux-gnu, GTK+ Version 2.8.16)
started with

    emacs/src/emacs -Q -D

both with and without *Calc Keypad*.

The function `delete-windows-on' returns nil when there is no *Calc
Keypad* (i.e., the argument for `delete-windows-on' is nil; I tested
that) and (presumably) deletes the buffer containing the key pad when
it exists.

--
    Robert J. Chassell
    bob@rattlesnake.com                         GnuPG Key ID: 004B4AC8
    http://www.rattlesnake.com                  http://www.teak.cc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Minor problem with calc-quit
  2006-05-30 12:55 ` Robert J. Chassell
@ 2006-05-30 22:51   ` Slawomir Nowaczyk
  2006-05-30 23:19     ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Slawomir Nowaczyk @ 2006-05-30 22:51 UTC (permalink / raw)
  Cc: drew.adams

On Tue, 30 May 2006 08:55:36 -0400 (EDT)
"Robert J. Chassell" <bob@rattlesnake.com> wrote:

#>     When quitting calc (using calc-quit, i.e. "q") I get an error:
#> 
#> I can run and quit calc with no trouble using
#> this morning's GNU Emacs CVS snapshot, Tue, 2006 May 30 09:50 UTC
#> GNU Emacs 22.0.50.84 (i686-pc-linux-gnu, GTK+ Version 2.8.16)
#> started with
#> 
#>     emacs/src/emacs -Q -D
#> 
#> both with and without *Calc Keypad*.

Thanks for investigating this and sorry for the false alarm.

Turns out I had Drew Adams' "frame-cmds.el" in my load path, which
contains its own version of delete-windows-on and which somehow was
being loaded even for "emacs -Q".

#> The function `delete-windows-on' returns nil when there is no *Calc
#> Keypad* (i.e., the argument for `delete-windows-on' is nil; I tested
#> that) and (presumably) deletes the buffer containing the key pad when
#> it exists.

Right... It turns out that version from frame-cmds.el doesn't handle
the case of "buffer" argument being nil all that well... Drew, you
might want to do something about that :)

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( slawomir.nowaczyk.847@student.lu.se )

If at first you dont succeed, destroy all evidence that you tried.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Minor problem with calc-quit
  2006-05-30 22:51   ` Slawomir Nowaczyk
@ 2006-05-30 23:19     ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2006-05-30 23:19 UTC (permalink / raw)


    Turns out I had Drew Adams' "frame-cmds.el" in my load path, which
    contains its own version of delete-windows-on and which somehow was
    being loaded even for "emacs -Q".
    
    #> The function `delete-windows-on' returns nil when there is no *Calc
    #> Keypad* (i.e., the argument for `delete-windows-on' is nil; I tested
    #> that) and (presumably) deletes the buffer containing the key pad when
    #> it exists.
    
    Right... It turns out that version from frame-cmds.el doesn't handle
    the case of "buffer" argument being nil all that well... Drew, you
    might want to do something about that :)
    
Fixed in frame-cmds.el. Thanks for the report.

Sounds to me like calc is counting on an undocumented "feature" of `delete-windows-on', which might not be such a good idea.

Perhaps the doc string for `delete-windows-on' should say something about this behavior, to legitimize programs counting on it. It says, instead, that "BUFFER must be a buffer or the name of an existing buffer", which obviously excludes nil as a valid value. The doc string suggests that with any other value than those mentioned you'll get an error, or unpredictable results, or... Perhaps it should say explicitly that it returns nil if BUFFER is nil.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-05-30 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-30 11:32 Minor problem with calc-quit Slawomir Nowaczyk
2006-05-30 12:55 ` Robert J. Chassell
2006-05-30 22:51   ` Slawomir Nowaczyk
2006-05-30 23:19     ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).