Преглед на файлове

add function set-terminal-header

pull/1/head
10sr преди 10 години
родител
ревизия
03a29a3340
променени са 2 файла, в които са добавени 34 реда и са изтрити 1 реда
  1. +32
    -1
      emacs.el
  2. +2
    -0
      shrc

+ 32
- 1
emacs.el Целия файл

@@ -2410,7 +2410,38 @@ this is test, does not rename files."
(yank)
(text-mode)
(current-local-map)
(goto-char (point-min)))))
(goto-char (point-min))
(yank)
(current-buffer))))

(defun set-terminal-header (string)
"Set terminal header STRING."
(let ((point (point))
(movecursor "\033[0;%dH")
(inverse "\033[7m")
(restore "\033[0m")
(cols (frame-parameter nil 'width))
(length (length string)))
(send-string-to-terminal (concat (format movecursor
(1+ (- cols length)))
inverse
string
restore))
(goto-char point)
(redraw-frame (current-frame))))

(run-with-idle-timer
1
t
(lambda ()
(set-terminal-header (concat " "
user-login-name
"@"
(car (split-string system-name
"\\."))
" "
(format-time-string "%Y/%m/%d %T %z")
" "))))

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; savage emacs


+ 2
- 0
shrc Целия файл

@@ -1248,8 +1248,10 @@ __my_set_header_line(){
printf "\033[0;0H"
# clear curent to eol
printf "\033[K"
# inverse color
printf "\033[7m"
printf "$1"
# restore color
printf "\033[0m"
# restore saved position
printf "\033[u"


Зареждане…
Отказ
Запис