   (interactive "P")
   (save-buffer)
   (let* ((buf-name buffer-file-name)
-	 (filename (sw::file-to-specware-unit-id buf-name t))
+	 (filename (sw:containing-specware-unit-id t))
 	 (dir default-directory))
     (lisp-or-specware-command ":swl " "gen-lisp-top " filename)
     (when compile-and-load?

  (interactive "P")
  (save-buffer)
  (let* ((buf-name buffer-file-name)
	 (filename (sw::file-to-specware-unit-id buf-name t))
	 (dir default-directory))
    (lisp-or-specware-command ":swl " "gen-lisp " filename)
    (when compile-and-load?

  (define-key map "\C-cp"    'sw:process-current-file)
  (define-key map "\C-c\C-p" 'sw:process-unit)
  (define-key map "\C-c\g"   'sw:generate-lisp)
  (define-key map "\C-c\C-l" 'sw:gcl-current-file)
  (define-key map "\C-c\C-e" 'sw:evaluate-region)
  (define-key map "\C-c\C-s" 'sw:set-swe-spec)
  (define-key map "\C-c\C-u" 'sw:cl-unit)
