all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* IMPORTANTE... ho un problema con Emacs (Linux), forse tu.....
@ 2002-08-23 16:55 Silvestro Demartis
  0 siblings, 0 replies; 2+ messages in thread
From: Silvestro Demartis @ 2002-08-23 16:55 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2222 bytes --]

*****************************


 

volevo chiedervi alcune cose riguado un problema con EMACS.... spero tu 
possa aiutarmi,
o magari conosci chi lo puo fare... ti sarei molto grato!!

 

ti espongo subito il problema:

 

Devo far in modo che Emacs (sotto  Linux) possa "vedere", in pratica 
compilare un linguaggio
di grafica detto PLASM (se ti può essere d'aiuto di tale linguaggio 
posseggo gia 
il compilatore ed il suo editor, ma il mio lavoro consiste nel far in 
modo che 
la compilazione avvenga sotto Emacs!!!)

 

So che per far in modo che un qualsiasi linguaggio possa essere visto 
da Emacs 
bisogna creare dei modi.el in LISP (e poi inserirli e compilarli con 
Emacs "cosa che nemmeno so fare) 
tale che facciano da collante tra il linguaggio 
ed Emacs.....

 

In realtà il mio problema e:

 

Io posseggo gia il Plasm_mode.el (te lo allego all'e-mail) ma è per 
XEmacs (cioè per la versione Emacs di Windows)...
DOVREI ALLORA SOLTANTO MODIFICARE TALE FILE E FAR IN MODO CHE VADA BENE 
PER EMACS SU LINUX...

 

in realta non riesco nemmeno a far girare ciò (pur possedendo tale 
file.el) nemmeno XEmacs (Windows) 
........ forse non so quale è la procedura affinche Emacs o Xemacs 
(tanto sono uguali)
una volta che si ha il file.el compilino un  linguaggio!!!! (magari tu 
puoi dirmela)

 

ora ti chiedo (scusami.... ma se ti rubo tempo prezioso cestina pure la 
e-mail):

 

/////////////////////////

 

1) Come faccio (che sequenza di comandi o simili) a far in modo che 
Xemacs (Windows) veda il linguaggio PLASM 
   usando il file Plasm-Mode.el ??
2) Hai qualche idea per modificare il file Plasm-mode.el affinchè anche 
Emacs (Linux)
   possa compilare il PLASM ??

 

Sprero che tu possa rispondermi... o almeno darmi l'indirizzo e-mail di 
chi lo sa fare!!!
ho gia messo l'e-mail nel news-group (2 mesi fa) ma forse ho sbagliato 
group poichè non ho mai ricevuto alcuna risposta.

 

TI RINGRAZIO ANTICIPATAMENTE E TI RICORDO CHE SE CIO' TI PORTA VIA 
TROPPO TEMPO DI CESTINARE L'E-MAIL
E DI SCUSARMI PER IL DISTURBO....

 

Grazie
fammi sapere al più presto

 


CIAO
Silvestro (zetaform@tiscali.it)


