Create more than one eshell instance in emacs
문제
Think: tiling my emacs window with eshells, a la xmonad. Is this possible? I can M-x eshell to open the first eshell instance but future invocations just focus the first instance.
해결책
You can do this:
`C-u M-x eshell`
This will create *eshell*
, *eshell*<2>
, and so on.
다른 팁
My preferred approach is to create named shells:
(defun make-shell (name)
"Create a shell buffer named NAME."
(interactive "sName: ")
(setq name (concat "$" name))
(eshell)
(rename-buffer name))
is the gist. Then M-x make-shell name
will create the desired shell.
로그에서 오류를 찾을 수 있습니다 (Tomcat을 사용하여 가정)
- 서버가 켜짐 : LifeRayFolder / TomcatFolder / logs / catalina.out
- 서버가 꺼져있을 때 : liferayfolder / logs / liferay- 2012-03-11 .log (날짜 변경)
Linux 또는 Mac OS에있는 경우 Logfile을 꼬리를 꼬리가 입력하십시오.
예 :
tail -f path\to\tomcat\logs\catalina.out
더 많은 정보가 제공 될 때까지 책 예제 비교하십시오.(자원> 다운로드> 코드 예제)
C-u M-x eshell works great, but I prefer named shells - make-shell approach, is useful when switching buffers
Invoking GNU Screen is another option for those using ansi-term
Mybe, the following solution is better. Because the eshell buffer is determined by the value of eshell-buffer-name. You need not to rename the buffer.
(defun buffer-exists (bufname)
(not (eq nil (get-buffer bufname))))
(defun make-shell (name)
"Create a shell buffer named NAME."
(interactive "sName: ")
(if (buffer-exists "*eshell*")
(setq eshell-buffer-name name)
(message "eshell doesnot exists, use the default name: *eshell*"))
(eshell))
Expanding on make-eshell, this creates an eshell appending the next counter, so it's like eshell1, eshell2, etc.:
(lexical-let ((count 1))
(defun make-eshell-next-number ()
(interactive)
(eshell)
(rename-buffer (concat "*eshell" (number-to-string count) "*"))
(setq count (1+ count))))