unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* speedbar.el makes bootstrapping fail.
@ 2004-08-22 20:03 Luc Teirlinck
  2004-08-22 20:07 ` Luc Teirlinck
  2004-08-22 22:14 ` Luc Teirlinck
  0 siblings, 2 replies; 4+ messages in thread
From: Luc Teirlinck @ 2004-08-22 20:03 UTC (permalink / raw)


`speedbar-supported-extension-expressions' and `speedbar-file-regexp'
mutually use each other.  `speedbar-supported-extension-expressions'
used to be defined first.  This gave a compiler warning, but no other
trouble that I know of.  A few hours ago Richard changed the order of
the two functions, in as far as I know, to get rid of the compiler
warning.  But this makes bootstrapping fail.

Interchanging the order again solves that problem.  So I plan to do
that, to make bootstrapping work.

I am hesitant to put a `with-no-warnings' around the defcustom,
because the elisp manual says that def{var,const,custom} should be at
top level.  The patch below first gives a "fake" defvar for
`speedbar-file-regexp', then defcustoms
`speedbar-supported-extension-expressions', then gives the real
defvar for `speedbar-file-regexp'.  The compiler seems happy with that.

Any comments?  I probably want to commit reasonably quickly, since
bootstrapping is broken and any change I make can always be amended.

Sincerely,

Luc.

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

* Re: speedbar.el makes bootstrapping fail.
  2004-08-22 20:03 speedbar.el makes bootstrapping fail Luc Teirlinck
@ 2004-08-22 20:07 ` Luc Teirlinck
  2004-08-22 22:14 ` Luc Teirlinck
  1 sibling, 0 replies; 4+ messages in thread
From: Luc Teirlinck @ 2004-08-22 20:07 UTC (permalink / raw)
  Cc: emacs-devel

I forgot to include my actual patch, but it pretty much just does what
I already explained.  Here it is:

===File ~/speedbar-diff=====================================
*** speedbar.el	22 Aug 2004 13:04:35 -0500	1.57
--- speedbar.el	22 Aug 2004 14:14:58 -0500	
***************
*** 665,676 ****
    "*Regexp matching files we don't want displayed in a speedbar buffer.
  It is generated from the variable `completion-ignored-extensions'")
  
! ;; This can't be further down, since it is needed just after.
! (defvar speedbar-file-regexp
!   (speedbar-extension-list-to-regex speedbar-supported-extension-expressions)
!   "Regular expression matching files we know how to expand.
! Created from `speedbar-supported-extension-expression' with the
! function `speedbar-extension-list-to-regex'")
  
  ;; this is dangerous to customize, because the defaults will probably
  ;; change in the future.
--- 665,672 ----
    "*Regexp matching files we don't want displayed in a speedbar buffer.
  It is generated from the variable `completion-ignored-extensions'")
  
! ;; Ugly compiler silencing trick.  The real defvar comes later.
! (defvar speedbar-file-regexp)
  
  ;; this is dangerous to customize, because the defaults will probably
  ;; change in the future.
***************
*** 698,703 ****
--- 694,705 ----
  	 (setq speedbar-supported-extension-expressions val
  	       speedbar-file-regexp (speedbar-extension-list-to-regex val))))
  
+ (defvar speedbar-file-regexp
+   (speedbar-extension-list-to-regex speedbar-supported-extension-expressions)
+   "Regular expression matching files we know how to expand.
+ Created from `speedbar-supported-extension-expression' with the
+ function `speedbar-extension-list-to-regex'")
+ 
  (defcustom speedbar-scan-subdirs nil
    "*Non-nil means speedbar will check if subdirs are empty.
  That way you don't have to click on them to find out.  But this
============================================================

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

* Re: speedbar.el makes bootstrapping fail.
  2004-08-22 20:03 speedbar.el makes bootstrapping fail Luc Teirlinck
  2004-08-22 20:07 ` Luc Teirlinck
@ 2004-08-22 22:14 ` Luc Teirlinck
  2004-08-23  7:57   ` Richard Stallman
  1 sibling, 1 reply; 4+ messages in thread
From: Luc Teirlinck @ 2004-08-22 22:14 UTC (permalink / raw)
  Cc: emacs-devel

I have committed my patch now.

>From my previous message:

   I am hesitant to put a `with-no-warnings' around the defcustom,
   because the elisp manual says that def{var,const,custom} should be at
   top level.

I realize now that this was stupid.  I do not know why I was thinking
that I had to put the `with-no-warnings' around the entire defcustom.
I only have to put it around one single setq.

The following patch is an alternative to the one I installed.  It is
made vs the now committed version.  I could install it if desired.  I
will wait for reactions however.  Bootstrapping works now and the
issue is purely stylistic.  If Richard was trying to do more than just
avoid a compiler warning, then a more fundamental change is needed.

===File ~/speedbar.el-diff==================================
*** speedbar.el	22 Aug 2004 14:58:16 -0500	1.58
--- speedbar.el	22 Aug 2004 16:31:54 -0500	
***************
*** 665,673 ****
    "*Regexp matching files we don't want displayed in a speedbar buffer.
  It is generated from the variable `completion-ignored-extensions'")
  
- ;; Ugly compiler silencing trick.  The real defvar comes later in this file.
- (defvar speedbar-file-regexp)
- 
  ;; this is dangerous to customize, because the defaults will probably
  ;; change in the future.
  (defcustom speedbar-supported-extension-expressions
--- 665,670 ----
***************
*** 691,698 ****
    :version "21.1"
    :type '(repeat (regexp :tag "Extension Regexp"))
    :set (lambda (sym val)
! 	 (setq speedbar-supported-extension-expressions val
! 	       speedbar-file-regexp (speedbar-extension-list-to-regex val))))
  
  (defvar speedbar-file-regexp
    (speedbar-extension-list-to-regex speedbar-supported-extension-expressions)
--- 688,696 ----
    :version "21.1"
    :type '(repeat (regexp :tag "Extension Regexp"))
    :set (lambda (sym val)
! 	 (setq speedbar-supported-extension-expressions val)
! 	 (with-no-warnings
! 	  (setq speedbar-file-regexp (speedbar-extension-list-to-regex val)))))
  
  (defvar speedbar-file-regexp
    (speedbar-extension-list-to-regex speedbar-supported-extension-expressions)
============================================================

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

* Re: speedbar.el makes bootstrapping fail.
  2004-08-22 22:14 ` Luc Teirlinck
@ 2004-08-23  7:57   ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2004-08-23  7:57 UTC (permalink / raw)
  Cc: teirllm, emacs-devel

The defvar is a perfectly fine way to fix this.
There's no need to replace it with with-no-warnings.

I recompiled speedbar.el after making the change and saw no problem,
but I suppose it was because something was already loaded.

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

end of thread, other threads:[~2004-08-23  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-22 20:03 speedbar.el makes bootstrapping fail Luc Teirlinck
2004-08-22 20:07 ` Luc Teirlinck
2004-08-22 22:14 ` Luc Teirlinck
2004-08-23  7:57   ` Richard Stallman

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).