[-- Attachment #2: plasm-mode.el --]
[-- Type: text/plain, Size: 7991 bytes --]

(require 'inf-lisp)
(require 'easymenu)


(defvar executable-binary-suffixes
  (if (memq system-type '(ms-dos windows-nt))
      '(".exe" ".com" ".bat" ".cmd" ".btm" "")
    '("")))         

(defun executable-find (command)
  "Search for COMMAND in exec-path and return the absolute file name.
Return nil if COMMAND is not found anywhere in `exec-path'."
  (let ((list exec-path)
        file)
    (while list
      (setq list
            (if (and (setq file (expand-file-name command (car list)))
                     (let ((suffixes executable-binary-suffixes)
                           candidate)
                       (while suffixes
                         (setq candidate (concat file (car suffixes)))
                         (if (and (file-executable-p candidate)
                                  (not (file-directory-p candidate)))
                             (setq suffixes nil)
                           (setq suffixes (cdr suffixes))
                           (setq candidate nil)))
                       (setq file candidate)))
                nil
              (setq file nil)
              (cdr list))))
    file))       
                      
;(setq inferior-lisp-program 
;      (if (not (eq system-type 'windows-nt))
;          (format "%s/xemacs/plasm_scheme" (getenv "PLASMHOME"))
;	"plasm_scheme"))
(setq inferior-lisp-program
	(executable-find "MzPlasm"))

(defvar internal-list nil)
(defvar is-active t)

(defun symbol-parser (str)
  (let ((lista (split-string str)))
    (setq internal-list
	  (if (string= (nth (1- (length lista)) lista) "#<PACKAGE USER>")
	      lista
;	      (reverse (cdr (reverse lista)))
	    lista))))

;(set-process-filter (get-buffer-process "*plasm*") nil)

;(setq comint-output-filter-functions (append comint-output-filter-functions '(symbol-parser)))

(defun create-popup-menu-vrml (symbol-list)
  (let ((i '0)
	(menu '("Scegli l'oggetto da esportare"))
	(len (length symbol-list)))
     (while (< i len)
;       (setq menu (append menu (list (make-vector 2 (nth i symbol-list)))))
       (setq menu (append menu (list (vector (nth i symbol-list) `(export-vrml-to-plasm ,(nth i symbol-list)) t ))))
       (setq i (1+ i)))
     menu))

(defun send-tab-to-inferior-plasm ()
  (interactive)
  (comint-dynamic-complete (inferior-lisp-proc)))
  

(defvar inferior-plasm-menubar '( "PLaSM" 
				  ["Export VRML        " export-vrml-popup is-active]
				  ["Set VRML version   " set-vrml-ver-emacs is-active]
		      ))

(define-derived-mode inferior-plasm-mode inferior-lisp-mode
  "PLaSM Interpreter"
  "This mode is for running a PLaSM interpreter as an inferior lisp process.
It is derived from the inferior-lisp-mode.
\\{inferior-lisp-mode-map}"
  (easy-menu-add inferior-plasm-menubar))

