Skip to content

Commit

Permalink
Ensure buffer file name
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed May 23, 2022
1 parent b2ec324 commit 25c3cd0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions javap-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,28 @@
(new-b-name (concat "*javap " b-name ".class" "*"))
(new-buf (get-buffer new-b-name))
(old-buf (buffer-name))
(done (lambda (&rest args)
(done (lambda (&rest _)
(interactive)
(progn
(kill-buffer (current-buffer))
(kill-buffer old-buf)))))
(progn
(if new-buf
(if new-buf
(switch-to-buffer new-buf)
(let ((new-buf (get-buffer-create new-b-name)))
(progn
(switch-to-buffer new-buf)
(let ((new-buf (get-buffer-create new-b-name)))
(progn
(switch-to-buffer new-buf)
(call-process "javap" nil new-buf nil "-c" "-l" "-classpath" "." b-name)
;; (call-process "javap" nil new-buf nil "-c" "-l" "-package" "-protected" "-private" "-classpath" "." b-name)
(setq buffer-read-only 't)
(set-window-point (selected-window) 0))))
(javap-mode)
(local-set-key [(q)] done))))
(call-process "javap" nil new-buf nil "-c" "-l" "-classpath" "." b-name)
;; (call-process "javap" nil new-buf nil "-c" "-l" "-package" "-protected" "-private" "-classpath" "." b-name)
(setq buffer-read-only 't)
(set-window-point (selected-window) 0))))
(javap-mode)
(local-set-key [(q)] done)))

;;;###autoload
(add-hook 'find-file-hook
(lambda (&rest args)
(when (string= ".class" (substring (buffer-file-name) -6 nil))
(lambda (&rest _)
(when (and (buffer-file-name)
(string= ".class" (substring (buffer-file-name) -6 nil)))
(javap-buffer))))

(provide 'javap-mode)
Expand Down

0 comments on commit 25c3cd0

Please sign in to comment.