2 ;;; File: erlang_appwiz.el
3 ;;; Author: Johan Bevermyr
4 ;;; Created: Tue Dec 9 13:14:24 1997
5 ;;; Purpose: Adds a simple application wizard to erlang.el.
7 ;; OBS! Must be loaded before the erlang.el file is loaded.
8 ;; Add the following to your .emacs file before erlang.el is loaded.
10 ;; (load "erlang_appwiz" t nil)
12 ;; Customisation of makefile generation:
14 ;; The templates for generating makefiles are stored in the
15 ;; variables erlang-skel-makefile-src and erlang-skel-makefile-middle.
17 ;; These can be modified by setting the variables before or after this
20 ;; For example, to generate OTP-style make files:
23 ;;(defvar erlang-skel-makefile-src
24 ;; '((erlang-skel-include erlang-skel-nomodule-header)
25 ;; "CC_ROOT := $(shell pwd | sed 's/erts.*$$//')" n
26 ;; "AUTOCONF := $(CC_ROOT)/erts/autoconf" n
27 ;; "TARGET := $(shell $(AUTOCONF)/config.guess)"
28 ;; "include $(CC_ROOT)/internal_tools/make/$(TARGET)/otp.mk" n
30 ;; "# ----------------------------------------------------" n
31 ;; "# Application version " n
32 ;; "# ----------------------------------------------------" n
33 ;; "include ../vsn.mk" n
34 ;; "VSN=$(KERNEL_VSN)" n
36 ;; "# ----------------------------------------------------" n
37 ;; "# Release directory specification" n
38 ;; "# ----------------------------------------------------" n
39 ;; "RELEASE_PATH= ../../../release/$(TARGET)" n
40 ;; "RELSYSDIR = $(RELEASE_PATH)/lib/kernel-$(VSN)" n
42 ;; "# ----------------------------------------------------" n
44 ;; "# ----------------------------------------------------" n
46 ;; "MODULES= " appwiz-erlang-modulename n
50 ;; INTERNAL_HRL_FILES= appwiz-erlang-modulename "_sup.hrl" n
52 ;; "ERL_FILES= $(MODULES:%=%.erl)" n
54 ;; "TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET)" n
56 ;; "APP_FILE= " appwiz-erlang-modulename ".app" n
58 ;; "APP_SRC= $(APP_FILE).src" n
59 ;; "APP_TARGET= ../ebin/$(APP_FILE)" n
61 ;; "# ----------------------------------------------------" n
63 ;; "# ----------------------------------------------------" n
65 ;; "ERL_COMPILE_FLAGS += -I../include" n
67 ;; "# ----------------------------------------------------" n
69 ;; "# ----------------------------------------------------" n
71 ;; "debug opt: $(TARGET_FILES)" n
74 ;; " rm -f $(TARGET_FILES) $(GEN_FILES)" n
79 ;; "# ----------------------------------------------------" n
80 ;; "# Special Build Targets " n
81 ;; "# ----------------------------------------------------" n
83 ;; "$(APP_TARGET): $(APP_SRC) " n
84 ;; " sed -e 's;%VSN%;$(VSN);' $(APP_SRC) > $(APP_TARGET)" n
86 ;; "# ----------------------------------------------------" n
87 ;; "# Release Target " n
88 ;; "# ----------------------------------------------------" n
89 ;; "include $(CC_ROOT)/internal_tools/make/otp_release_targets.mk" n
91 ;; "release_spec: opt" n
92 ;; " $(INSTALL_DIR) $(RELSYSDIR)/src " n
93 ;; " $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src " n
94 ;; " $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src " n
95 ;; " $(INSTALL_DIR) $(RELSYSDIR)/include " n
96 ;; " $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include " n
97 ;; " $(INSTALL_DIR) $(RELSYSDIR)/ebin " n
98 ;; " $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin " n
100 ;; "release_docs_spec:" n
106 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
108 ;; Erlang application wizard
111 (defun erlang-application-wizard (directory name
)
112 "Creates all files and directories needed for an application.
113 The top-level directory is placed in DIRECTORY. NAME is used when
114 creating the root directory and for naming application files."
116 (interactive "DApplication root directory: \nsName of application: ")
118 (lastchar (substring directory
(- (length directory
) 1)))
119 (apptype (completing-read "Type of application: "
130 (if (string= lastchar
"/")
132 (setq dir
(concat directory
"/")))
134 ;; determine type of application
135 (cond ((string= apptype
"gen_server")
136 (setq extension
"_server")
137 (setq appname
(concat name extension
))
138 (setq apptemplate
'tempo-template-erlang-generic-server
)
139 (setq apitemplate
'tempo-template-erlang-large-header
))
140 ((string= apptype
"gen_event")
141 (setq extension
"_event")
142 (setq appname
(concat name extension
))
143 (setq apptemplate
'tempo-template-erlang-gen-event
)
144 (setq apitemplate
'tempo-template-erlang-large-header
))
145 ((string= apptype
"gen_fsm")
146 (setq extension
"_fsm")
147 (setq appname
(concat name extension
))
148 (setq apptemplate
'tempo-template-erlang-gen-fsm
)
149 (setq apitemplate
'tempo-template-large-header
))
151 ;; use defaults _work
152 (setq extension
"_work")
153 (setq appname
(concat name extension
))
154 (setq apptemplate
'tempo-template-erlang-large-header
)
155 (setq apitemplate
'tempo-template-erlang-large-header
)))
157 (setq appwiz-erlang-modulename appname
)
158 (setq appwiz-erlang-ext extension
)
160 ;; create directories
161 (make-directory (concat dir name
"/" "src") t
)
162 (make-directory (concat dir name
"/" "ebin") t
)
163 (make-directory (concat dir name
"/" "include") t
)
165 ;; create directory content
167 (find-file (concat dir name
"/" "src/" name
".erl"))
168 (funcall apitemplate
)
169 (insert "API module for the application " name
".")
173 (find-file (concat dir name
"/" "src/" name
"_app.erl"))
174 (tempo-template-erlang-application)
175 (insert "Application callback module for the application " name
".")
177 (let ((quotedname (erlang-add-quotes-if-needed
178 (concat name
"_sup")))
180 (while (search-forward "'TopSupervisor':start_link" nil t
)
181 (replace-match (concat quotedname
":start_link") nil t
))
187 (find-file (concat dir name
"/" "src/" name
"_sup.erl"))
188 (tempo-template-erlang-supervisor)
189 (insert "Top level supervisor for the application " name
".")
192 (let ((quotedname (erlang-add-quotes-if-needed appname
))
194 (while (search-forward "'AName'" nil t
)
195 (replace-match quotedname nil t
))
198 (let ((quotedname (erlang-add-quotes-if-needed appname
))
201 (while (search-forward "'AMODULE'" nil t
)
202 (replace-match quotedname nil t
))
208 (find-file (concat dir name
"/" "src/" name
"_sup.hrl"))
209 (tempo-template-erlang-nomodule-header)
212 ;;;;;;;;; _(application).erl
213 (find-file (concat dir name
"/" "src/" appname
".erl"))
214 (funcall apptemplate
)
217 ;;;;;;;;; makefile (src)
218 (find-file (concat dir name
"/" "src/makefile"))
219 (setq appwiz-erlang-modulename name
)
220 (setq appwiz-erlang-ext extension
)
221 (tempo-template-erlang-makefile-src)
222 (insert "Makefile for application " name
".")
223 (let ((start (point)))
225 (while (search-forward "%" nil t
)
226 (replace-match "#" nil t
))
230 ;;;;;;;;; makefile (middle)
231 (find-file (concat dir name
"/" "makefile"))
232 (tempo-template-erlang-makefile-middle)
233 (insert "Makefile for application " name
".")
234 (let ((start (point)))
236 (while (search-forward "%" nil t
)
237 (replace-match "#" nil t
))
242 (find-file (concat dir name
"/" "ebin/" name
".app"))
244 (tempo-template-erlang-app)
245 (insert "Application specification file for " name
".")
248 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
253 (defvar appwiz-erlang-modulename
"foo")
254 (defvar appwiz-erlang-ext
"_work")
256 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
259 ;; Skeletons for nomodule header and .app file added by JB.
263 '(("If" "if" erlang-skel-if
)
264 ("Case" "case" erlang-skel-case
)
265 ("Receive" "receive" erlang-skel-receive
)
266 ("Receive After" "after" erlang-skel-receive-after
)
267 ("Receive Loop" "loop" erlang-skel-receive-loop
)
268 ("Module" "module" erlang-skel-module
)
269 ("Author" "author" erlang-skel-author
)
270 ("Query" "query" erlang-skel-query
)
272 ("Small Header" "small-header"
273 erlang-skel-small-header erlang-skel-header
)
274 ("Normal Header" "normal-header"
275 erlang-skel-normal-header erlang-skel-header
)
276 ("Large Header" "large-header"
277 erlang-skel-large-header erlang-skel-header
)
278 ("No Moudle Header" "nomodule-header"
279 erlang-skel-nomodule-header erlang-skel-header
)
281 ("Small Server" "small-server"
282 erlang-skel-small-server erlang-skel-header
)
284 ("application" "application"
285 erlang-skel-application erlang-skel-header
)
287 erlang-skel-app erlang-skel-header
)
288 ("supervisor" "supervisor"
289 erlang-skel-supervisor erlang-skel-header
)
290 ("supervisor_bridge" "supervisor-bridge"
291 erlang-skel-supervisor-bridge erlang-skel-header
)
292 ("gen_server" "generic-server"
293 erlang-skel-generic-server erlang-skel-header
)
294 ("gen_event" "gen-event"
295 erlang-skel-gen-event erlang-skel-header
)
297 erlang-skel-gen-fsm erlang-skel-header
))
298 "*Description of all skeletons templates.
299 Both functions and menu entries will be created.
301 Each entry in `erlang-skel' should be a list with three or four
302 elements, or the empty list.
304 The first element is the name which shows up in the menu. The second
305 is the `tempo' identfier (The string \"erlang-\" will be added in
306 front of it). The third is the skeleton descriptor, a variable
307 containing `tempo' attributes as described in the function
308 `tempo-define-template'. The optinal fourth elements denotes a
309 function which should be called when the menu is selected.
311 Functions corresponding to every template will be created. The name
312 of the function will be `tempo-template-erlang-X' where `X' is the
313 tempo identifier as specified in the second argument of the elements
316 A list with zero elemets means that the a horisontal line should
317 be placed in the menu.")
319 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
321 ;; Template for .app file skeleton
324 (defvar erlang-skel-app
325 '((erlang-skel-include erlang-skel-nomodule-header
)
327 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) "," n
>
328 "[{description, \"" (erlang-get-module-from-file-name) "\"}," n
>
331 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) "," n
>
332 (erlang-add-quotes-if-needed
333 (concat (erlang-get-module-from-file-name) "_app")) "," n
>
334 (erlang-add-quotes-if-needed
335 (concat (erlang-get-module-from-file-name) "_sup")) "," n
>
336 (erlang-add-quotes-if-needed
337 (concat (erlang-get-module-from-file-name) appwiz-erlang-ext
)) "]}," n
>
339 (erlang-add-quotes-if-needed
340 (concat (erlang-get-module-from-file-name) appwiz-erlang-ext
)) ","
341 (erlang-add-quotes-if-needed
342 (concat (erlang-get-module-from-file-name) "_sup")) "]}," n
>
343 "{applications, [kernel," n
>
349 (erlang-add-quotes-if-needed
350 (concat (erlang-get-module-from-file-name) "_app"))
353 "*The template of an application file
354 Please see the function `tempo-define-template'.")
356 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
358 ;; Template for no-module header skeleton.
361 (defvar erlang-skel-nomodule-header
362 '(o (erlang-skel-separator)
363 (erlang-skel-include erlang-skel-copyright-comment
364 erlang-skel-file-comment
365 erlang-skel-author-comment
)
367 (erlang-skel-include erlang-skel-created-comment
)
368 (erlang-skel-separator) n
)
369 "*The template of a normal header.
370 Please see the function `tempo-define-template'.")
372 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
374 ;; .app extension added.
377 (defvar erlang-file-name-extension-regexp
"\\.\\(erl\\|hrl\\|app\\)$"
378 "*Regexp which should match an erlang file name.
380 This regexp is used when an Erlang module name is extracted from the
381 name of an Erlang source file.
383 The regexp should only match the section of the file name which should
384 be excluded from the module name.
386 To match all files set this variable to \"\\\\(\\\\..*\\\\|\\\\)$\".
387 The matches all except the extension. This is useful if the Erlang
388 tags system should interpretate tags on the form `module:tag' for
389 files written in other languages than Erlang.")
391 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
393 ;; Wizard menu added.
396 (defvar erlang-menu-items
398 (("Indent Line" erlang-indent-command
)
399 ("Indent Region " erlang-indent-region
400 (if erlang-xemacs-p
(mark) mark-active
))
401 ("Indent Clause" erlang-indent-caluse
)
402 ("Indent Function" erlang-indent-function
)
403 ("Indent Buffer" erlang-indent-current-buffer
)))
405 (("Fill Comment" erlang-fill-paragraph
)
406 ("Comment Region" comment-region
407 (if erlang-xemacs-p
(mark) mark-active
))
408 ("Uncomment Region" erlang-uncomment-region
409 (if erlang-xemacs-p
(mark) mark-active
))
411 ("beginning of Function" erlang-beginning-of-function
)
412 ("End of Function" erlang-end-of-function
)
413 ("Mark Function" erlang-mark-function
)
415 ("beginning of Clause" erlang-beginning-of-clause
)
416 ("End of Clause" erlang-end-of-clause
)
417 ("Mark Clause" erlang-mark-clause
)
419 ("New Clause" erlang-generate-new-clause
)
420 ("Clone Arguments" erlang-clone-arguments
)))
422 (("Level 3" erlang-font-lock-level-3
)
423 ("Level 2" erlang-font-lock-level-2
)
424 ("Level 1" erlang-font-lock-level-1
)
425 ("Off" erlang-font-lock-level-0
)))
427 (("Find Tag" find-tag
)
428 ("Find Next Tag" erlang-find-next-tag
)
429 ;("Find Regexp" find-tag-regexp)
430 ("Complete Word" erlang-complete-tag
)
431 ("Tags Apropos" tags-apropos
)
432 ("Search Files" tags-search
)))
434 ("Erlang Shell" inferior-erlang-run-or-select
)
435 ("Compile" erlang-compile
)
436 ("Next Error" inferior-erlang-next-error
)
438 ("Version" erlang-version
)
441 (("Application Wizard" erlang-application-wizard
))))
442 "*Description of menu used in Erlang mode.
444 This variable must be a list. The elements are either nil representing
445 a horisontal line or a list with two or three elements. The first is
446 the name of the menu item, the second is the function to call, or a
447 submenu, on the same same form as ITEMS. The third optional argument
448 is an expression which is evaluated every time the menu is displayed.
449 Should the expression evaluate to nil the menu item is ghosted.
452 '((\"Func1\" function-one)
454 ((\"Yellow\" function-yellow)
455 (\"Blue\" function-blue)))
457 (\"Region Funtion\" spook-function midnight-variable))
459 Call the function `erlang-menu-init' after modifying this variable.")
461 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
463 ;; Prefixing space removed from date string
466 (defun erlang-skel-d-mmm-yyyy ()
467 "Return the current date as a string in \"DD Mon YYYY\" form.
468 The first character of DD is *not* space if the value is less than 10."
469 (let ((date (current-time-string)))
471 (string-to-int (substring date
8 10))
473 (substring date -
4))))
475 (defvar erlang-skel-date-function
'erlang-skel-d-mmm-yyyy
476 "*Function which returns date string.
477 Look in the module `time-stamp' for a battery of functions.")
480 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
482 ;; Fixed skeletons. erlang-add-quotes-if-needed introduced where needed.
484 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
486 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
489 (defvar erlang-skel-small-server
490 '((erlang-skel-include erlang-skel-large-header
)
491 "-export([start/0,init/1])." n n n
492 "start() ->" n
> "spawn("
493 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
494 ", init, [self()])." n n
503 "*Template of a small server.
504 Please see the function `tempo-define-template'.")
506 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
507 ;; Behaviour templates.
509 (defvar erlang-skel-application
510 '((erlang-skel-include erlang-skel-large-header
)
511 "-behaviour(application)." n
513 "%% application callbacks" n
514 "-export([start/2, stop/1])." n n
515 (erlang-skel-separator)
516 "%%% Callback functions from application" n
517 (erlang-skel-separator)
519 (erlang-skel-separator 2)
521 "%% Returns: {ok, Pid} |" n
522 "%% {ok, Pid, State} |" n
523 "%% {error, Reason} " n
524 (erlang-skel-separator 2)
525 "start(Type, StartArgs) ->" n
>
526 "case 'TopSupervisor':start_link(StartArgs) of" n
>
533 (erlang-skel-separator 2)
536 (erlang-skel-separator 2)
540 (erlang-skel-separator)
541 "%%% Internal functions" n
542 (erlang-skel-separator)
544 "*The template of an application behaviour.
545 Please see the function `tempo-define-template'.")
547 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
549 (defvar erlang-skel-supervisor
550 '((erlang-skel-include erlang-skel-large-header
)
551 "-behaviour(supervisor)." n
553 "%% External exports" n
554 "-export([start_link/1])." n
556 "%% supervisor callbacks" n
557 "-export([init/1])." n n
558 (erlang-skel-separator)
560 (erlang-skel-separator)
561 "start_link(StartArgs) ->" n
>
562 "supervisor:start_link({local, "
563 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) "}, "
564 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
567 (erlang-skel-separator)
568 "%%% Callback functions from supervisor" n
569 (erlang-skel-separator)
571 (erlang-skel-separator 2)
573 "%% Returns: {ok, {SupFlags, [ChildSpec]}} |" n
575 "%% {error, Reason} " n
576 (erlang-skel-separator 2)
577 "init(StartArgs) ->" n
>
578 "AChild = {'AName',{'AModule',start_link,[]}," n
>
579 "permanent,2000,worker,['AModule']}," n
>
580 "{ok,{{one_for_all,4,3600}, [AChild]}}." n
582 (erlang-skel-separator)
583 "%%% Internal functions" n
584 (erlang-skel-separator)
586 "*The template of an supervisor behaviour.
587 Please see the function `tempo-define-template'.")
589 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
591 (defvar erlang-skel-supervisor-bridge
592 '((erlang-skel-include erlang-skel-large-header
)
593 "-behaviour(supervisor_bridge)." n
595 "%% External exports" n
596 "-export([start_link/0])." n
598 "%% supervisor callbacks" n
599 "-export([init/1, terminate/2])." n n
600 "-record(state, {})." n
602 (erlang-skel-separator)
604 (erlang-skel-separator)
605 "start_link() -> " n
>
606 "supervisor_bridge:start_link({local, "
607 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) "}, "
608 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
611 (erlang-skel-separator)
612 "%%% Callback functions from supervisor_bridge" n
613 (erlang-skel-separator)
615 (erlang-skel-separator 2)
617 "%% Returns: {ok, Pid, State} |" n
619 "%% {error, Reason} " n
620 (erlang-skel-separator 2)
622 "case 'AModule':start_link() of" n
>
624 "{ok, Pid, #state{}};" n
>
629 (erlang-skel-separator 2)
630 "%% Func: terminate/2" n
631 "%% Purpose: Synchronized shutdown of the underlying sub system." n
633 (erlang-skel-separator 2)
634 "terminate(Reason, State) ->" n
>
635 "'AModule':stop()," n
>
638 (erlang-skel-separator)
639 "%%% Internal functions" n
640 (erlang-skel-separator)
642 "*The template of an supervisor_bridge behaviour.
643 Please see the function `tempo-define-template'.")
645 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
647 (defvar erlang-skel-generic-server
648 '((erlang-skel-include erlang-skel-large-header
)
649 "-behaviour(gen_server)." n
651 "%% External exports" n
652 "-export([start_link/0])." n
654 "%% gen_server callbacks" n
655 "-export([init/1, handle_call/3, handle_cast/2, "
656 "handle_info/2, terminate/2])." n n
657 "-record(state, {})." n
659 (erlang-skel-separator)
661 (erlang-skel-separator)
662 "start_link() -> " n
>
663 "gen_server:start_link({local, "
664 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) "}, "
665 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
668 (erlang-skel-separator)
669 "%%% Callback functions from gen_server" n
670 (erlang-skel-separator)
672 (erlang-skel-separator 2)
674 "%% Returns: {ok, State} |" n
675 "%% {ok, State, Timeout} |" n
677 "%% {stop, Reason}" n
678 (erlang-skel-separator 2)
682 (erlang-skel-separator 2)
683 "%% Func: handle_call/3" n
684 "%% Returns: {reply, Reply, State} |" n
685 "%% {reply, Reply, State, Timeout} |" n
686 "%% {noreply, State} |" n
687 "%% {noreply, State, Timeout} |" n
688 "%% {stop, Reason, Reply, State} | (terminate/2 is called)" n
689 "%% {stop, Reason, State} (terminate/2 is called)" n
690 (erlang-skel-separator 2)
691 "handle_call(Request, From, State) ->" n
>
693 "{reply, Reply, State}." n
695 (erlang-skel-separator 2)
696 "%% Func: handle_cast/2" n
697 "%% Returns: {noreply, State} |" n
698 "%% {noreply, State, Timeout} |" n
699 "%% {stop, Reason, State} (terminate/2 is called)" n
700 (erlang-skel-separator 2)
701 "handle_cast(Msg, State) ->" n
>
702 "{noreply, State}." n
704 (erlang-skel-separator 2)
705 "%% Func: handle_info/2" n
706 "%% Returns: {noreply, State} |" n
707 "%% {noreply, State, Timeout} |" n
708 "%% {stop, Reason, State} (terminate/2 is called)" n
709 (erlang-skel-separator 2)
710 "handle_info(Info, State) ->" n
>
711 "{noreply, State}." n
713 (erlang-skel-separator 2)
714 "%% Func: terminate/2" n
715 "%% Purpose: Shutdown the server" n
716 "%% Returns: any (ignored by gen_server)" n
717 (erlang-skel-separator 2)
718 "terminate(Reason, State) ->" n
>
721 (erlang-skel-separator)
722 "%%% Internal functions" n
723 (erlang-skel-separator)
725 "*The template of a generic server.
726 Please see the function `tempo-define-template'.")
728 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
730 (defvar erlang-skel-gen-event
731 '((erlang-skel-include erlang-skel-large-header
)
732 "-behaviour(gen_event)." n
734 "%% External exports" n
735 "-export([start_link/0, add_handler/0])." n
737 "%% gen_event callbacks" n
738 "-export([init/1, handle_event/2, handle_call/2, "
739 "handle_info/2, terminate/2])." n n
740 "-record(state, {})." n
742 (erlang-skel-separator)
744 (erlang-skel-separator)
746 "gen_event:start_link({local, "
747 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) "}). " n
749 "add_handler() ->" n
>
750 "gen_event:add_handler("
751 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) ", "
752 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
755 (erlang-skel-separator)
756 "%%% Callback functions from gen_event" n
757 (erlang-skel-separator)
759 (erlang-skel-separator 2)
761 "%% Returns: {ok, State} |" n
763 (erlang-skel-separator 2)
767 (erlang-skel-separator 2)
768 "%% Func: handle_event/2" n
769 "%% Returns: {ok, State} |" n
770 "%% {swap_handler, Args1, State1, Mod2, Args2} |" n
771 "%% remove_handler " n
772 (erlang-skel-separator 2)
773 "handle_event(Event, State) ->" n
>
776 (erlang-skel-separator 2)
777 "%% Func: handle_call/2" n
778 "%% Returns: {ok, Reply, State} |" n
779 "%% {swap_handler, Reply, Args1, State1, Mod2, Args2} |" n
780 "%% {remove_handler, Reply} " n
781 (erlang-skel-separator 2)
782 "handle_call(Request, State) ->" n
>
784 "{ok, Reply, State}." n
786 (erlang-skel-separator 2)
787 "%% Func: handle_info/2" n
788 "%% Returns: {ok, State} |" n
789 "%% {swap_handler, Args1, State1, Mod2, Args2} |" n
790 "%% remove_handler " n
791 (erlang-skel-separator 2)
792 "handle_info(Info, State) ->" n
>
795 (erlang-skel-separator 2)
796 "%% Func: terminate/2" n
797 "%% Purpose: Shutdown the server" n
799 (erlang-skel-separator 2)
800 "terminate(Reason, State) ->" n
>
803 (erlang-skel-separator)
804 "%%% Internal functions" n
805 (erlang-skel-separator)
807 "*The template of a gen_event.
808 Please see the function `tempo-define-template'.")
810 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
812 (defvar erlang-skel-gen-fsm
813 '((erlang-skel-include erlang-skel-large-header
)
814 "-behaviour(gen_fsm)." n
816 "%% External exports" n
817 "-export([start_link/0])." n
819 "%% gen_fsm callbacks" n
820 "-export([init/1, state_name/2, state_name/3, handle_event/3," n
>
821 "handle_sync_event/4, handle_info/3, terminate/3])." n n
822 "-record(state, {})." n
824 (erlang-skel-separator)
826 (erlang-skel-separator)
828 "gen_fsm:start_link({local, "
829 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) "}, "
830 (erlang-add-quotes-if-needed (erlang-get-module-from-file-name))
833 (erlang-skel-separator)
834 "%%% Callback functions from gen_fsm" n
835 (erlang-skel-separator)
837 (erlang-skel-separator 2)
839 "%% Returns: {ok, StateName, StateData} |" n
840 "%% {ok, StateName, StateData, Timeout} |" n
842 "%% {stop, StopReason} " n
843 (erlang-skel-separator 2)
845 "{ok, state_name, #state{}}." n
847 (erlang-skel-separator 2)
848 "%% Func: StateName/2" n
849 "%% Returns: {next_state, NextStateName, NextStateData} |" n
850 "%% {next_state, NextStateName, NextStateData, Timeout} |" n
851 "%% {stop, Reason, NewStateData} " n
852 (erlang-skel-separator 2)
853 "state_name(Event, StateData) ->" n
>
854 "{nextstate, state_name, StateData}." n
856 (erlang-skel-separator 2)
857 "%% Func: StateName/3" n
858 "%% Returns: {next_state, NextStateName, NextStateData} |" n
859 "%% {next_state, NextStateName, NextStateData, Timeout} |" n
860 "%% {reply, Reply, NextStateName, NextStateData} |" n
861 "%% {reply, Reply, NextStateName, NextStateData, Timeout} |" n
862 "%% {stop, Reason, NewStateData} |" n
863 "%% {stop, Reason, Reply, NewStateData} " n
864 (erlang-skel-separator 2)
865 "state_name(Event, From, StateData) ->" n
>
867 "{reply, Reply, state_name, StateData}." n
869 (erlang-skel-separator 2)
870 "%% Func: handle_event/3" n
871 "%% Returns: {next_state, NextStateName, NextStateData} |" n
872 "%% {next_state, NextStateName, NextStateData, Timeout} |" n
873 "%% {stop, Reason, NewStateData} " n
874 (erlang-skel-separator 2)
875 "handle_event(Event, StateName, StateData) ->" n
>
876 "{nextstate, StateName, StateData}." n
878 (erlang-skel-separator 2)
879 "%% Func: handle_sync_event/4" n
880 "%% Returns: {next_state, NextStateName, NextStateData} |" n
881 "%% {next_state, NextStateName, NextStateData, Timeout} |" n
882 "%% {reply, Reply, NextStateName, NextStateData} |" n
883 "%% {reply, Reply, NextStateName, NextStateData, Timeout} |" n
884 "%% {stop, Reason, NewStateData} |" n
885 "%% {stop, Reason, Reply, NewStateData} " n
886 (erlang-skel-separator 2)
887 "handle_sync_event(Event, From, StateName, StateData) ->" n
>
889 "{reply, Reply, StateName, StateData}." n
891 (erlang-skel-separator 2)
892 "%% Func: handle_info/3" n
893 "%% Returns: {next_state, NextStateName, NextStateData} |" n
894 "%% {next_state, NextStateName, NextStateData, Timeout} |" n
895 "%% {stop, Reason, NewStateData} " n
896 (erlang-skel-separator 2)
897 "handle_info(Info, StateName, StateData) ->" n
>
898 "{nextstate, StateName, StateData}." n
900 (erlang-skel-separator 2)
901 "%% Func: terminate/3" n
902 "%% Purpose: Shutdown the fsm" n
904 (erlang-skel-separator 2)
905 "terminate(Reason, StateName, StatData) ->" n
>
908 (erlang-skel-separator)
909 "%%% Internal functions" n
910 (erlang-skel-separator)
912 "*The template of a gen_fsm.
913 Please see the function `tempo-define-template'.")
916 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
918 ;; Original erlang-add-quotes-if-needed is broken, we install a
922 (add-hook 'erlang-load-hook
'my-erlang-load-mods
)
924 (defun fixed-erlang-add-quotes-if-needed (str)
925 "Return STR, possibly with quotes."
926 (let ((saved-case-fold-search case-fold-search
)
928 (setq case-fold-search nil
)
929 (setq result
(if (string-match (concat "\\`" erlang-atom-regexp
"\\'") str
)
931 (concat "'" str
"'")))
932 (setq case-fold-search saved-case-fold-search
)
935 (defun my-erlang-load-mods ()
936 (fset 'erlang-add-quotes-if-needed
937 (symbol-function 'fixed-erlang-add-quotes-if-needed
))
940 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
942 ;; Additional skeletons which are not shown in the Erlang menu.
947 ; ("generic-server-no-api" erlang-skel-generic-server-no-api)
948 ; ("generic-server-api" erlang-skel-generic-server-api)
949 ; ("gen-event-no-api" erlang-skel-gen-event-no-api)
950 ; ("gen-event-api" erlang-skel-gen-event-api)
951 ; ("gen-fsm-no-api" erlang-skel-gen-fsm-no-api)
952 ; ("gen-fsm-api" erlang-skel-gen-fsm-api)
953 ("makefile-middle" erlang-skel-makefile-middle
)
954 ("makefile-src" erlang-skel-makefile-src
)))
956 (defun appwiz-skel-init ()
957 "Generate the skeleton functions."
962 (if (featurep 'tempo
)
963 (let ((skel appwiz-skel
))
965 (funcall (symbol-function 'tempo-define-template
)
966 (concat "erlang-" (nth 0 (car skel
)))
967 ;; The tempo template used contains an `include'
968 ;; function call only, hence changes to the
969 ;; variables describing the templates take effect
971 (list (list 'erlang-skel-include
(nth 1 (car skel
))))
973 (setq skel
(cdr skel
))))))
976 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
980 ;;(defvar erlang-skel-generic-server-no-api
981 ;; '((erlang-skel-include erlang-skel-large-header)
982 ;; "-behaviour(gen_server)." n
984 ;; "%% gen_server callbacks" n
985 ;; "-export([init/1, handle_call/3, handle_cast/2, "
986 ;; "handle_info/2, terminate/2])." n n
987 ;; "-record(state, {})." n
989 ;; (erlang-skel-separator)
990 ;; "%%% Callback functions from gen_server" n
991 ;; (erlang-skel-separator)
993 ;; (erlang-skel-separator 2)
994 ;; "%% Func: init/1" n
995 ;; "%% Returns: {ok, State} |" n
996 ;; "%% {ok, State, Timeout} |" n
998 ;; "%% {stop, Reason}" n
999 ;; (erlang-skel-separator 2)
1001 ;; "{ok, #state{}}." n
1003 ;; (erlang-skel-separator 2)
1004 ;; "%% Func: handle_call/3" n
1005 ;; "%% Returns: {reply, Reply, State} |" n
1006 ;; "%% {reply, Reply, State, Timeout} |" n
1007 ;; "%% {noreply, State} |" n
1008 ;; "%% {noreply, State, Timeout} |" n
1009 ;; "%% {stop, Reason, Reply, State} | (terminate/2 is called)" n
1010 ;; "%% {stop, Reason, State} (terminate/2 is called)" n
1011 ;; (erlang-skel-separator 2)
1012 ;; "handle_call(Request, From, State) ->" n>
1014 ;; "{reply, Reply, State}." n
1016 ;; (erlang-skel-separator 2)
1017 ;; "%% Func: handle_cast/2" n
1018 ;; "%% Returns: {noreply, State} |" n
1019 ;; "%% {noreply, State, Timeout} |" n
1020 ;; "%% {stop, Reason, State} (terminate/2 is called)" n
1021 ;; (erlang-skel-separator 2)
1022 ;; "handle_cast(Msg, State) ->" n>
1023 ;; "{noreply, State}." n
1025 ;; (erlang-skel-separator 2)
1026 ;; "%% Func: handle_info/2" n
1027 ;; "%% Returns: {noreply, State} |" n
1028 ;; "%% {noreply, State, Timeout} |" n
1029 ;; "%% {stop, Reason, State} (terminate/2 is called)" n
1030 ;; (erlang-skel-separator 2)
1031 ;; "handle_info(Info, State) ->" n>
1032 ;; "{noreply, State}." n
1034 ;; (erlang-skel-separator 2)
1035 ;; "%% Func: terminate/2" n
1036 ;; "%% Purpose: Shutdown the server" n
1037 ;; "%% Returns: any (ignored by gen_server)" n
1038 ;; (erlang-skel-separator 2)
1039 ;; "terminate(Reason, State) ->" n>
1042 ;; (erlang-skel-separator)
1043 ;; "%%% Internal functions" n
1044 ;; (erlang-skel-separator)
1046 ;; "*The template of a generic server.
1047 ;;Please see the function `tempo-define-template'.")
1049 ;;(defvar erlang-skel-generic-server-api
1050 ;; '((erlang-skel-include erlang-skel-large-header)
1051 ;; "%% External exports" n
1052 ;; "-export([start_link/0])." n
1054 ;; (erlang-skel-separator)
1056 ;; (erlang-skel-separator)
1057 ;; "start_link() ->" n>
1058 ;; "gen_server:start_link({local, "
1059 ;; (erlang-add-quotes-if-needed
1060 ;; (concat (erlang-get-module-from-file-name) "_server")) "}, "
1061 ;; (erlang-add-quotes-if-needed
1062 ;; (concat (erlang-get-module-from-file-name) "_server")) ", [], [])." n
1066 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1070 ;;(defvar erlang-skel-gen-event-no-api
1071 ;; '((erlang-skel-include erlang-skel-large-header)
1072 ;; "-behaviour(gen_event)." n
1074 ;; "%% gen_event callbacks" n
1075 ;; "-export([init/1, handle_event/2, handle_call/2, "
1076 ;; "handle_info/2, terminate/2])." n n
1077 ;; "-record(state, {})." n
1079 ;; (erlang-skel-separator)
1080 ;; "%%% Callback functions from gen_event" n
1081 ;; (erlang-skel-separator)
1083 ;; (erlang-skel-separator 2)
1084 ;; "%% Func: init/1" n
1085 ;; "%% Returns: {ok, State} |" n
1087 ;; (erlang-skel-separator 2)
1089 ;; "{ok, #state{}}." n
1091 ;; (erlang-skel-separator 2)
1092 ;; "%% Func: handle_event/2" n
1093 ;; "%% Returns: {ok, State} |" n
1094 ;; "%% {swap_handler, Args1, State1, Mod2, Args2} |" n
1095 ;; "%% remove_handler " n
1096 ;; (erlang-skel-separator 2)
1097 ;; "handle_event(Event, State) ->" n>
1100 ;; (erlang-skel-separator 2)
1101 ;; "%% Func: handle_call/2" n
1102 ;; "%% Returns: {ok, Reply, State} |" n
1103 ;; "%% {swap_handler, Reply, Args1, State1, Mod2, Args2} |" n
1104 ;; "%% {remove_handler, Reply} " n
1105 ;; (erlang-skel-separator 2)
1106 ;; "handle_call(Request, State) ->" n>
1108 ;; "{ok, Reply, State}." n
1110 ;; (erlang-skel-separator 2)
1111 ;; "%% Func: handle_info/2" n
1112 ;; "%% Returns: {ok, State} |" n
1113 ;; "%% {swap_handler, Args1, State1, Mod2, Args2} |" n
1114 ;; "%% remove_handler " n
1115 ;; (erlang-skel-separator 2)
1116 ;; "handle_info(Info, State) ->" n>
1119 ;; (erlang-skel-separator 2)
1120 ;; "%% Func: terminate/2" n
1121 ;; "%% Purpose: Shutdown the server" n
1122 ;; "%% Returns: any" n
1123 ;; (erlang-skel-separator 2)
1124 ;; "terminate(Reason, State) ->" n>
1127 ;; (erlang-skel-separator)
1128 ;; "%%% Internal functions" n
1129 ;; (erlang-skel-separator)
1131 ;; "*The template of a gen_event.
1132 ;;Please see the function `tempo-define-template'.")
1134 ;;(defvar erlang-skel-gen-event-api
1135 ;; '((erlang-skel-include erlang-skel-large-header)
1136 ;; "%% External exports" n
1137 ;; "-export([start_link/0, add_handler/0])." n
1139 ;; (erlang-skel-separator)
1141 ;; (erlang-skel-separator)
1142 ;; "start_link() ->" n>
1143 ;; "gen_event:start_link({local, "
1144 ;; (erlang-add-quotes-if-needed
1145 ;; (concat (erlang-get-module-from-file-name) "_event")) "}). " n
1147 ;; "add_handler() ->" n>
1148 ;; "gen_event:add_handler("
1149 ;; (erlang-add-quotes-if-needed
1150 ;; (concat (erlang-get-module-from-file-name) "_event")) ", "
1151 ;; (erlang-add-quotes-if-needed
1152 ;; (concat (erlang-get-module-from-file-name) "_event")) ", [])." n
1155 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1159 ;;(defvar erlang-skel-gen-fsm
1160 ;; '((erlang-skel-include erlang-skel-large-header)
1161 ;; "-behaviour(gen_fsm)." n
1163 ;; "%% gen_fsm callbacks" n
1164 ;; "-export([init/1, state_name/2, state_name/3, handle_event/3," n>
1165 ;; "handle_sync_event/4, handle_info/3, terminate/3])." n n
1166 ;; "-record(state, {})." n
1168 ;; (erlang-skel-separator)
1169 ;; "%%% Callback functions from gen_fsm" n
1170 ;; (erlang-skel-separator)
1172 ;; (erlang-skel-separator 2)
1173 ;; "%% Func: init/1" n
1174 ;; "%% Returns: {ok, StateName, StateData} |" n
1175 ;; "%% {ok, StateName, StateData, Timeout} |" n
1177 ;; "%% {stop, StopReason} " n
1178 ;; (erlang-skel-separator 2)
1180 ;; "{ok, state_name, #state{}}." n
1182 ;; (erlang-skel-separator 2)
1183 ;; "%% Func: StateName/2" n
1184 ;; "%% Returns: {next_state, NextStateName, NextStateData} |" n
1185 ;; "%% {next_state, NextStateName, NextStateData, Timeout} |" n
1186 ;; "%% {stop, Reason, NewStateData} " n
1187 ;; (erlang-skel-separator 2)
1188 ;; "state_name(Event, StateData) ->" n>
1189 ;; "{nextstate, state_name, StateData}." n
1191 ;; (erlang-skel-separator 2)
1192 ;; "%% Func: StateName/3" n
1193 ;; "%% Returns: {next_state, NextStateName, NextStateData} |" n
1194 ;; "%% {next_state, NextStateName, NextStateData, Timeout} |" n
1195 ;; "%% {reply, Reply, NextStateName, NextStateData} |" n
1196 ;; "%% {reply, Reply, NextStateName, NextStateData, Timeout} |" n
1197 ;; "%% {stop, Reason, NewStateData} |" n
1198 ;; "%% {stop, Reason, Reply, NewStateData} " n
1199 ;; (erlang-skel-separator 2)
1200 ;; "state_name(Event, From, StateData) ->" n>
1202 ;; "{reply, Reply, state_name, StateData}." n
1204 ;; (erlang-skel-separator 2)
1205 ;; "%% Func: handle_event/3" n
1206 ;; "%% Returns: {next_state, NextStateName, NextStateData} |" n
1207 ;; "%% {next_state, NextStateName, NextStateData, Timeout} |" n
1208 ;; "%% {stop, Reason, NewStateData} " n
1209 ;; (erlang-skel-separator 2)
1210 ;; "handle_event(Event, StateName, StateData) ->" n>
1211 ;; "{nextstate, StateName, StateData}." n
1213 ;; (erlang-skel-separator 2)
1214 ;; "%% Func: handle_sync_event/4" n
1215 ;; "%% Returns: {next_state, NextStateName, NextStateData} |" n
1216 ;; "%% {next_state, NextStateName, NextStateData, Timeout} |" n
1217 ;; "%% {reply, Reply, NextStateName, NextStateData} |" n
1218 ;; "%% {reply, Reply, NextStateName, NextStateData, Timeout} |" n
1219 ;; "%% {stop, Reason, NewStateData} |" n
1220 ;; "%% {stop, Reason, Reply, NewStateData} " n
1221 ;; (erlang-skel-separator 2)
1222 ;; "handle_sync_event(Event, From, StateName, StateData) ->" n>
1224 ;; "{reply, Reply, StateName, StateData}." n
1226 ;; (erlang-skel-separator 2)
1227 ;; "%% Func: handle_info/3" n
1228 ;; "%% Returns: {next_state, NextStateName, NextStateData} |" n
1229 ;; "%% {next_state, NextStateName, NextStateData, Timeout} |" n
1230 ;; "%% {stop, Reason, NewStateData} " n
1231 ;; (erlang-skel-separator 2)
1232 ;; "handle_info(Info, StateName, StateData) ->" n>
1233 ;; "{nextstate, StateName, StateData}." n
1235 ;; (erlang-skel-separator 2)
1236 ;; "%% Func: terminate/3" n
1237 ;; "%% Purpose: Shutdown the fsm" n
1238 ;; "%% Returns: any" n
1239 ;; (erlang-skel-separator 2)
1240 ;; "terminate(Reason, StateName, StatData) ->" n>
1243 ;; (erlang-skel-separator)
1244 ;; "%%% Internal functions" n
1245 ;; (erlang-skel-separator)
1247 ;; "*The template of a gen_fsm.
1248 ;;Please see the function `tempo-define-template'.")
1250 ;;(defvar erlang-skel-gen-fsm-no-api
1251 ;; '((erlang-skel-include erlang-skel-large-header)
1252 ;; "%% External exports" n
1253 ;; "-export([start_link/0])." n
1255 ;; (erlang-skel-separator)
1257 ;; (erlang-skel-separator)
1258 ;; "start_link() ->" n>
1259 ;; "gen_fsm:start_link({local, "
1260 ;; (erlang-add-quotes-if-needed
1261 ;; (concat (erlang-get-module-from-file-name) "_fsm")) "}, "
1262 ;; (erlang-add-quotes-if-needed
1263 ;; (concat (erlang-get-module-from-file-name) "_fsm")) ", [], [])." n
1268 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1270 ;; requires that the variables appwiz-erlang-modulename and
1271 ;; appwiz-erlang-ext are defined.
1274 (defvar erlang-skel-makefile-src
1275 '((erlang-skel-include erlang-skel-nomodule-header
)
1282 (erlang-skel-makefile-separator)
1284 (upcase appwiz-erlang-modulename
) "_HEADER_FILES = "
1285 appwiz-erlang-modulename
"_sup.hrl" n
1287 (upcase appwiz-erlang-modulename
) "_SOURCE_FILES = \\" n
1288 " " appwiz-erlang-modulename
".erl" " "
1289 appwiz-erlang-modulename
"_sup.erl \\" n
1290 " " appwiz-erlang-modulename
"_app.erl" " "
1291 appwiz-erlang-modulename appwiz-erlang-ext
".erl" n
1293 (upcase appwiz-erlang-modulename
) "_OBJECT_FILES = $("
1294 (upcase appwiz-erlang-modulename
) "_SOURCE_FILES:.erl=.jam)" n
1297 (erlang-skel-makefile-separator)
1299 "# Transformations " n
1305 (erlang-skel-makefile-separator) n
1309 appwiz-erlang-modulename n
1311 appwiz-erlang-modulename
": $("
1312 (upcase appwiz-erlang-modulename
) "_OBJECT_FILES)" n
1313 " cp $(" (upcase appwiz-erlang-modulename
) "_OBJECT_FILES) "
1317 " /bin/rm -f $(" (upcase appwiz-erlang-modulename
)
1320 "$(" (upcase appwiz-erlang-modulename
) "_OBJECT_FILES): $("
1321 (upcase appwiz-erlang-modulename
) "_HEADER_FILES)" n
1323 ".SUFFIXES : .erl .jam" n
1327 (defvar erlang-skel-makefile-middle
1328 '((erlang-skel-include erlang-skel-nomodule-header
)
1331 (erlang-skel-makefile-separator)
1334 " (cd src ; $(MAKE))" n
1337 " (cd src ; $(MAKE) clean)" n
1341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1343 (defun erlang-skel-makefile-separator ()
1344 "Return a comment separator."
1345 (concat (make-string 70 ?\
#) "\n"))