Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24120ec3c6 | ||
|
|
a67b1b240c |
4 changed files with 79 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/emacs-blacken-1874018.tar.gz
|
||||
/emacs-blacken-784da60.tar.gz
|
||||
16
blacken-init.el
Normal file
16
blacken-init.el
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(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.
|
||||
|
||||
If called interactively, enable Blacken mode if ARG is positive,
|
||||
and disable it if ARG is zero or negative. If called from Lisp,
|
||||
also enable the mode if ARG is omitted or nil, and toggle it if
|
||||
ARG is `toggle'; disable the mode otherwise.
|
||||
|
||||
\(fn &optional ARG)" t nil)
|
||||
60
emacs-blacken.spec
Normal file
60
emacs-blacken.spec
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
%global pkg blacken
|
||||
|
||||
%global commit 784da60033fe3743336d1da0f33239f1bf514266
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global commitdate 20200626
|
||||
|
||||
Name: emacs-%{pkg}
|
||||
Version: 0
|
||||
Release: 0.2.%{commitdate}git%{shortcommit}%{?dist}
|
||||
Summary: Python Black for Emacs
|
||||
|
||||
License: GPLv3+
|
||||
URL: https://github.com/pythonic-emacs/%{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
|
||||
%doc README.md
|
||||
%{_emacs_sitelispdir}/%{pkg}/
|
||||
%{_emacs_sitestartdir}/*.el
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Sep 01 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 0-0.2.20200626git784da60
|
||||
- Switch to new upstream
|
||||
- Update to latest snapshot
|
||||
|
||||
* 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-784da60.tar.gz) = 6d921edadbb930078b32f807ae4790787b28ebe3febd7fd1f559a79866239f02cc26359b0227fa7490033b6b1eed64e3337f7e8a332e287b3449ac4f32b76c9d
|
||||
Loading…
Add table
Add a link
Reference in a new issue