avoid crashing in Gnus Browse Server mode #8

Merged
dickmao merged 6 commits from dev into master 2019-10-13 01:20:22 +00:00
3 changed files with 47 additions and 42 deletions

View File

@ -1,12 +1,19 @@
sudo: false
language: python
dist: trusty
language: nix
addons:
apt:
packages:
- gnutls-bin
- sharutils
- gnupg2
- python-minimal
- python-setuptools
- python-pip
- python3-minimal
- python3-pip
- python3-setuptools
- dirmngr
- libxml2-dev
cache:
@ -26,37 +33,19 @@ env:
matrix:
allow_failures:
- env: EVM_EMACS=emacs-git-snapshot-travis
- env: EMACS_CI=emacs-snapshot
include:
- os: linux
env: EVM_EMACS=emacs-25.1
env: EMACS_CI=emacs-25-1 PY=python PIP="${PY} -m pip install --user"
- os: linux
env: EVM_EMACS=emacs-26.2
env: EMACS_CI=emacs-26-2 PY=python3 PIP="${PY} -m pip install --user"
- os: osx
language: generic
env: EVM_EMACS=emacs-25.2 TOXENV=py27
install:
- cp -pr $HOME/.cask .
- sh tools/install-virtualenv.sh
- |
if [ "x$TRAVIS_OS_NAME" = "xosx" ]; then
eval "$(pyenv init -)"
pyenv activate $TOXENV
fi
env: EMACS_CI=emacs-26-3 PY=python PIP="pip install" TOXENV=py27
before_script:
- sh tools/install-evm.sh
- |
if [ "x$TRAVIS_OS_NAME" = "xosx" ]; then
evm config path $HOME/.evm
else
evm config path /tmp
fi
- evm install $EVM_EMACS --use --skip
- bash <(curl https://raw.githubusercontent.com/purcell/nix-emacs-ci/master/travis-install)
- emacs --version
- sh tools/install-cask.sh
script:
- make test-install
- make test || ( ( printf "To diagnose, travis logs -i | dos2unix | sed '/^begin 644/,/^end/!d' | uudecode\n" ) && ( zip -q - tests/log/* 2>/dev/null | uuencode log.zip ) && false)

View File

@ -461,7 +461,7 @@ If GROUP classification omitted, figure it out."
(deffoo nnhackernews-server-opened (&optional server)
(nnhackernews--normalize-server)
t)
nnhackernews--last-item)
(deffoo nnhackernews-status-message (&optional server)
(nnhackernews--normalize-server)
@ -695,7 +695,9 @@ The two hashtables being reconciled are `nnhackernews-location-hashtb' and
(gnus-info-set-marks
info
(append (assq-delete-all 'seen (gnus-info-marks info))
(list `(seen (1 . ,num-headers)))))
(list `(seen (1 . ,num-headers))))
t)
(gnus-info-set-method info (gnus-group-method gnus-newsgroup-name) t)
(gnus-set-info gnus-newsgroup-name info)))
t))
@ -1142,7 +1144,7 @@ Optionally provide STATIC-MAX-ITEM and STATIC-NEWSTORIES to prevent querying out
(nnheader-insert-nov (nnhackernews--make-header i group)))
'nov)))
(deffoo nnhackernews-close-server (&optional server)
(deffoo nnhackernews-close-server (&optional server _defs)
(nnhackernews--normalize-server)
t)
@ -1163,6 +1165,18 @@ Optionally provide STATIC-MAX-ITEM and STATIC-NEWSTORIES to prevent querying out
,nnhackernews--group-stories)))
t)
(deffoo nnhackernews-request-newgroups (_date &optional server)
(nnhackernews--normalize-server)
(with-current-buffer nntp-server-buffer
(erase-buffer)
(mapc (lambda (group)
(insert (format "%S 0 1 y\n" group)))
`(,nnhackernews--group-ask
,nnhackernews--group-show
,nnhackernews--group-job
,nnhackernews--group-stories))
t))
(defun nnhackernews-sentinel (process event)
"Wipe headers state when PROCESS dies from EVENT."
(unless (string= "open" (substring event 0 4))

View File

@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/sh -ex
# The following is a derivative work of
# https://github.com/purcell/package-lint
@ -9,25 +9,27 @@ EMACS="${EMACS:=emacs}"
INIT_PACKAGE_EL="(progn
(require 'package)
(push '(\"melpa\" . \"http://melpa.org/packages/\") package-archives)
(package-initialize))"
(package-initialize)
(package-refresh-contents))"
# rm -rf "$HOME"/.emacs.d/elpa/package-lint-*
# Get mainline package-lint, then replace package-lint.el with dickmao's.
# quelpa doesn't get data/stdlib-changes.gz for whatever reason.
( cd /tmp ; curl -OskL https://raw.githubusercontent.com/dickmao/package-lint/datetime/package-lint.el )
"$EMACS" -Q -batch \
--eval "$INIT_PACKAGE_EL" \
--eval "(unless (package-installed-p (quote quelpa)) (package-refresh-contents) (package-install (quote quelpa)))" \
--eval "(unless (package-installed-p (quote package-lint)) (quelpa (quote (package-lint :fetcher github :repo \"dickmao/package-lint\" :branch \"datetime\"))))"
--eval "(package-install (quote package-lint))" \
--eval "(let ((dir (file-name-directory (locate-library \"package-lint\")))) \
(ignore-errors (delete-file (expand-file-name \"package-lint.elc\" dir))) \
(copy-file (expand-file-name \"package-lint.el\" \
\"/tmp\") (expand-file-name \"package-lint.el\" dir) t))"
# Byte compile, failing on byte compiler errors, or on warnings unless ignored
if [ -n "${EMACS_LINT_IGNORE+x}" ]; then
ERROR_ON_WARN=nil
else
ERROR_ON_WARN=t
fi
BASENAME=$(basename $1)
BASENAME=$(basename "$1")
"$EMACS" -Q -batch \
--eval "$INIT_PACKAGE_EL" \
-l package-lint.el \
--visit $1 \
--visit "$1" \
--eval "(checkdoc-eval-current-buffer)" \
--eval "(princ (with-current-buffer checkdoc-diagnostic-buffer (buffer-string)))" \
2>&1 | egrep -a "^$BASENAME:" | egrep -v "Messages should start" && [ -n "${EMACS_LINT_IGNORE+x}" ]
@ -42,4 +44,4 @@ BASENAME=$(basename $1)
--eval "$INIT_PACKAGE_EL" \
-l package-lint.el \
-f package-lint-batch-and-exit \
$1 || [ -n "${EMACS_LINT_IGNORE+x}" ]
"$1" || [ -n "${EMACS_LINT_IGNORE+x}" ]