Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

+Added alternative settings for better display in TTY displays.

git-svn-id: file:///opt/svn/emacs-tools/trunk@284 2ccc84cd-862f-49ff-a359-c231f00e8bd0
  • Loading branch information...
commit 688099a9fa68e0bad9e411abcd1d36313d38a481 1 parent 0db36b4
@escherdragon authored
Showing with 64 additions and 34 deletions.
  1. +23 −16 sunrise-commander.el
  2. +27 −15 sunrise-x-modeline.el
  3. +14 −3 sunrise-x-tabs.el
View
39 sunrise-commander.el
@@ -404,32 +404,39 @@
"Trivial alist used by the Sunrise Commander to lookup its own passive side.")
(defface sr-active-path-face
- '((t (:background "#ace6ac" :foreground "yellow" :bold t :height 120)))
+ '((((type tty) (class color) (min-colors 8))
+ :background "green" :foreground "yellow" :bold t)
+ (((type tty) (class mono)) :inverse-video t)
+ (t :background "#ace6ac" :foreground "yellow" :bold t :height 120))
"Face of the directory path in the active pane"
:group 'sunrise)
(defface sr-passive-path-face
- '((t (:background "white" :foreground "lightgray" :bold t :height 120)))
+ '((((type tty) (class color) (min-colors 8) (background dark))
+ :background "black" :foreground "cyan")
+ (((type tty) (class color) (min-colors 8) (background light))
+ :background "white" :foreground "cyan")
+ (t :background "white" :foreground "lightgray" :bold t :height 120))
"Face of the directory path in the passive pane"
:group 'sunrise)
(defface sr-editing-path-face
- '((t (:background "red" :foreground "yellow" :bold t :height 120)))
+ '((t :background "red" :foreground "yellow" :bold t :height 120))
"Face of the directory path in the active pane while in editable pane mode"
:group 'sunrise)
(defface sr-highlight-path-face
- '((t (:background "yellow" :foreground "#ace6ac" :bold t :height 120)))
+ '((t :background "yellow" :foreground "#ace6ac" :bold t :height 120))
"Face of the directory path on mouse hover"
:group 'sunrise)
(defface sr-broken-link-face
- '((t (:foreground "red" :italic t)))
+ '((t :foreground "red" :italic t))
"Face to highlight broken symbolic links"
:group 'sunrise)
(defface sr-clex-hotchar-face
- '((t (:foreground "red" :bold t)))
+ '((t :foreground "red" :bold t))
"Face of the hot character (%) in CLEX mode. Indicates that a CLEX
substitution may be about to happen."
:group 'sunrise)
@@ -899,16 +906,14 @@ automatically:
(sr-advertised-find-file)))
(define-key sr-mode-map [follow-link] 'mouse-face)
-(if window-system
- (progn
- (define-key sr-mode-map [(control >)] 'sr-checkpoint-save)
- (define-key sr-mode-map [(control .)] 'sr-checkpoint-restore)
- (define-key sr-mode-map [(control tab)] 'sr-select-viewer-window)
- (define-key sr-mode-map [(control backspace)] 'sr-toggle-attributes)
- (define-key sr-mode-map [(control ?\=)] 'sr-ediff)
- (define-key sr-mode-map [(control meta ?\=)] 'sr-compare-panes)
- (define-key sr-mode-map [(control })] 'sr-max-lock-panes)
- (define-key sr-mode-map [(control {)] 'sr-min-lock-panes)))
+(define-key sr-mode-map [(control >)] 'sr-checkpoint-save)
+(define-key sr-mode-map [(control .)] 'sr-checkpoint-restore)
+(define-key sr-mode-map [(control tab)] 'sr-select-viewer-window)
+(define-key sr-mode-map [(control backspace)] 'sr-toggle-attributes)
+(define-key sr-mode-map [(control ?\=)] 'sr-ediff)
+(define-key sr-mode-map [(control meta ?\=)] 'sr-compare-panes)
+(define-key sr-mode-map [(control })] 'sr-max-lock-panes)
+(define-key sr-mode-map [(control {)] 'sr-min-lock-panes)
(defun sunrise-mc-keys ()
"Binds the function keys F2 to F10 the traditional MC way."
@@ -1733,12 +1738,14 @@ automatically:
(interactive)
(if (buffer-live-p sr-backup-buffer)
(let ((marks (dired-remember-marks (point-min) (point-max)))
+ (focus (dired-get-filename 'verbatim t))
(inhibit-read-only t))
(erase-buffer)
(insert-buffer-substring sr-backup-buffer)
(sr-beginning-of-buffer)
(dired-mark-remembered marks)
(sr-highlight)
+ (sr-focus-filename focus)
(if (eq 'sr-mode major-mode) (sr-kill-backup-buffer)))
(sr-save-aspect (revert-buffer))))
View
42 sunrise-x-modeline.el
@@ -55,10 +55,15 @@
(require 'easymenu)
(eval-when-compile (require 'cl))
-(defconst sr-modeline-norm-mark "") ;; *
-(defconst sr-modeline-sync-mark "") ;; &
-(defconst sr-modeline-edit-mark "") ;; !
-(defconst sr-modeline-virt-mark "") ;; @
+(defcustom sr-modeline-use-utf8-marks nil
+ ""
+ :group 'sunrise
+ :type 'boolean)
+
+(defconst sr-modeline-norm-mark '(" * " . ""))
+(defconst sr-modeline-sync-mark '(" & " . ""))
+(defconst sr-modeline-edit-mark '(" ! " . ""))
+(defconst sr-modeline-virt-mark '(" @ " . ""))
;;; ============================================================================
;;; Core functions:
@@ -71,19 +76,26 @@
(define-key sr-modeline-path-map [mode-line mouse-1] 'sr-modeline-navigate-path)
(define-key sr-modeline-path-map [mode-line mouse-2] 'sr-modeline-navigate-path)
+(defun sr-modeline-select-mark (mode)
+ ""
+ (let ((select (if sr-modeline-use-utf8-marks #'cdr #'car)))
+ (funcall select
+ (cond ((eq mode 'sync) sr-modeline-sync-mark)
+ ((eq mode 'edit) sr-modeline-edit-mark)
+ ((eq mode 'virt) sr-modeline-virt-mark)
+ (t sr-modeline-norm-mark)))))
+
(defun sr-modeline-setup ()
"Determines the mode indicator (icon) to display in the mode line. On success
sets the mode line format by calling sr-modeline-set."
(let ((mark nil))
(cond ((eq major-mode 'sr-mode)
- (cond ((not buffer-read-only)
- (setq mark sr-modeline-edit-mark))
- (sr-synchronized
- (setq mark sr-modeline-sync-mark))
- (t
- (setq mark sr-modeline-norm-mark))))
+ (setq mark (sr-modeline-select-mark
+ (cond ((not buffer-read-only) 'edit)
+ (sr-synchronized 'sync)
+ (t 'norm)))))
((eq major-mode 'sr-virtual-mode)
- (setq mark sr-modeline-virt-mark)))
+ (setq mark (sr-modeline-select-mark 'virt))))
(if mark (sr-modeline-set mark))))
(defun sr-modeline-set (mark)
@@ -104,9 +116,9 @@
mode indicator."
(let ((mode-name ""))
(setq mode-name
- (cond ((eq mark sr-modeline-sync-mark) "Synchronized Navigation")
- ((eq mark sr-modeline-edit-mark) "Editable Pane")
- ((eq mark sr-modeline-virt-mark) "Virtual Directory")
+ (cond ((eq mark (sr-modeline-select-mark 'sync)) "Synchronized Navigation")
+ ((eq mark (sr-modeline-select-mark 'edit)) "Editable Pane")
+ ((eq mark (sr-modeline-select-mark 'virt)) "Virtual Directory")
(t "Normal")))
(propertize mark
'font 'bold
@@ -179,7 +191,7 @@
To totally disable this extension do: M-x sr-modeline <RET>"
- nil sr-modeline-norm-mark sr-modeline-map
+ nil (sr-modeline-select-mark 'norm) sr-modeline-map
(unless (memq major-mode '(sr-mode sr-virtual-mode))
(setq sr-modeline nil)
(error "Sorry, this mode can be used only within the Sunrise Commander."))
View
17 sunrise-x-tabs.el
@@ -90,17 +90,28 @@
:type 'boolean)
(defcustom sr-tabs-max-tabsize 10
- "Maximum length of tabs in the Sunrise Commander FM."
+ "Maximum length of a tab in the Sunrise Commander FM."
:group 'sunrise
:type 'integer)
(defface sr-tabs-active-face
- '((t (:inherit variable-pitch :bold t :background "white" :height 0.9)))
+ '((((type tty) (class color) (min-colors 88))
+ :background "white")
+ (((type tty) (class color) (min-colors 8))
+ :background "green" :foreground "yellow" :bold t)
+ (((type tty) (class mono)) :inverse-video t)
+ (t
+ :inherit variable-pitch :bold t :background "white" :height 0.9))
"Face of the currently selected tab in any of the Sunrise panes."
:group 'sunrise)
(defface sr-tabs-inactive-face
- '((t (:inherit variable-pitch :background "gray95" :height 0.9)))
+ '((((type tty) (class color) (min-colors 88))
+ :background "color-84" :foreground "white")
+ (((type tty) (class color) (min-colors 8))
+ :background "white" :foreground "cyan")
+ (t
+ :inherit variable-pitch :background "gray95" :height 0.9))
"Face of all non-selected tabs in both Sunrise panes."
:group 'sunrise)
Please sign in to comment.
Something went wrong with that request. Please try again.