help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: major mode for fpscalc + some meta


From: Emanuel Berg
Subject: Re: major mode for fpscalc + some meta
Date: Mon, 23 Sep 2013 03:11:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> define-abbrev-table should be at the top-level, not
> within fpscalc-mode.
>
> and of course, this won't work any more when src and
> dst include funny characters: you want to pass to
> `find-file(-noselect)' the non-quoted file.

I updated the source:

http://user.it.uu.se/~embe8573/fps/fpscalc.el

Now it looks like this:

(defun compute ()
  "Run the system defined in the current buffer (i.e.,
an .fps file), save the fallout in a file, and show that
file in a new buffer."
  (interactive)
  (let*((src  (buffer-file-name))
        (dst  (format "%s_fallout.txt" src))
        (srcq (shell-quote-argument src))
        (dstq (shell-quote-argument dst)) )
    (shell-command
     (format "%s < %s > %s" fpscalc-command-name srcq dstq))
    (display-buffer (find-file-noselect dst)) ))

(add-hook 'fpscalc-mode-hook 'init-fpscalc-abbrevs)

(defun init-fpscalc-abbrevs ()
  (define-abbrev-table 'fpscalc-mode-abbrev-table
    '(("init" "initialise")
      ("prio" "priority") )))

-- 
Emanuel Berg - programmer (hire me! CV below)
computer projects: http://user.it.uu.se/~embe8573
internet activity: http://home.student.uu.se/embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]