Skip to content

Commit

Permalink
Merge pull request #59 from lassik/patches
Browse files Browse the repository at this point in the history
Patches
  • Loading branch information
housel authored Mar 29, 2021
2 parents c51cdb2 + bd27341 commit 040c8eb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dime-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ This is automatically synchronized from Dylan.")
(setq font-lock-defaults nil)
(setq mode-name "REPL")
(setq dime-current-thread :repl-thread)
(setq dime-write-string-function 'dime-repl-write-string)
(set (make-local-variable 'scroll-conservatively) 20)
(set (make-local-variable 'scroll-margin) 0)
(when dime-repl-history-file
Expand Down Expand Up @@ -1486,6 +1485,7 @@ expansion will be added to the REPL's history.)"
(remove-hook 'dime-connected-hook 'dime-repl-connected-hook-function))

(setq dime-output-target-to-marker-function 'dime-repl-target-to-marker)
(setq dime-write-string-function 'dime-repl-write-string)
(add-hook 'dime-repl-mode-hook 'dime-repl-add-easy-menu)
(add-hook 'dime-sync-project-and-directory-hook
'dime-repl-sync-project-and-directory)
Expand Down
29 changes: 14 additions & 15 deletions dime.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,25 @@

;;; Commentary:

;; This file contains extensions for programming in Open Dylan.
;; The main features are:
;; Dime is the Dylan interaction mode for Emacs. It is essentially an
;; IDE (integrated development environment) for the Dylan programming
;; language and the Open Dylan toolchain.

;; * A socket-based communication/RPC interface between Emacs and
;; Dylan, enabling introspection and remote development.
;; The main features are:

;; * The `dime-mode' minor-mode complementing `dylan-mode'. This new
;; mode includes many commands for interacting with the Open Dylan
;; process.
;; * The `dime-mode' minor-mode. It augments `dylan-mode' with many
;; commands for interacting with Open Dylan.

;; * A Dylan debugger written in Emacs Lisp. The debugger pops up
;; an Emacs buffer similar to the Emacs/Elisp debugger.
;; * The ability to display compiler messages directly at their source
;; code locations.

;; * A Open Dylan inspector to interactively look at run-time data.
;; * A debugger running in Emacs, similar to the Emacs Lisp debugger.

;; * Trapping compiler messages and creating annotations in the source
;; file on the appropriate forms.
;; * An inspector to interactively look at run-time data.

;; In order to run Dime, a supporting Dylan server called Swank is
;; required.
;; Dime works by opening a socket between Emacs and Open Dylan and
;; communicating via the dswank protocol. Dime traces its history back
;; to SLIME (the Superior Lisp Interaction Mode for Emacs).

;;; Code:

Expand Down Expand Up @@ -5407,7 +5406,7 @@ This is 0 if START and END at the same line."
(- (count-lines start end)
(if (save-excursion (goto-char end) (bolp)) 0 1)))

(defvar-local dime-write-string-function nil)
(defvar dime-write-string-function nil)

(defun dime-write-string (string &optional target)
"Insert STRING in the REPL buffer or some other TARGET.
Expand Down
17 changes: 9 additions & 8 deletions dylan-opt.el
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,22 @@ can be used to toggle the optimization highlighting on and off."

(defun dylan-opt--default-file-name ()
"Guess a default optimization file to match the current buffer."
(let* ((path (buffer-file-name))
(name (file-name-nondirectory path))
(stem (substring name 0 (string-match "\\.[^.]*$" name)))
(library dylan-buffer-library))
(expand-file-name
(concat (or (getenv "OPEN_DYLAN_USER_ROOT") "_build")
"/build/" library "/" stem ".el"))))
(and (buffer-file-name)
(let* ((path (buffer-file-name))
(name (file-name-nondirectory path))
(stem (substring name 0 (string-match "\\.[^.]*$" name)))
(library dylan-buffer-library))
(expand-file-name
(concat (or (getenv "OPEN_DYLAN_USER_ROOT") "_build")
"/build/" library "/" stem ".el")))))

;;;###autoload
(defun dylan-opt (opt-file)
"Show Dylan optimization faces according to OPT-FILE.
See the command `dylan-opt-mode', which this command enables."
(interactive
(list (let ((default (dylan-opt--default-file-name)))
(list (let ((default (or (dylan-opt--default-file-name) "")))
(read-file-name
"Dylan optimization file: "
(file-name-directory default) nil t
Expand Down
12 changes: 8 additions & 4 deletions dylan.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@

;;; Commentary:

;; Dylan mode is a major mode for editing Dylan programs. It provides
;; indenting and syntax highlighting support.
;; This package provides three Emacs modes for the Dylan programming
;; language:

;; * The `dylan-mode` major mode to edit Dylan code.
;; * The `dylan-opt-mode` minor mode to show compiler optimizations.
;; * The `dylan-lid-mode` major mode to edit LID files.

;;; Code:

;; Testing
;;
Expand All @@ -41,8 +47,6 @@
;; their values, frequently the easiest way to test changes is to start a new
;; Emacs.

;;; Code:

;;; Customization:

(defgroup dylan nil
Expand Down

0 comments on commit 040c8eb

Please sign in to comment.