Skip to content

Commit

Permalink
Prepare topspace for inclusion in GNU ELPA
Browse files Browse the repository at this point in the history
Other changes not related to preparing for GNU ELPA:
- Add comment to `topspace--post-command` for clarification
- Change CI name from Test to CI and test.yml to ci.yml
  • Loading branch information
trevorpogue committed May 13, 2022
1 parent 86127bf commit e1c7973
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 99 deletions.
7 changes: 7 additions & 0 deletions .elpaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.github
.gitignore
test
company-tests.el
Cask
CONTRIBUTING.md
HISTORY.md
4 changes: 2 additions & 2 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: CI

on: [ push, pull_request ]
jobs:
Expand All @@ -18,7 +18,7 @@ jobs:
version: ${{ matrix.emacs_version }}
- uses: conao3/setup-cask@master
- uses: actions/checkout@v2
- name: Test
- name: CI
env:
COVERALLS_FLAG_NAME: Emacs ${{ matrix.emacs_version }}
COVERALLS_PARALLEL: 1
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/changelog.yml → .github/workflows/news.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Changelog
name: News
on:
push:
branches:
- main
- '*'
release:
types:
- created
Expand All @@ -13,17 +13,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: "✏️ Generate changelog"
- name: "✏️ Generate news"
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: v0.1.2
headerLabel: # History of user-visible changes
output: NEWS.md
base: HISTORY.md
issues: no
# futureRelease: v0.2.1
futureRelease: v0.3.0

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Changelog
file_pattern: CHANGELOG.md
commit_message: Update NEWS.md
file_pattern: NEWS.md
79 changes: 0 additions & 79 deletions CHANGELOG.md

This file was deleted.

21 changes: 19 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,32 @@ Try to follow the following guidelines if you open an issue or pull request:
and description in grammatically correct, complete sentences.

## Running Tests
Check [test.yml][5] to see the latest testing frameworks being used, and the command(s) required to run the tests. When last updating this file, cask and buttercup were being used to run the tests like so:
Check [ci.yml][5] to see all the details for the testing frameworks being used, the Emacs versions being tested, and the command(s) required to run the tests.
TLDR: Cask and buttercup are used for testing and can be run like so:

```
cask install
cask exec buttercup -L .
```

## Copyright Assignment
This package is subject to the same [[https://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html][Copyright Assignment]] policy as
GNU Emacs and all other packages in [[https://elpa.gnu.org/packages/][GNU ELPA]].

Any [[https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html#Legally-Significant][legally significant]] contributions can only be accepted after the
author has completed their paperwork. Please see [[https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future][the request form]] if
you want to proceed with the assignment.

The copyright assignment isn't a big deal, it just says that the
copyright for your submitted changes to Emacs belongs to the FSF.
This assignment works for all projects related to Emacs. To obtain it
you need to:
* Send one email
* Send one letter (if you live in the US, it's digital)
* Wait for some time (recently it's less than a week)

[1]: https://github.com/trevorpogue/topspace/issues
[2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request
[3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[4]: https://help.github.com/articles/using-pull-requests
[5]: https://github.com/trevorpogue/topspace/blob/main/.github/workflows/test.yml
[5]: https://github.com/trevorpogue/topspace/blob/main/.github/workflows/ci.yml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<!-- cursor -->

<p align="center">
<a href="https://github.com/trevorpogue/topspace/actions/workflows/test.yml/"><img src="https://github.com/trevorpogue/topspace/actions/workflows/test.yml/badge.svg" height="20"/></a>
<a href="https://github.com/trevorpogue/topspace/actions/workflows/ci.yml/"><img src="https://github.com/trevorpogue/topspace/actions/workflows/ci.yml/badge.svg" height="20"/></a>
<a href='https://coveralls.io/github/trevorpogue/topspace?branch=main'><img src='https://coveralls.io/repos/github/trevorpogue/topspace/badge.svg?branch=main&1' alt='Coverage Status' /></a>
<a href="https://github.com/trevorpogue/topspace/blob/main/.github/workflows/test.yml"><img src="https://img.shields.io/badge/Emacs-25.1+-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=whit" height="20"/></a>
<a href="https://github.com/trevorpogue/topspace/blob/main/.github/workflows/ci.yml"><img src="https://img.shields.io/badge/Emacs-25.1+-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=whit" height="20"/></a>
<a href="http://melpa.org/#/topspace"><img src="http://melpa.org/packages/topspace-badge.svg" height="20"/></a>
<a href="http://stable.melpa.org/#/topspace"><img src="http://stable.melpa.org/packages/topspace-badge.svg" height="20"/></a>

Expand Down
19 changes: 11 additions & 8 deletions topspace.el
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
;;; topspace.el --- Scroll down & recenter top lines / get upper margins/padding -*- lexical-binding: t -*-

;; Copyright (C) 2021-2022 Trevor Edwin Pogue
;; Copyright (C) 2021-2022 Free Software Foundation, Inc.

;; Author: Trevor Edwin Pogue <trevor.pogue@gmail.com>
;; Maintainer: Trevor Edwin Pogue <trevor.pogue@gmail.com>
;; URL: https://github.com/trevorpogue/topspace
;; Keywords: convenience, scrolling, center, cursor, margin, padding
;; Version: 0.2.1
;; Version: 0.3.0
;; Package-Requires: ((emacs "25.1"))

;; This program is free software: you can redistribute it and/or modify
;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; TopSpace allows you to scroll down and recenter top lines
;; by automatically drawing an upper margin/padding above the top line
;; as you scroll down or recenter top text.
Expand Down Expand Up @@ -59,9 +62,6 @@

;;; Code:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Debugging

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Private variables

Expand Down Expand Up @@ -699,6 +699,9 @@ ARG defaults to 1."
(beginning-of-visual-line)
(setq next-line-point (point)))
(when (and
;; These checks are for improving performance by only running
;; `topspace--count-lines' run by `topspace--total-lines-past-max'
;; when necessary because `topspace--count-lines' is slow
(>= (point) next-line-point)
(< (- (line-number-at-pos (point))
(line-number-at-pos topspace--pre-command-point))
Expand Down

0 comments on commit e1c7973

Please sign in to comment.