This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+spacemacs/spacemacs-visual/funcs.el
Abdo Roig-Maranges f216309a6c visual: improve colorization of compilation buffer
Lines containing a carriage return alone, followed by color escape
sequences, are not colorized properly.

A carriage return in the compilation buffer is interpreted by erasing
contents since the beginning of the line, but compilation-filter-start
is not updated accordingly before calling the filter-hooks.

Workaround it by always colorizing a region from to the beginning of the
line where compilation-filter-start points.
2017-04-17 22:30:56 -04:00

69 lines
2.1 KiB
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; funcs.el --- Spacemacs UI Layer functions File
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; ansi-colors
(defun spacemacs-visual//compilation-buffer-apply-ansi-colors ()
(let ((inhibit-read-only t))
(goto-char compilation-filter-start)
(ansi-color-apply-on-region (line-beginning-position) (point-max))))
;; popwin
(defun spacemacs/remove-popwin-display-config (str)
"Removes the popwin display configurations that matches the passed STR"
(setq popwin:special-display-config
(-remove (lambda (x) (if (and (listp x) (stringp (car x)))
(string-match str (car x))))
popwin:special-display-config)))
;; zoom
(defun spacemacs//zoom-frm-powerline-reset ()
(when (fboundp 'powerline-reset)
(setq-default powerline-height (spacemacs/compute-powerline-height))
(powerline-reset)))
(defun spacemacs//zoom-frm-do (arg)
"Perform a zoom action depending on ARG value."
(let ((zoom-action (cond ((eq arg 0) 'zoom-frm-unzoom)
((< arg 0) 'zoom-frm-out)
((> arg 0) 'zoom-frm-in)))
(fm (cdr (assoc 'fullscreen (frame-parameters))))
(fwp (* (frame-char-width) (frame-width)))
(fhp (* (frame-char-height) (frame-height))))
(when (equal fm 'maximized)
(toggle-frame-maximized))
(funcall zoom-action)
(set-frame-size nil fwp fhp t)
(when (equal fm 'maximized)
(toggle-frame-maximized))))
(defun spacemacs/zoom-frm-in ()
"zoom in frame, but keep the same pixel size"
(interactive)
(spacemacs//zoom-frm-do 1)
(spacemacs//zoom-frm-powerline-reset))
(defun spacemacs/zoom-frm-out ()
"zoom out frame, but keep the same pixel size"
(interactive)
(spacemacs//zoom-frm-do -1)
(spacemacs//zoom-frm-powerline-reset))
(defun spacemacs/zoom-frm-unzoom ()
"Unzoom current frame, keeping the same pixel size"
(interactive)
(spacemacs//zoom-frm-do 0)
(spacemacs//zoom-frm-powerline-reset))