Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3180db6344 |
4 changed files with 68 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/emacs-blacken-1874018.tar.gz
|
||||
11
blacken-init.el
Normal file
11
blacken-init.el
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(autoload 'blacken-buffer "blacken" "\
|
||||
Try to blacken the current buffer.
|
||||
|
||||
Show black output, if black exit abnormally and DISPLAY is t.
|
||||
|
||||
\(fn &optional DISPLAY)" t nil)
|
||||
|
||||
(autoload 'blacken-mode "blacken" "\
|
||||
Automatically run black before saving.
|
||||
|
||||
\(fn &optional ARG)" t nil)
|
||||
55
emacs-blacken.spec
Normal file
55
emacs-blacken.spec
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
%global pkg blacken
|
||||
|
||||
%global commit 1874018ae242176d0780cdcd0109e8f9a123a914
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global commitdate 20190521
|
||||
|
||||
Name: emacs-%{pkg}
|
||||
Version: 0
|
||||
Release: 0.1.%{commitdate}git%{shortcommit}%{?dist}
|
||||
Summary: Python Black for Emacs
|
||||
|
||||
License: GPLv3+
|
||||
URL: https://github.com/proofit404/%{pkg}
|
||||
Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||
Source1: %{pkg}-init.el
|
||||
|
||||
BuildRequires: emacs
|
||||
Requires: emacs(bin) >= %{_emacs_version}
|
||||
Requires: python3-black
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
Blacken uses black to format a Python buffer. It can be called explicitly on a
|
||||
certain buffer, but more conveniently, a minor-mode 'blacken-mode' is provided
|
||||
that turns on automatically running black on a buffer before saving.
|
||||
|
||||
To automatically format all Python buffers before saving, add the function
|
||||
blacken-mode to python-mode-hook:
|
||||
|
||||
(add-hook 'python-mode-hook 'blacken-mode)
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n %{pkg}-%{commit}
|
||||
|
||||
|
||||
%build
|
||||
%{_emacs_bytecompile} %{pkg}.el
|
||||
|
||||
|
||||
%install
|
||||
install -dm 0755 $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{pkg}/
|
||||
install -pm 0644 %{pkg}.el* -t $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{pkg}/
|
||||
|
||||
install -Dpm 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_emacs_sitestartdir}/%{pkg}-init.el
|
||||
|
||||
|
||||
%files
|
||||
%{_emacs_sitelispdir}/%{pkg}/
|
||||
%{_emacs_sitestartdir}/*.el
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Sep 02 2019 Mohamed El Morabity <melmorabity@fedoraproject.org> - 0-0.1.20190521git1874018
|
||||
- Initial RPM release
|
||||
1
sources
Normal file
1
sources
Normal file
|
|
@ -0,0 +1 @@
|
|||
SHA512 (emacs-blacken-1874018.tar.gz) = c5446cd103d5855b2c12ce0120adf6a43c03bf1c6636a8120f15357117b97ebc82df03dcfc492d353235fdf7bf1c90db30937cdf0c45b64681eebf365790c77d
|
||||
Loading…
Add table
Add a link
Reference in a new issue