diff options
| author | Juri Linkov | 2019-10-15 22:44:10 +0300 |
|---|---|---|
| committer | Juri Linkov | 2019-10-15 22:44:10 +0300 |
| commit | ffa90546980c71fc0c2355005b382f07405aeeec (patch) | |
| tree | 8d73be099f1fe37f89d89fe5059c95e7995ff92e | |
| parent | 4509aaa5b0666a120fb1e255d52d83d03c46c596 (diff) | |
| download | emacs-ffa90546980c71fc0c2355005b382f07405aeeec.tar.gz emacs-ffa90546980c71fc0c2355005b382f07405aeeec.zip | |
Don't use expand-file-name to find images for tabs.
* lisp/tab-bar.el (tab-bar-mode):
* lisp/tab-line.el (tab-line-new-button, tab-line-close-button):
Remove expand-file-name with data-directory.
| -rw-r--r-- | lisp/tab-bar.el | 28 | ||||
| -rw-r--r-- | lisp/tab-line.el | 8 |
2 files changed, 14 insertions, 22 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 3fe750908b5..13829efe94c 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -102,25 +102,21 @@ | |||
| 102 | 102 | ||
| 103 | (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-new-button))) | 103 | (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-new-button))) |
| 104 | ;; This file is pre-loaded so only here we can use the right data-directory: | 104 | ;; This file is pre-loaded so only here we can use the right data-directory: |
| 105 | (let ((file (expand-file-name "images/tabs/new.xpm" data-directory))) | 105 | (add-text-properties 0 (length tab-bar-new-button) |
| 106 | (when (file-exists-p file) | 106 | `(display (image :type xpm |
| 107 | (add-text-properties 0 (length tab-bar-new-button) | 107 | :file "tabs/new.xpm" |
| 108 | `(display (image :type xpm | 108 | :margin (2 . 0) |
| 109 | :file ,file | 109 | :ascent center)) |
| 110 | :margin (2 . 0) | 110 | tab-bar-new-button)) |
| 111 | :ascent center)) | ||
| 112 | tab-bar-new-button)))) | ||
| 113 | 111 | ||
| 114 | (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-close-button))) | 112 | (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-close-button))) |
| 115 | ;; This file is pre-loaded so only here we can use the right data-directory: | 113 | ;; This file is pre-loaded so only here we can use the right data-directory: |
| 116 | (let ((file (expand-file-name "images/tabs/close.xpm" data-directory))) | 114 | (add-text-properties 0 (length tab-bar-close-button) |
| 117 | (when (file-exists-p file) | 115 | `(display (image :type xpm |
| 118 | (add-text-properties 0 (length tab-bar-close-button) | 116 | :file "tabs/close.xpm" |
| 119 | `(display (image :type xpm | 117 | :margin (2 . 0) |
| 120 | :file ,file | 118 | :ascent center)) |
| 121 | :margin (2 . 0) | 119 | tab-bar-close-button)) |
| 122 | :ascent center)) | ||
| 123 | tab-bar-close-button)))) | ||
| 124 | 120 | ||
| 125 | (when tab-bar-mode | 121 | (when tab-bar-mode |
| 126 | (global-set-key [(control shift iso-lefttab)] 'tab-previous) | 122 | (global-set-key [(control shift iso-lefttab)] 'tab-previous) |
diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 4397cae255f..5f2dd3e6dd0 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el | |||
| @@ -130,9 +130,7 @@ If nil, don't show the new tab button." | |||
| 130 | (defvar tab-line-new-button | 130 | (defvar tab-line-new-button |
| 131 | (propertize " + " | 131 | (propertize " + " |
| 132 | 'display `(image :type xpm | 132 | 'display `(image :type xpm |
| 133 | :file ,(expand-file-name | 133 | :file "tabs/new.xpm" |
| 134 | "images/tabs/new.xpm" | ||
| 135 | data-directory) | ||
| 136 | :margin (2 . 0) | 134 | :margin (2 . 0) |
| 137 | :ascent center) | 135 | :ascent center) |
| 138 | 'keymap tab-line-add-map | 136 | 'keymap tab-line-add-map |
| @@ -160,9 +158,7 @@ If nil, don't show it at all." | |||
| 160 | (defvar tab-line-close-button | 158 | (defvar tab-line-close-button |
| 161 | (propertize " x" | 159 | (propertize " x" |
| 162 | 'display `(image :type xpm | 160 | 'display `(image :type xpm |
| 163 | :file ,(expand-file-name | 161 | :file "tabs/close.xpm" |
| 164 | "images/tabs/close.xpm" | ||
| 165 | data-directory) | ||
| 166 | :margin (2 . 0) | 162 | :margin (2 . 0) |
| 167 | :ascent center) | 163 | :ascent center) |
| 168 | 'keymap tab-line-tab-close-map | 164 | 'keymap tab-line-tab-close-map |