branch: elpa/subed
commit 7472d62d1efc2ea785760ec702a1efef11e63e54
Author: Sacha Chua <sa...@sachachua.com>
Commit: Sacha Chua <sa...@sachachua.com>

    Remove autoloads from the repository to make it get along with ELPA
    
    * .gitignore: Don't include autoloads and package files.
    * Makefile (clean): Remove autoload file.
    (test): Generate autoloads.
    * subed/subed-common.el (subed--post-command-handler): Include Stefan
    Monnier's improvement to the test for buffer-chars-modified-tick.
    * subed/subed.el: Bump the version.
    (subed-autoloads): Don't require autoloads.
    * tests/test-subed-ass.el: Turn on lexical binding.
    * README.org (Manual installation): Add note about autoloads, since
    it's not in the repository.
    
    ... Not sure if I'm doing this the right way, but maybe it will work!
---
 .gitignore               |   4 ++
 Makefile                 |   5 ++-
 README.org               |  20 ++++++++-
 subed/subed-autoloads.el | 107 -----------------------------------------------
 subed/subed-common.el    |   4 +-
 subed/subed.el           |   3 +-
 tests/test-subed-ass.el  |   2 +-
 tests/undercover-init.el |   2 +-
 8 files changed, 30 insertions(+), 117 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..1f721d93bb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.elc
+/subed-autoloads.el
+/subed-pkg.el
+/subed/subed-autoloads.el
diff --git a/Makefile b/Makefile
index 672406686f..674b00570b 100644
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,10 @@
 
 clean:
        find . -name "*.elc" -delete
+       rm subed/subed-autoloads.el
        rm -f coverage/.*.json
 
-test: test-coverage package-lint checkdoc
+test: autoloads test-coverage package-lint checkdoc
 
 test-coverage:
        mkdir -p coverage
@@ -52,4 +53,4 @@ test-compile:
        make clean
 
 test-emacs:
-       emacs -Q -L ./subed --eval "(require 'subed)"
+       emacs -Q -L ./subed --eval "(require 'subed-autoloads)"
diff --git a/README.org b/README.org
index 5dc51c4016..9951d117e5 100644
--- a/README.org
+++ b/README.org
@@ -112,9 +112,25 @@ If that doesn't work, you can install it manually. To 
install from the main bran
 git clone https://github.com/sachac/subed.git
 #+end_src
 