(define-key inferior-plasm-mode-map "\C-c\C-w" 'export-vrml-popup)
(define-key inferior-plasm-mode-map "\t" 'send-tab-to-inferior-plasm)

(defun inferior-plasm (cmd)
  "Run an inferior Lisp process, input and output via buffer `*plasm*'.
If there is a process already running in `*plasm*', just switch
to that buffer.
With argument, allows you to edit the command line (default is value
of `inferior-lisp-program').  Runs the hooks from
`inferior-lisp-mode-hook' (after the `comint-mode-hook' is run).
\(Type \\[describe-mode] in the process buffer for a list of commands.)"
  (interactive (list (if current-prefix-arg
			 (read-string "Run lisp: " inferior-lisp-program)
		       inferior-lisp-program)))
  (if (not (comint-check-proc "*plasm*"))
      (let ((cmdlist (inferior-lisp-args-to-list cmd)))
	(set-buffer (apply (function make-comint)
			   "plasm" (car cmdlist) nil (cdr cmdlist)))
	(inferior-plasm-mode)))
  (setq inferior-lisp-buffer "*plasm*")
  (delete-other-windows)
  (split-window-vertically)
  (pop-to-buffer "*plasm*"))

(define-function 'run-plasm 'inferior-plasm)

(defun plasm-eval-region (start end &optional and-go)
  "Send the current region to the inferior Lisp process.
Prefix argument means switch to the Lisp buffer afterwards."
  (interactive "r\nP")
  (comint-send-string (inferior-lisp-proc) "\(plasm \"")
  (comint-send-region (inferior-lisp-proc) start end)
  (comint-send-string (inferior-lisp-proc) "\"\)")
  (comint-send-string (inferior-lisp-proc) "\n")
  (if and-go (switch-to-lisp t)))

(defun plasm-eval-region-and-go (start end)
  "Send the current region to the inferior Lisp, and switch to its buffer."
  (interactive "r")
  (plasm-eval-region start end t))

(defun plasm-eval-buffer (&optional buffer)
  "Send all the current buffer to the inferior Lisp/PLaSM process for
evaling it."
  (let* ((plasm-buf (if (not (null buffer)) buffer (current-buffer))))
    (interactive "r")
    (plasm-eval-region (point-min plasm-buf) (point-max plasm-buf) t)))

(defun plasm-export-filter-vrml (process output)
  (let ((defdir (file-name-directory "."))
	(deffile (file-name-nondirectory "./pol.wrl"))
	fname
	)
    (interactive)
    (set-process-filter (get-buffer-process "*plasm*") nil)
    (setq fname (read-file-name "Inserire il nome del file : " defdir deffile))
    (comint-send-string (inferior-lisp-proc) fname)
    (comint-send-string (inferior-lisp-proc) "\n")))

(defun export-vrml-popup ()
"It exports the polyhedral complex value
of a plasm expression (default stored in last_value plasm name."
  (interactive)
;  (set-process-filter (get-buffer-process "*plasm*") 'symbol-parser)
;  (comint-send-string
;   (inferior-lisp-proc)
;   "(plasm::lista-simboli)")
;  (set-process-filter (get-buffer-process "*plasm*") nil)
  (popup-menu (create-popup-menu-vrml '("last_value"))))

(defun export-vrml-to-plasm (ogg)
"It exports the polyhedral complex value
of a plasm expression (default stored in last_value plasm name."
  (interactive)
  (set-process-filter (get-buffer-process "*plasm*") 'plasm-export-filter-vrml)
  (comint-send-string
   (inferior-lisp-proc)
   (format "(eval-plasm  \" export_vrml:(%s)\")\n" ogg))
  (sit-for '1)
  (switch-to-lisp t))

(defun set-vrml-ver-emacs ()
"It sets vrml exporting version"
    (setq ver
          (let ((vers (read-minibuffer "Type VRML version number (default 2):" "2")))
            (if (and (numberp vers)
                     (or (= vers 1)
                         (= vers 2)))
              vers
              2)))
      (interactive)
      (comint-send-string
       (inferior-lisp-proc) 
       (format "(io::set-vrml-ver %s )\n" ver)
       ))


(defvar plasm-mode-map (make-sparse-keymap)
  "Keymap used in PLaSM mode.")       

(define-key plasm-mode-map "\C-c\C-w" 'export-vrml-popup)
(define-key plasm-mode-map "\C-c\C-q" 'set-vrml-ver-emacs)
(define-key plasm-mode-map "\C-c\C-d" 'plasm-eval-buffer)
(define-key plasm-mode-map "\C-c\C-e" 'eval-buffer)
(define-key plasm-mode-map "\C-c\C-r" 'plasm-eval-region-and-go)
(define-key plasm-mode-map "\C-c\C-t" 'lisp-eval-region-and-go)
(define-key plasm-mode-map "\C-c\C-l" 'switch-to-lisp)
(define-key plasm-mode-map "\C-c\C-p" 'run-plasm)
(define-key plasm-mode-map [menu-bar] (make-sparse-keymap))  
(define-key plasm-mode-map [menu-bar plasm]
  (cons "PLaSM" (make-sparse-keymap "PLaSM")))
 (define-key plasm-mode-map [menu-bar plasm run-plasm]
  '("Start Interpreter" . run-plasm))
 (define-key plasm-mode-map [menu-bar plasm plasm-eval-region-and-go]
  '("Eval PLaSM expression" . plasm-eval-region-and-go))
 (define-key plasm-mode-map [menu-bar plasm lisp-eval-region-and-go]
  '("Eval Scheme expression" . lisp-eval-region-and-go))  

;(put 'run-plasm 'menu-enable 'mark-active)
;(put 'plasm-eval-region-and-go 'menu-enable 'mark-active)
;(put 'lisp-eval-region-and-go 'menu-enable 'mark-active)  


(defun plasm-mode ()
  "PLaSM" 
  "Major mode for PLaSM language derived from lisp-mode one.
  \\{plasm-mode-map}"
  (interactive)
  (kill-all-local-variables)
  (use-local-map plasm-mode-map)
  (setq major-mode 'plasm-mode)
  (setq mode-name "PLaSM"))        

(setq auto-mode-alist
      (append '(("\\.psm$"  . plasm-mode))
	      auto-mode-alist))


(provide 'plasm-mode) 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: IMPORTANTE... ho un problema con Emacs (Linux), forse tu.....
@ 2002-08-27 15:31 Silvestro Demartis
  0 siblings, 0 replies; 2+ messages in thread
From: Silvestro Demartis @ 2002-08-27 15:31 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2352 bytes --]

Ciao.... ho provato a fare quello che mi hai detto (sotto Gnu Emacs in Windows):

"""   per "caricare" un file all'interno di emacs si usa il commando load, o
     con una sequenza di tasti:

     M-x load-file RET plasm-mode.el RET

     o con del codice elisp (inserito nel tuo .emacs se vuoi che viene
     caricato ad ogni avvio di emacs):

     (load "plasm-mode.el")

     ovviamente dovrai specificare il percorso completo al file
     plasm-mode.el. """

non sono riuscito ad aggiungere il codice elisp nel mio .emacs (non so quale file sia e dove si trovi) ma mi pare di capire che ciò va fatto solo se voglio
che Emacs (io sto usanto Gnu Emacs sotto Windows) carichi ad ogni avvio il mio Plasm-Mode.el.... in ogni caso sono riuscito a fargli compilare il 
file Plasm-Mode.el ma non con la sequenza di tasti M-x load-file RET plasm-mode.el RET ma direttamente dal menu Emacs-Lisp alla voce Byte compile this File....
dovrebbe essere lo stesso non è vero?
dopo aver fatto cio infatti viene creto il file Plasm-Mode.elc nella stessa cartella in cui vi era il Plas-Mode.el  !!!!

Credevo di aver risolto è ho provato ad aprire un file .psm (estensione
del linguaggio che voglio configurare sotto Emacs) e come per magia nel menu
di Emacs compare la voce PLASM con i seguenti sottomenù ( Eval Scheme
expression; Eval Plasm Expression, Start Interpreter)  ho selezionato Eval Plasm
Expression ma....... nulla.....mi da il seguente errore:


""" default-load-handler: cannot open input file:
     "C:\WINDOWS\Desktop\src\Plasm\init.scm" (No such file or directory; errno=2)

      Process plasm exited abnormally with code -1
      default-load-handler: cannot open input file:
      "C:\WINDOWS\Desktop\src\Plasm\init.scm" (No such file or directory; errno=2)

      Process plasm exited abnormally with code -1 """

mentre nel frame più inferiore mi viene detto """ No Lisp Subprocess; see variable 'inferior-lisp-buffer'

sai da cosa può dipendere?? il mio problema è proprio questo!!.... poichè se tu mi dici che poi sotto Linux non ci sono problemi poiche le cose sono identiche(a me infatti importa che il tutto funzioni su Emacs Linux)

io non ho alcuna idea....sara forse colpa del file Plasm-mode.el ?

Ti ringrazio ancora per il tuo interessamento.....


Grazie 
Silvestro
ciao Silvestro


[-- Attachment #2: Type: text/html, Size: 4202 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-27 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-23 16:55 IMPORTANTE... ho un problema con Emacs (Linux), forse tu Silvestro Demartis
  -- strict thread matches above, loose matches on Subject: below --
2002-08-27 15:31 Silvestro Demartis

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.