Menu

emacs GCB syntax highlighting

Trev
2018-08-22
2018-08-29
  • Trev

    Trev - 2018-08-22

    I have put together a file for the emacs editor to add syntax highlighting for Great Cow Basic. While this was created for FreeBSD it should also work with Linux, macOS and Windows versions of emacs.

    To use it, you need to modify/create your .emacs init file and add:

    (require 'generic-x)  ;; needed for gcbasic.el
    (load "~/.emacs.d/my-lisp/gcbasic.el") ;; load gcbasic.el on startup
    

    The gcbasic.el file may be downloaded from: here

    And this is what it looks like (sorry, no fancy X window manager, just twm with basic decorations):

    Image

     
  • Trev

    Trev - 2018-08-27

    The full .emacs init file from my home directory with some additional tweaks for GCB (file is fully commented if you do not Lisp yourself):

    (custom-set-variables
     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(inhibit-startup-screen t)
     '(show-paren-mode t))
    
    (require 'generic-x)                    ;; needed for gcbasic.el
    (load "~/.emacs.d/my-lisp/gcbasic.el")  ;; load   "   "
    
    ;; (setq case-fold-search nil) ;; make searches case sensitive
    (setq case-fold-search t)      ;; make searches case insensitive
    
    ;; compile command ('make' instead of the default 'make -k')
    (setq compile-command "make") 
    
    ;; GCB compile command where no Makefile found
    (require 'compile)
     (add-hook 'gcbasic-mode-hook
          (lambda ()
            (unless (file-exists-p "Makefile")
            (set (make-local-variable 'compile-command)
            (let ((file (file-name-nondirectory buffer-file-name)))
                 (format "%s /K=A /A:GCASM /NP %s"
                 (or (getenv "CC") "/home/trev/GreatCowBasic/gcbasic")
            file))))))
    
    ;; use F9 for compile keyboard shortcut
    (global-set-key (kbd "<f9>") 'compile)
    
    ;; run compile command without needing RETURN 
    (setq compilation-read-command nil)
    
     
  • bed

    bed - 2018-08-27

    Nice to meet someone still using (micro)emacs.
    In a C-Project ages ago I used xemacs, in that time Java hit the market and eclipes was born.
    I loved the IDE /Make style of xemacs

     
  • Trev

    Trev - 2018-08-27

    All the "modern" IDEs are so big and clunky compared to the lightweight, but infinitely customisable, emacs editor.

    I still remember the first time, back in the 1980s, that I discovered I could read my email and browse the web from within the emacs editor out of the box with no configuration necessary!

     
  • Chris Roper

    Chris Roper - 2018-08-28

    Not to be pedantic but the web was only invented in 1989.
    Until then we were using Usenet which was invented in 1979.
    I certainly don't miss the days of waiting 30 min for a drawing to download in 3 or 4 parts :)

     
  • Trev

    Trev - 2018-08-28

    Argh, a typo - it was the 1990s. I first set up a web site in 1994 on Windows 3.1. In the 1980s I was using Mark Williams Coherent UNIX and UUCP for email and Usenet via dialup modem.

    I do not miss the days of watching 300 baud Xmodem tranfers of files from the USA to Australia over a telco satellite link... rx 128 bytes, tx an ack and wait, rx the next 128 bytes and on and on until a few blocks before the end of the file the line drops out so that you had to redial and start again from block 1. The phone rate at that time for international calls was $3 per minute <ouch>. </ouch>

     
  • bed

    bed - 2018-08-28

    A bit of offtopic here, but I got to grips with Linux very early on.
    Before Linux I installed a used COHERENT 3-0 (4 floppy disks) for 90 DM on a 286 booksize computer, that was early 1992.
    I took it with me to the Unix courses and set it up in the hotel room with a 12 inch amber monitor. Coherent is a really nice Unix without X. It ran on the 286 with 12 Mhz and 2-4 MB Ram (I can't remember exactly). There was a 20 MByte hard disk inside. I still have COHERENT's really good manual in my closet today, unfortunately the disks are no longer readable. But it wasn't network-compatible, so it wasn't really useful in this day and age. After the end of the course I was able to sit down at my Unix computer instead of going to the pub with the others and program the first shell-scripts and menus.

    As I just discovered, the source of COHERENT has been released in the meantime.

     
  • Trev

    Trev - 2018-08-29

    I kept my last print copy of the COHERENT manual for many years before selling it on to someone who was looking for it in the early 2000s. Sale price being the cost of postage as that thing weighed a ton! It was, by far, the best manual I have ever owned.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.