Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Refactor use of buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
buzztaiki committed May 9, 2012
1 parent 12956b5 commit 0ec5462
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/lisp/malabar-reflection.el
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,9 @@

(defun malabar--load-source-from-zip (classname archive buffer-name)
;; TODO: This won't work for inner classes
(let ((file-name (malabar-class-name-to-filename classname))
(buffer (get-buffer buffer-name)))
(or buffer
(save-excursion
(setq buffer (get-buffer-create buffer-name))
(set-buffer buffer)
(let ((file-name (malabar-class-name-to-filename classname)))
(or (get-buffer buffer-name)
(with-current-buffer (get-buffer-create buffer-name)
(setq buffer-file-name (expand-file-name (concat archive ":" file-name)))
(setq buffer-file-truename (file-name-nondirectory file-name))
(let ((exit-code
Expand All @@ -163,9 +160,8 @@
buffer-saved-size (buffer-size)
buffer-read-only t)
(set-buffer-modified-p nil)
buffer)
(set-buffer-modified-p nil)
(kill-buffer buffer)
(current-buffer))
(kill-buffer (current-buffer))
nil))))))

(defun malabar--get-class-info-from-buffer (buffer)
Expand Down

0 comments on commit 0ec5462

Please sign in to comment.