unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* invisible buffer is it possible?
@ 2002-11-26 12:41 Phillip Lord
  2002-11-26 13:13 ` Carsten Dominik
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Phillip Lord @ 2002-11-26 12:41 UTC (permalink / raw)





I'm just wondering whether I can create an invisible buffer, or
something similar? That is one which does not appear in the buffer
menu list, and you can't accidentally change to. 

The reason for this is that I have use this little hack....

(add-hook 'xml-mode-hook
          'phil-psgml-hook)
          
(defun phil-psgml-hook()
  "Does various checks and sets up various variables
 1) Checks to see if the file being loaded is one which needs a fake DOCTYPE. 
 That is I don't want to have the doctype in the buffer but want psgml mode to
 think that there is one. 
 2) Sets up default validate command"
  (interactive)
  (if (string= "build.xml"
               (file-name-nondirectory (buffer-file-name)))
      (setq sgml-parent-document '( "~/emacs/anthead.xml" "" "project"
      ))))


What this does is allow me to use a DTD for editing ant build files,
without having to put the doctype declaration into the build file
itself, which goes into the anthead.xml file. 

However it results in the anthead.xml file being opened into a buffer,
and it's just an annoyance. 

Is there someway that I can mark it invisible?


Cheers

Phil

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

* Re: invisible buffer is it possible?
  2002-11-26 12:41 invisible buffer is it possible? Phillip Lord
@ 2002-11-26 13:13 ` Carsten Dominik
  2002-11-26 14:12 ` Stein A. Stromme
  2002-11-26 15:15 ` Stefan Monnier <foo@acm.com>
  2 siblings, 0 replies; 8+ messages in thread
From: Carsten Dominik @ 2002-11-26 13:13 UTC (permalink / raw)



How about starting the buffer name with a space?

From the elisp documentation:

   Buffers that are ephemeral and generally uninteresting to the user
have names starting with a space, so that the `list-buffers' and
`buffer-menu' commands don't mention them.  A name starting with space
also initially disables recording undo information; see *Note Undo::.

- Carsten



>>>>> "PL" == Phillip Lord <p.lord@russet.org.uk> writes:

PL> I'm just wondering whether I can create an invisible buffer, or
PL> something similar? That is one which does not appear in the buffer
PL> menu list, and you can't accidentally change to. 

PL> The reason for this is that I have use this little hack....

PL> (add-hook 'xml-mode-hook
PL>           'phil-psgml-hook)
          
PL> (defun phil-psgml-hook()
PL>   "Does various checks and sets up various variables
PL>  1) Checks to see if the file being loaded is one which needs a fake DOCTYPE. 
PL>  That is I don't want to have the doctype in the buffer but want psgml mode to
PL>  think that there is one. 
PL>  2) Sets up default validate command"
PL>   (interactive)
PL>   (if (string= "build.xml"
PL>                (file-name-nondirectory (buffer-file-name)))
PL>       (setq sgml-parent-document '( "~/emacs/anthead.xml" "" "project"
PL>       ))))


PL> What this does is allow me to use a DTD for editing ant build files,
PL> without having to put the doctype declaration into the build file
PL> itself, which goes into the anthead.xml file. 

PL> However it results in the anthead.xml file being opened into a buffer,
PL> and it's just an annoyance. 

PL> Is there someway that I can mark it invisible?


PL> Cheers

PL> Phil

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

* Re: invisible buffer is it possible?
  2002-11-26 12:41 invisible buffer is it possible? Phillip Lord
  2002-11-26 13:13 ` Carsten Dominik
@ 2002-11-26 14:12 ` Stein A. Stromme
  2002-11-26 14:15   ` Stein A. Stromme
  2002-11-26 15:15 ` Stefan Monnier <foo@acm.com>
  2 siblings, 1 reply; 8+ messages in thread
From: Stein A. Stromme @ 2002-11-26 14:12 UTC (permalink / raw)


[Phillip Lord]

| I'm just wondering whether I can create an invisible buffer, or
| something similar? That is one which does not appear in the buffer
| menu list, and you can't accidentally change to. 
| 
| The reason for this is that I have use this little hack....

I did not look into your hack but buffer names which start with " *"
(note the space) do not appear in the buffer menu list, and are not
presented as visible choices for tab completion after C-x C-b unless
you actually type the space before the tab.
-- 
Stein Arild Strømme            +47 55584825, +47 95801887
Universitetet i Bergen                  Fax: +47 55589672     
Matematisk institutt               www.mi.uib.no/~stromme         
Johs Brunsg 12, N-5008 BERGEN           stromme@mi.uib.no

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

* Re: invisible buffer is it possible?
  2002-11-26 14:12 ` Stein A. Stromme
@ 2002-11-26 14:15   ` Stein A. Stromme
  0 siblings, 0 replies; 8+ messages in thread
From: Stein A. Stromme @ 2002-11-26 14:15 UTC (permalink / raw)


[Stein A. Stromme]

