Loading ...
Sorry, an error occurred while loading the content.

[jasspa] Re: how to set modes of *scratch*

Expand Messages
  • Jon Green
    Thomas, Try this; this should do what you want *AND* whenever you kill off the *scratch* buffer it will come back with the document modes enabled. Place it in
    Message 1 of 3 , Aug 25, 1999
    • 0 Attachment
      Thomas,

      Try this; this should do what you want *AND* whenever you
      kill off the *scratch* buffer it will come back with the
      document modes enabled.

      Place it in your <user>.emf
      Regards
      Jon.

      ;
      ; Bind the document template to the scratch buffer when it's loaded.
      ; Because the *scratch* buffer is created first thing then delete it.
      ; We do this by renaming it, adding our document binding and then deleting
      ; the scratch buffer under it's new name. We know MicroEmacs will create us
      ; a new scratch when nothing else is in the system so it will come back with
      ; the document attributes assigned.
      ; Horrible, but true !!
      add-file-hook "*scratch*" fhook-doc
      !if &seq $buffer-bname "*scratch*"
      change-buffer-name "*foo*"
      1 delete-buffer "*foo*"
      !endif


      Thomas Hundt wrote:
      >
      > I'm trying to get Emacs, when it is started w/o a filename parameter, to come up with the *scratch* buffer in wrap mode. (This is because nine times out of ten, when I just start it "empty", I'll next be pasting in some text copied from a browser or e-mail program, which I'd like to have in wrap mode for editing.)
      >
      > So, I added this code to thundt.emf, my startup file:
      >
      > ;-----
      > ; Setups for buffer *scratch*
      > ;-----
      > !if &seq "*scratch*" $buffer-bname
      > ml-write "[foo]"
      > 39 buffer-mode ; also tried 1 buffer-mode "wrap" which didn't work, either
      > !endif
      >
      > This does, indeed, display "[foo]" when I run the program. But, wrap mode is not engaged. Using a global-mode will set the buffer mode, but it also sets it for C programs -- not a useful thing.
      >
      > What's the next place I should look?
      >
      > Thank you,
      >
      > -Th
      >
      > ------------------------------------------------------------------------
      > __________________________________________________________________________
      >
      > This is an unmoderated list. JASSPA is not responsible for the content of
      > any material posted to this list.

      --
      ______________________________________________________________________

      Jon Green - jon@...
      ______________________________________________________________________
    • Thomas Hundt
      ... Neato! Works great! File-hook; yet another slick little trick. -Th
      Message 2 of 3 , Aug 27, 1999
      • 0 Attachment
        |add-file-hook "*scratch*" fhook-doc
        |!if &seq $buffer-bname "*scratch*"
        | change-buffer-name "*foo*"
        | 1 delete-buffer "*foo*"
        |!endif
        |>
        |> I'm trying to get Emacs, when it is started w/o a filename parameter, to come up with the *scratch* buffer in wrap mode. (This is because nine times out of ten,

        Neato! Works great! File-hook; yet another slick little trick.


        -Th
      Your message has been successfully submitted and would be delivered to recipients shortly.