-This will create a =subed= directory with the code.  Then you can add
+This will create a =subed= directory with the code.
+
+If you have the =make= utility, you can regenerate the autoload definitions 
with
+
+#+begin_src sh :eval no
+make autoloads
+#+end_src
+
+If you don't have =make= installed, you can generate the autoloads
+with:
+
+#+begin_src sh :eval no
+emacs --quick --batch --eval "(progn (setq generated-autoload-file 
(expand-file-name \"subed-autoloads.el\" \"subed\") backup-inhibited t) \
+       (update-directory-autoloads \"./subed\"))"
+#+end_src
+
+Then you can add
 the following to your Emacs configuration (typically
-=~/.config/emacs-init.el=, =~/.emacs.d/init.el=, or =~/.emacs=; you
+=~/.config/emacs/init.el=, =~/.emacs.d/init.el=, or =~/.emacs=; you
 can create this file if it doesn't exist yet):
 
 #+begin_src emacs-lisp
diff --git a/subed/subed-autoloads.el b/subed/subed-autoloads.el
deleted file mode 100644
index de47cade7e..0000000000
--- a/subed/subed-autoloads.el
+++ /dev/null
@@ -1,107 +0,0 @@
-;;; subed-autoloads.el --- automatically extracted autoloads  -*- 
lexical-binding: t -*-
-;;
-;;; Code:
-
-
-;;;### (autoloads nil "subed" "subed.el" (0 0 0 0))
-;;; Generated autoloads from subed.el
-
-(autoload 'subed-mode "subed" "\
-Major mode for editing subtitles.
-
-subed uses the following terminology when it comes to changes in
-subtitles' timestamps:
-
-Adjust - Increase or decrease start or stop time of a subtitle
-  Move - Increase or decrease start and stop time of a subtitle
-         by the same amount
- Shift - Increase or decrease start and stop time of the current
-         and all following subtitles by the same amount
-
-Key bindings:
-\\{subed-mode-map}
-
-\(fn)" t nil)
-
-(register-definition-prefixes "subed" '("subed-"))
-
-;;;***
-
-;;;### (autoloads nil "subed-ass" "subed-ass.el" (0 0 0 0))
-;;; Generated autoloads from subed-ass.el
-
-(autoload 'subed-ass-mode "subed-ass" "\
-Major mode for editing Advanced SubStation Alpha subtitle files.
-
-\(fn)" t nil)
-
-(add-to-list 'auto-mode-alist '("\\.ass\\'" . subed-ass-mode))
-
-(register-definition-prefixes "subed-ass" '("subed-ass-"))
-
-;;;***
-
-;;;### (autoloads nil "subed-common" "subed-common.el" (0 0 0 0))
-;;; Generated autoloads from subed-common.el
-
-(register-definition-prefixes "subed-common" '("subed-"))
-
-;;;***
-
-;;;### (autoloads nil "subed-config" "subed-config.el" (0 0 0 0))
-;;; Generated autoloads from subed-config.el
-
-(register-definition-prefixes "subed-config" '("subed-"))
-
-;;;***
-
-;;;### (autoloads nil "subed-debug" "subed-debug.el" (0 0 0 0))
-;;; Generated autoloads from subed-debug.el
-
-(register-definition-prefixes "subed-debug" '("subed-"))
-
-;;;***
-
-;;;### (autoloads nil "subed-mpv" "subed-mpv.el" (0 0 0 0))
-;;; Generated autoloads from subed-mpv.el
-
-(register-definition-prefixes "subed-mpv" '("subed-mpv-"))
-
-;;;***
-
-;;;### (autoloads nil "subed-srt" "subed-srt.el" (0 0 0 0))
-;;; Generated autoloads from subed-srt.el
-
-(autoload 'subed-srt-mode "subed-srt" "\
-Major mode for editing SubRip subtitle files.
-
-\(fn)" t nil)
-
-(add-to-list 'auto-mode-alist '("\\.srt\\'" . subed-srt-mode))
-
-(register-definition-prefixes "subed-srt" '("subed-srt-"))
-
-;;;***
-
-;;;### (autoloads nil "subed-vtt" "subed-vtt.el" (0 0 0 0))
-;;; Generated autoloads from subed-vtt.el
-
-(autoload 'subed-vtt-mode "subed-vtt" "\
-Major mode for editing WebVTT subtitle files.
-
-\(fn)" t nil)
-
-(add-to-list 'auto-mode-alist '("\\.vtt\\'" . subed-vtt-mode))
-
-(register-definition-prefixes "subed-vtt" '("subed-vtt-"))
-
-;;;***
-
-(provide 'subed-autoloads)
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; coding: utf-8
-;; End:
-;;; subed-autoloads.el ends here
diff --git a/subed/subed-common.el b/subed/subed-common.el
index 0e6c2c040e..fd6e5d03b8 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -480,8 +480,8 @@ Before BODY is run, point is placed on the subtitle's ID."
         (new-buffer-chars-modified-tick (buffer-chars-modified-tick)))
     (when (and
            new-point subed--current-point
-           (or (not (= new-point subed--current-point))
-               (not (= new-buffer-chars-modified-tick 
subed--buffer-chars-modified-tick))))
+           (not (and (= new-point subed--current-point)
+                     (= new-buffer-chars-modified-tick 
subed--buffer-chars-modified-tick))))
 
       ;; If point is synced to playback position, temporarily disable that so
       ;; that manual moves aren't cancelled immediately by automated moves.
diff --git a/subed/subed.el b/subed/subed.el
index c01d6b23cb..538c0f5cb7 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -1,6 +1,6 @@
 ;;; subed.el --- A major mode for editing subtitles  -*- lexical-binding: t; 
-*-
 
-;; Version: 1.0.3
+;; Version: 1.0.4
 ;; Keywords: convenience, files, hypermedia, multimedia
 ;; URL: https://github.com/rndusr/subed
 ;; Package-Requires: ((emacs "25.1"))
@@ -32,7 +32,6 @@
 
 ;;; Code:
 
-(require 'subed-autoloads)
 (require 'subed-config)
 (require 'subed-debug)
 (require 'subed-common)
diff --git a/tests/test-subed-ass.el b/tests/test-subed-ass.el
index cd8cee4571..692956bddd 100644
--- a/tests/test-subed-ass.el
+++ b/tests/test-subed-ass.el
@@ -1,4 +1,4 @@
-;; -*- eval: (buttercup-minor-mode) -*-
+;; -*- eval: (buttercup-minor-mode); lexical-binding: t; -*-
 
 (load-file "./tests/undercover-init.el")
 (require 'subed)
diff --git a/tests/undercover-init.el b/tests/undercover-init.el
index 0ffc2aed1a..c7f5c57417 100644
--- a/tests/undercover-init.el
+++ b/tests/undercover-init.el
@@ -1,4 +1,4 @@
-(add-to-list 'load-path (expand-file-name "./subed"))
+(add-to-list 'load-path (expand-file-name "./subed")) ;FIXME: ??
 (when (require 'undercover nil t)
   (undercover "./subed/*.el" (:report-format 'simplecov) (:send-report nil)))
 

Reply via email to