summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el56
1 files changed, 8 insertions, 48 deletions
diff --git a/init.el b/init.el index 3e5210e..aa2039e 100644 --- a/init.el +++ b/init.el
@@ -302,63 +302,23 @@
302;;; Mode line 302;;; Mode line
303 303
304;; Minions 304;; Minions
305(acdw/pkg minions 305(acdw/pkg minions)
306 :now ((minions-mode +1)))
307 306
308;; Simple mode line 307;; Simple mode line
309(acdw/pkg simple-modeline 308(acdw/pkg simple-modeline
310 :set '((simple-modeline-segments 309 :set '((simple-modeline-segments
311 ((;; left 310 ((;; left
312 acdw/modeline-modified 311 acdw-modeline/modified
313 simple-modeline-segment-buffer-name 312 acdw-modeline/buffer-name
314 simple-modeline-segment-position) 313 simple-modeline-segment-position
314 simple-modeline-segment-word-count)
315 (;; right 315 (;; right
316 simple-modeline-segment-vc 316 acdw-modeline/vc-branch
317 simple-modeline-segment-misc-info 317 simple-modeline-segment-misc-info
318 simple-modeline-segment-process 318 simple-modeline-segment-process
319 acdw/modeline-minions 319 acdw-modeline/minions
320 simple-modeline-segment-major-mode)))) 320 simple-modeline-segment-major-mode))))
321 :now ((defun acdw/modeline-modified () 321 :now ((require 'acdw-modeline)
322 "Displays a color-coded buffer modification/read-only
323indicator in the mode-line."
324 (if (not (string-match-p "\\*.*\\*" (buffer-name)))
325 (let* ((read-only (and buffer-read-only (buffer-file-name)))
326 (modified (buffer-modified-p)))
327 (propertize
328 (if read-only " ×" (if modified " ●" " ○"))
329 'face `(:inherit
330 ,(if modified 'simple-modeline-status-modified
331 (if read-only 'simple-modeline-status-error
332 'simple-modeline-unimportant)))
333 'help-echo (format
334 (concat "Buffer is %s and %smodified\n"
335 "mouse-1: Toggle read-only status.")
336 (if read-only "read-only" "writable")
337 (if modified "" "not "))
338 'local-map (purecopy (simple-modeline-make-mouse-map
339 'mouse-1
340 (lambda (event)
341 (interactive "e")
342 (with-selected-window
343 (posn-window (event-start event))
344 (read-only-mode 'toggle)))))
345 'mouse-face 'mode-line-highlight))))
346 (defun acdw/modeline-minions ()
347 "Display a button for `minions-minor-modes-menu'."
348 (concat
349 " "
350 (propertize
351 "ⱷ"
352 'help-echo (format
353 "Minor modes menu\nmouse-1: show menu.")
354 'local-map (purecopy (simple-modeline-make-mouse-map
355 'mouse-1
356 (lambda (event)
357 (interactive "e")
358 (with-selected-window (posn-window
359 (event-start event))
360 (minions-minor-modes-menu)))))
361 'mouse-face 'mode-line-highlight)))
362 (simple-modeline-mode +1))) 322 (simple-modeline-mode +1)))
363 323
364;;; Magit 324;;; Magit