Ver a proveniência

add function set-terminal-header

pull/1/head
10sr há 10 anos
ascendente
cometimento
03a29a3340
2 ficheiros alterados com 34 adições e 1 eliminações
  1. +32
    -1
      emacs.el
  2. +2
    -0
      shrc

+ 32
- 1
emacs.el Ver ficheiro

@@ -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 Ver ficheiro

@@ -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"


Carregando…
Cancelar
Guardar