| [Phillip Lord]
| 
| | I'm just wondering whether I can create an invisible buffer, or
| | something similar? That is one which does not appear in the buffer
| | menu list, and you can't accidentally change to. 
| | 
| | The reason for this is that I have use this little hack....
| 
| I did not look into your hack but buffer names which start with " *"
| (note the space) do not appear in the buffer menu list, and are not
| presented as visible choices for tab completion after C-x C-b unless
| you actually type the space before the tab.

The * does not matter, it seems sufficient that the buffer name start
with a space.
-- 
Stein Arild Strømme            +47 55584825, +47 95801887
Universitetet i Bergen                  Fax: +47 55589672     
Matematisk institutt               www.mi.uib.no/~stromme         
Johs Brunsg 12, N-5008 BERGEN           stromme@mi.uib.no

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

* Re: invisible buffer is it possible?
  2002-11-26 12:41 invisible buffer is it possible? Phillip Lord
  2002-11-26 13:13 ` Carsten Dominik
  2002-11-26 14:12 ` Stein A. Stromme
@ 2002-11-26 15:15 ` Stefan Monnier <foo@acm.com>
  2002-11-26 15:33   ` Phillip Lord
  2 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-11-26 15:15 UTC (permalink / raw)


>>>>> "Phillip" == Phillip Lord <p.lord@russet.org.uk> writes:
> (add-hook 'xml-mode-hook 'phil-psgml-hook)
> (defun phil-psgml-hook()
>   (interactive)
>   (if (string= "build.xml"
>                (file-name-nondirectory (buffer-file-name)))
>       (setq sgml-parent-document '( "~/emacs/anthead.xml" "" "project"
>       ))))

I don't see how this code could create any extra buffer.


        Stefan

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

* Re: invisible buffer is it possible?
  2002-11-26 15:15 ` Stefan Monnier <foo@acm.com>
@ 2002-11-26 15:33   ` Phillip Lord
  2002-11-26 15:44     ` lawrence mitchell
  0 siblings, 1 reply; 8+ messages in thread
From: Phillip Lord @ 2002-11-26 15:33 UTC (permalink / raw)


>>>>> "Stefan" == "Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

>>>>> "Phillip" == Phillip Lord <p.lord@russet.org.uk> writes:
  >> (add-hook 'xml-mode-hook 'phil-psgml-hook) (defun
  >> phil-psgml-hook() (interactive) (if (string= "build.xml"
  >> (file-name-nondirectory (buffer-file-name))) (setq
  >> sgml-parent-document '( "~/emacs/anthead.xml" "" "project" ))))

  Stefan> I don't see how this code could create any extra buffer.

You wouldn't have thought so would you. None the less, there it is. 

PSGML opens up the parent document when it loads a child. So with this
hook in, any time you open "build.xml", then the anthead.xml file will
also get opened. Its buried, but its there. 

Phil

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

* Re: invisible buffer is it possible?
  2002-11-26 15:33   ` Phillip Lord
@ 2002-11-26 15:44     ` lawrence mitchell
  2002-11-26 16:17       ` Phillip Lord
  0 siblings, 1 reply; 8+ messages in thread
From: lawrence mitchell @ 2002-11-26 15:44 UTC (permalink / raw)


Phillip Lord wrote:

[...]

> You wouldn't have thought so would you. None the less, there it
> is.

> PSGML opens up the parent document when it loads a child. So
> with this hook in, any time you open "build.xml", then the
> anthead.xml file will also get opened. Its buried, but its
> there.

Look at `sgml-load-doctype' and `sgml-in-file-eval'.  Which seem
to be the main culprits.

-- 
lawrence mitchell <wence@gmx.li>

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

* Re: invisible buffer is it possible?
  2002-11-26 15:44     ` lawrence mitchell
@ 2002-11-26 16:17       ` Phillip Lord
  0 siblings, 0 replies; 8+ messages in thread
From: Phillip Lord @ 2002-11-26 16:17 UTC (permalink / raw)


>>>>> "lawrence" == lawrence mitchell <wence@gmx.li> writes:

  lawrence> Phillip Lord wrote:

  lawrence> [...]

  >> You wouldn't have thought so would you. None the less, there it
  >> is.

  >> PSGML opens up the parent document when it loads a child. So with
  >> this hook in, any time you open "build.xml", then the anthead.xml
  >> file will also get opened. Its buried, but its there.

  lawrence> Look at `sgml-load-doctype' and `sgml-in-file-eval'.
  lawrence> Which seem to be the main culprits.

Well this does seem to be where the loading is taking place. I guess
that the solution is to modify this function to provide some
alternative way of determining the doctype. Using sgml-parent-document
in the way that I have is a bit of a hack at best. 

Phil

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

end of thread, other threads:[~2002-11-26 16:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-26 12:41 invisible buffer is it possible? Phillip Lord
2002-11-26 13:13 ` Carsten Dominik
2002-11-26 14:12 ` Stein A. Stromme
2002-11-26 14:15   ` Stein A. Stromme
2002-11-26 15:15 ` Stefan Monnier <foo@acm.com>
2002-11-26 15:33   ` Phillip Lord
2002-11-26 15:44     ` lawrence mitchell
2002-11-26 16:17       ` Phillip Lord

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