Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. Debugger entered--Lisp error: (wrong-type-argument characterp (switch-frame #<frame perf_log.1 0x2b7af490>))
  2. char-to-string((switch-frame #<frame perf_log.1 0x2b7af490>))
  3. eshell-self-insert-command()
  4. call-interactively(eshell-self-insert-command nil nil)
  5. command-execute(eshell-self-insert-command)
  6.  
  7. (defun eshell-self-insert-command ()
  8. (interactive)
  9. (process-send-string
  10. (eshell-interactive-process)
  11. (char-to-string (if (symbolp last-command-event)
  12. (get last-command-event 'ascii-character)
  13. last-command-event))))
  14.  
  15. (defun md-get-window-glyph (w)
  16. (let* ((fp (frame-parameters (window-frame w)))
  17. (frame-top (cdr (assoc 'top fp)))
  18. (frame-left (cdr (assoc 'left fp)))
  19. (window-top (window-top-line w))
  20. (window-left (window-left-column w))
  21. (hash (md5 (format "%S %S %S %S" frame-top frame-left window-top window-left)))
  22. (glyph (nth (% (string-to-number (substring hash 0 2) 16) (length md-glyphs)) md-glyphs)))
  23. (char-to-string glyph)))
  24.  
  25. (setq-default mode-line-format
  26. (append
  27. (list '(:eval (propertize (format "[%s] " (md-get-window-glyph (get-buffer-window))) 'face 'font-lock-constant-face)))
  28. mode-line-format))
  29.  
  30. (defun md-select-window-with-glyph (chosen-glyph)
  31. (interactive "cWindow glyph: ")
  32. (dolist (f (frame-list))
  33. (dolist (w (window-list f 0))
  34. (ignore-errors
  35. (when (equal (downcase (md-get-window-glyph w)) (downcase (char-to-string chosen-glyph)))
  36. (select-frame-set-input-focus f)
  37. (select-window w))))))
  38.  
  39. (global-set-key (kbd "M-d") #'md-select-window-with-glyph)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement