From 612d4dc6a021662d85d5a0ced9b17d1cb0c8cd2d Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Fri, 6 Nov 1998 15:50:28 +0000 Subject: Added prefix arg to thy-find-other-file to use same window --- isa/thy-mode.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/isa/thy-mode.el b/isa/thy-mode.el index 99707615..dd0416a8 100644 --- a/isa/thy-mode.el +++ b/isa/thy-mode.el @@ -389,20 +389,23 @@ Choice based on first name found by: :type 'string :group 'isabelle) -(defun thy-find-other-file () - "Find associated .ML or .thy file." - (interactive) +(defun thy-find-other-file (&optional samewindow) + "Find associated .ML or .thy file. +If SAMEWINDOW is non-nil (prefix argument when called interactively), +use find-file instead of find-file-other-window." + (interactive "p") (and (buffer-file-name) (let* ((fname (buffer-file-name)) (thyfile (string-match "\\.thy$" fname)) (mlfile (string-match (concat (regexp-quote isa-ml-file-extension) "$") fname)) - (basename (file-name-sans-extension fname))) + (basename (file-name-sans-extension fname)) + (findfn (if samewindow 'find-file else 'find-file-other-window))) (cond (thyfile - (find-file-other-window (concat basename isa-ml-file-extension))) + (funcall findfn (concat basename isa-ml-file-extension))) (mlfile - (find-file-other-window (concat basename ".thy"))))))) + (funcall findfn (concat basename ".thy"))))))) ;;; "minor" sml-mode inside theory files ========== -- cgit v1.2.3