English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 28 September 2016, 21:52   #1
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
[Cross-dev] Setting up emacs for amiga development

How about you setup your (linux) emacs to get autocompletion for amiga structures?

Take a look at the screenshot
Click image for larger version

Name:	Screenshot at 2016-09-28 22-08-26.png
Views:	328
Size:	89.1 KB
ID:	50174

Follow this excellent guide
Part 1: [ Show youtube player ]
Part 2: [ Show youtube player ]
Part 3: [ Show youtube player ]

And here is the .emacs file I ended up with (for reference purposes, change embedded paths to accommodate your setup)
Code:
(setq inhibit-startup-screen t)
(show-paren-mode 1)

(setq scroll-step            1
      scroll-conservatively  10000)

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)

(require 'yasnippet)
(yas-global-mode 1)

(defun my:ac-c-header-init ()
  (require 'auto-complete-c-headers)
  (add-to-list 'ac-sources 'ac-source-c-headers)
  (add-to-list 'achead:include-directories '"/usr/local/amiga/lib/gcc/m68k-amigaos/3.4.0/../../../../include/c++/3.4.0")
  (add-to-list 'achead:include-directories '"/usr/local/amiga/lib/gcc/m68k-amigaos/3.4.0/../../../../include/c++/3.4.0/m68k-amigaos")
  (add-to-list 'achead:include-directories '"/usr/local/amiga/lib/gcc/m68k-amigaos/3.4.0/../../../../include/c++/3.4.0/backward")
  (add-to-list 'achead:include-directories '"/usr/local/amiga/lib/gcc/m68k-amigaos/3.4.0/include")
  (add-to-list 'achead:include-directories '"/usr/local/amiga/lib/gcc/m68k-amigaos/3.4.0/../../../../m68k-amigaos/sys-include")
  (add-to-list 'achead:include-directories '"/usr/local/amiga/lib/gcc/m68k-amigaos/3.4.0/../../../../m68k-amigaos/include")
  )

(add-hook 'c++-mode-hook 'my:ac-c-header-init)
(add-hook 'c-mode-hook 'my:ac-c-header-init)

(define-key global-map (kbd "C-c ;") 'iedit-mode)


(defun my:flymake-google-init ()
  (require 'flymake-google-cpplint)
  (custom-set-variables
   '(flymake-google-cpplint-command "/usr/local/bin/cpplint"))
  (flymake-google-cpplint-load)
)

(add-hook 'c-mode-hook 'my:flymake-google-init)
(add-hook 'c++-mode-hook 'my:flymake-google-init)

(require 'google-c-style)
(add-hook 'c-mode-common-hook 'google-set-c-style)
(add-hook 'c-mode-common-hook 'google-make-newline-indent)


(semantic-mode 1)
(defun my:add-semantic-to-autocomplete()
  (add-to-list 'ac-sources 'ac-source-semantic)
  )
(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)

(global-ede-mode 1)
(global-semantic-idle-scheduler-mode 1)

(defun my-semantic-hook ()
  (semantic-add-system-include "/usr/local/amiga/m68k-amigaos/sys-include/" 'c-mode)
  (semantic-add-system-include "/usr/local/amiga/m68k-amigaos/sys-include/" 'c++-mode)
  (semantic-add-system-include "/usr/local/amiga/m68k-amigaos/include/" 'c-mode)
  (semantic-add-system-include "/usr/local/amiga/m68k-amigaos/include/" 'c++-mode))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
Of course, don't forget this: http://eab.abime.net/showthread.php?t=84201

Cheers.

Last edited by alkis; 29 September 2016 at 20:24. Reason: fixed stupid foo.c reference in .emacs
alkis is offline  
Old 28 September 2016, 22:23   #2
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,178
Nice writeup :-)

Emacs was the reason i stopped using Amiga, nothing as powerful around :-)
Locutus is offline  
Old 28 September 2016, 23:49   #3
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
@Locutus thanks!

Emacs is a beast. I am just beggining to feel a little bit comfortable with...And as the old usenet saying went "Emacs is a nice OS, it just lacks a good editor"
alkis is offline  
Old 29 September 2016, 00:03   #4
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,178
I always explain that Emacs is not a editor; its a runtime for a domain specific LISP oriented on text processing which you use to build your environment.
Locutus is offline  
Old 29 September 2016, 23:03   #5
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
4coder seems interesting...

https://4coder.handmade.network/

Kamelito
kamelito is offline  
Old 01 October 2016, 23:12   #6
cla
dev
 
cla's Avatar
 
Join Date: Aug 2014
Location: Copenhagen
Age: 48
Posts: 65
Send a message via ICQ to cla
Quote:
Originally Posted by alkis View Post
How about you setup your (linux) emacs to get autocompletion for amiga structures?
...
And here is the .emacs file I ended up with (for reference purposes, change embedded paths to accommodate your setup)
Its really cool. Does anything like this exist for KDevelop ?
cla is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs Mode for 68000 assembler atari900 Coders. Asm / Hardware 7 16 January 2023 12:01
getdoc: An autodoc viewer for linux [Cross-dev tool] alkis Coders. General 2 23 September 2016 14:22
Debugging messages in serial (small tutorial, mainly for cross-dev) alkis Coders. Asm / Hardware 7 22 February 2016 14:16
My super simple cross development tool chain - build and run in 15 seconds xxxxx Coders. Asm / Hardware 37 23 July 2015 21:15
Eclipse-Plugin for Amiga-Cross-development Paul News 1 04 September 2004 17:36

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:28.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07863 seconds with 14 queries