branch: elpa/vm
commit 85359a6095b8c0ef20994376549bb2d7096f3519
Merge: a5a676ce48 313a3df00b
Author: Mark Diekhans <ma...@ucsc.edu>
Commit: Mark Diekhans <ma...@ucsc.edu>

    Merge branch 'main' into 'main'
    
    Fixed require order problems with autoload generation created by the 
previous...
    
    Closes #504
    
    See merge request emacs-vm/vm!44
---
 README.md              |   7 +--
 dev-docs/releasing.org |   8 +++
 lisp/Makefile.in       |   4 +-
 lisp/vm-avirtual.el    |   2 +-
 lisp/vm-build.el       |   2 +-
 lisp/vm-misc.el        | 111 +++++++++++++++++++++++++--------
 lisp/vm-ps-print.el    |   2 +-
 lisp/vm-rfaddons.el    |   2 -
 lisp/vm-serial.el      |   1 -
 lisp/vm-vars.el        |   1 -
 lisp/vm-version.el     | 166 -------------------------------------------------
 lisp/vm-w3.el          |   2 +-
 lisp/vm-w3m.el         |   2 +-
 lisp/vm.el             |  53 +++++++++++++++-
 14 files changed, 156 insertions(+), 207 deletions(-)

diff --git a/README.md b/README.md
index f05ab3c8fb..8da333a03c 100644
--- a/README.md
+++ b/README.md
@@ -36,14 +36,13 @@ Alternatively, bugs can be reported report in VM using the 
VM function.
 M-x vm-submit-bug-report
 ```
 
-This function create a mail message that includes your VM configuration
-information. If you are creating an issue, this information maybe pasted
-into the GitLab issue instead of sending.
-
 However, this function currently sends an e-mail to a mailing list,
 which makes the issue hard to track, hence the Gitlab issue tracker
 normally is a better option.
 
+The mail message includes your VM configuration information. If you are
+creating an issue, this information maybe pasted into the GitLab issue.
+
 Please include information about how to reproduce the problem. Please
 report any problems or bugs, otherwise they cannot be fixed!
 
diff --git a/dev-docs/releasing.org b/dev-docs/releasing.org
index f74ac2c40f..efd046c1eb 100644
--- a/dev-docs/releasing.org
+++ b/dev-docs/releasing.org
@@ -1,3 +1,11 @@
 Releasing VM
 
+* pre-release testing:
+(package-vc-install '("https://gitlab.com/USER/REPO.git"; :rev "v1.2.3"))
+
+
+
+* post-release testing
+(package-vc-install '("https://gitlab.com/USER/REPO.git"; :rev "v1.2.3"))
+
 
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index aea42e8409..f5a3c8521f 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -54,7 +54,6 @@ SOURCES += vm-undo.el
 SOURCES += vm-user.el
 SOURCES += vm-vars.el
 SOURCES += vm-vcard.el
-SOURCES += vm-version.el
 SOURCES += vm-virtual.el
 SOURCES += vm-window.el
 SOURCES += vm-w3m.el
@@ -155,7 +154,8 @@ vm-autoloads.el: $(SOURCES:%=@srcdir@/%)
        echo "(setq vm-configure-docdir \"${docdir}\")" | tr -d '\015' >> $@
        echo "(setq vm-configure-infodir \"${infodir}\")" | tr -d '\015' >> $@
        echo "(require 'vm-vars)" | tr -d '\015' >> $@
-       echo "(provide 'vm-autoloads)" | tr -d '\015' >> $@
+       echo "(provide 'vm-autoloads)" | tr -d '\015' >> $@.tmp
+       mv -f $@.tmp $@
 
 vm-cus-load.el: $(SOURCES:%=@srcdir@/%)
        $(EMACS_COMP) -f vm-custom-make-dependencies .
diff --git a/lisp/vm-avirtual.el b/lisp/vm-avirtual.el
index 1899a4c388..e033c5f851 100644
--- a/lisp/vm-avirtual.el
+++ b/lisp/vm-avirtual.el
@@ -132,7 +132,7 @@
 
 ;;----------------------------------------------------------------------------
 (eval-and-compile
-  (require 'vm-version)
+  (require 'vm-misc)
   (require 'regexp-opt)
   (require 'time-date)
 
diff --git a/lisp/vm-build.el b/lisp/vm-build.el
index e7927fc4ca..ef330de065 100644
--- a/lisp/vm-build.el
+++ b/lisp/vm-build.el
@@ -63,7 +63,7 @@
 ;; now add VM source dirs to load-path and preload some
 (setq load-path (append '("." "./lisp") load-path))
 (require 'vm-macro)
-(require 'vm-version)
+(require 'vm-misc)
 (require 'vm-message)
 (require 'vm-vars)
 
diff --git a/lisp/vm-misc.el b/lisp/vm-misc.el
index 4a91c6ee05..1393d7e076 100644
--- a/lisp/vm-misc.el
+++ b/lisp/vm-misc.el
@@ -49,30 +49,6 @@
 (declare-function vm-su-subject "vm-summary" (message))
 
 (require 'vm-vars)
-;; (defvar vm-chop-full-name-function)
-;; (defvar vm-current-warning)
-;; (defvar vm-default-new-folder-line-ending-type)
-;; (defvar vm-delete-duplicates-obarray)
-;; (defvar vm-fill-paragraphs-containing-long-lines)
-;; (defvar vm-folder-type)
-;; (defvar vm-folders-summary-buffer)
-;; (defvar vm-index-file-suffix)
-;; (defvar vm-mail-buffer)
-;; (defvar vm-message-list)
-;; (defvar vm-message-pointer)
-;; (defvar vm-parse-date-workspace)
-;; (defvar vm-paragraph-fill-column)
-;; (defvar vm-presentation-buffer)
-;; (defvar vm-presentation-buffer-handle)
-;; (defvar vm-search-other-frames)
-;; (defvar vm-sortable-date-alist)
-;; (defvar vm-startup-with-summary)
-;; (defvar vm-summary-buffer)
-;; (defvar vm-temp-file-directory)
-;; (defvar vm-tempfile-counter)
-;; (defvar vm-verbosity)
-;; (defvar vm-verbal-time)
-;; (defvar vm-word-wrap-paragraphs)
 
 ;; This file contains various low-level operations that address
 ;; incomaptibilities between Gnu and XEmacs.  Expect compiler warnings.
@@ -1611,9 +1587,94 @@ If MODES is nil the take the modes from the variable
           (setq vm-disable-modes-ignore (cons m vm-disable-modes-ignore)))
         nil)))))
 
-;; Aliases for VM functions
+;; Don't use vm-device-type here because it may not not be loaded yet.
+(declare-function device-type "vm-xemacs" ())
+(declare-function device-matching-specifier-tag-list "vm-xemacs" ())
 
+(defun vm-menu-can-eval-item-name ()
+  (and (featurep 'xemacs)
+       (fboundp 'check-menu-syntax)
+       (condition-case nil
+          (check-menu-syntax '("bar" ((identity "foo") 'ding t)))
+        (error nil))))
 
+(defun vm-multiple-frames-possible-p ()
+  (cond ((featurep 'xemacs)
+        (or (memq 'win (device-matching-specifier-tag-list))
+            (featurep 'tty-frames)))
+        ((not (featurep 'xemacs))
+         (fboundp 'make-frame))))
+ 
+(defun vm-mouse-support-possible-p ()
+  (cond ((featurep 'xemacs)
+         (featurep 'window-system))
+        ((not (featurep 'xemacs))
+         (fboundp 'track-mouse))))
+ 
+(defun vm-mouse-support-possible-here-p ()
+  (cond ((featurep 'xemacs)
+        (memq 'win (device-matching-specifier-tag-list)))
+       ((not (featurep 'xemacs))
+        (memq window-system '(x mac w32 win32)))))
+
+(defun vm-menu-support-possible-p ()
+  (cond ((featurep 'xemacs)
+        (featurep 'menubar))
+       ((not (featurep 'xemacs))
+        (fboundp 'menu-bar-mode))))
+ 
+(defun vm-menubar-buttons-possible-p ()
+  "Menubar buttons are menus that have an immediate action.  Some
+Windowing toolkits do not allow such buttons.  This says whether such
+buttons are possible under the current windowing system."
+  (not
+   (cond ((featurep 'xemacs) (memq (device-type) '(gtk ns)))
+        ((not (featurep 'xemacs)) (or (and (eq window-system 'x) (featurep 
'gtk))
+                           (eq window-system 'ns))))))
+
+(defun vm-toolbar-support-possible-p ()
+  (or (and (featurep 'xemacs) (featurep 'toolbar))
+      (and (not (featurep 'xemacs)) (fboundp 'tool-bar-mode) (boundp 
'tool-bar-map))))
+
+(defun vm-multiple-fonts-possible-p ()
+  (cond ((featurep 'xemacs)
+        (memq (device-type) '(x gtk mswindows)))
+       ((not (featurep 'xemacs))
+        (memq window-system '(x mac w32 win32)))))
+
+(defun vm-images-possible-here-p ()
+  (or (and (featurep 'xemacs) (memq (device-type) '(x gtk mswindows)))
+      (and (not (featurep 'xemacs)) window-system
+          (or (fboundp 'image-type-available-p)
+              (and (stringp vm-imagemagick-convert-program)
+                   (stringp vm-imagemagick-identify-program))))))
+
+(defun vm-image-type-available-p (type)
+  (if (fboundp 'image-type-available-p)
+      (image-type-available-p type)
+    (or (featurep type) (eq type 'xbm))))
+
+(defun vm-load-features (feature-list &optional silent)
+  "Try to load those features listed in FEATURE_LIST.
+If SILENT is t, do not display warnings for unloadable features.
+Return the list of loaded features."
+  (setq feature-list
+        (mapcar (lambda (f)
+                  (condition-case nil
+                      (progn (require f)
+                             f)
+                    (error
+                     (if (load (format "%s" f) t)
+                         f
+                       (when (not silent)
+                         (message "WARNING: Could not load feature %S." f)
+                         ;; (sit-for 1)
+                         (message "WARNING: Related functions may not work 
correctly!")
+                         ;; (sit-for 1)
+                        )
+                       nil))))
+                feature-list))
+  (delete nil feature-list))
 
 (provide 'vm-misc)
 ;;; vm-misc.el ends here
diff --git a/lisp/vm-ps-print.el b/lisp/vm-ps-print.el
index 5cf909c331..131e3ebe7e 100644
--- a/lisp/vm-ps-print.el
+++ b/lisp/vm-ps-print.el
@@ -404,7 +404,7 @@ t) instead of `vm-print-message'."
   (interactive)
   (if each (fset 'vm-toolbar-print-command 'vm-ps-print-each-message)
     (fset 'vm-toolbar-print-command 'vm-ps-print-message))
-  (require 'vm-version)
+  (require 'vm-misc)
   (require 'vm-menu)
   (vm-ps-print-message-fix-menu 'vm-menu-dispose-menu each)
   (vm-ps-print-message-fix-menu 'vm-menu-vm-menu each)
diff --git a/lisp/vm-rfaddons.el b/lisp/vm-rfaddons.el
index b4b4224ae9..4285490589 100644
--- a/lisp/vm-rfaddons.el
+++ b/lisp/vm-rfaddons.el
@@ -60,8 +60,6 @@
 ;;; Code:
 
 (require 'vm-macro)
-(require 'vm-version)
-
 (require 'vm-misc)
 (require 'vm-folder)
 (require 'vm-summary)
diff --git a/lisp/vm-serial.el b/lisp/vm-serial.el
index a0702666ef..466afb1203 100644
--- a/lisp/vm-serial.el
+++ b/lisp/vm-serial.el
@@ -72,7 +72,6 @@
 ;; 
 ;;; Code:
 
-(require 'vm-version)
 (require 'vm-reply)
 (require 'vm-macro)
 (require 'vm-misc)
diff --git a/lisp/vm-vars.el b/lisp/vm-vars.el
index 8b5422d774..dbbbddee71 100644
--- a/lisp/vm-vars.el
+++ b/lisp/vm-vars.el
@@ -22,7 +22,6 @@
 
 ;;; Code:
 
-(require 'vm-version)
 (require 'vm-macro)
 
 (declare-function vm-parse "vm-misc" (string regexp &optional matchn matches))
diff --git a/lisp/vm-version.el b/lisp/vm-version.el
deleted file mode 100644
index a6be94ee7e..0000000000
--- a/lisp/vm-version.el
+++ /dev/null
@@ -1,166 +0,0 @@
-;;; vm-version.el --- Version information about VM and the Emacs running VM.  
-*- lexical-binding: t; -*-
-;;
-;; Copyright (C) Kyle E. Jones, Robert Widhopf-Fenk
-;; Copyright (C) 2003-2007 Robert Widhopf-Fenk
-;; Copyright (C) 2024-2025 The VM Developers
-;;
-;; This program 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 2 of the License, or
-;; (at your option) any later version.
-;;
-;; This program 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, write to the Free Software Foundation, Inc.,
-;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-;;; Code:
-
-(require 'vm-macro)
-(require 'package)
-
-;; Don't use vm-device-type here because it may not not be loaded yet.
-(declare-function device-type "vm-xemacs" ())
-(declare-function device-matching-specifier-tag-list "vm-xemacs" ())
-
-(defun vm--version-info-from-conf ()
-  "Return version and commit from vm-version-conf.el if it exists."
-  (when (ignore-errors (load "vm-version-conf"))
-    (list vm-version-config vm-version-commit-config)))
-
-(defun vm--commit-from-package (pkg)
-  "Get commit hash from PKG, whether VC-installed or archive-installed."
-  (let ((desc (package-get-descriptor pkg)))
-    (or (when (package-vc-p desc)
-          (package-vc-commit desc))
-        (alist-get :commit (package-desc-extras desc)))))
-
-(defun vm--version-info-from-package ()
-  "Return version and commit if VM is loaded from a package."
-  (let ((package-version (vm-get-package-version)))
-    (if package-version
-        (list package-version (vm--commit-from-package 'vm))
-      (list nil nil))))
-
-;; Define vm-version and vm-version-commit
-(let ((version-info (or (vm--version-info-from-conf)
-                        (vm--version-info-from-package)
-                        (list nil nil))))
-  (defconst vm-version (nth 0 version-info)
-    "Version number of VM.")
-  (defconst vm-version-commit (nth 1 version-info)
-    "Git commit number of VM.")
-  (unless vm-version
-    (warn "Can't obtain vm-version from package or vm-version-conf.el"))
-  (unless vm-version-commit
-    (warn "Can't obtain vm-version-commit from package or 
vm-version-conf.el")))
-
-(defun vm-version ()
-  "Display and return the value of the variable `vm-version'."
-  (interactive)
-  (when (vm-interactive-p)
-    (if vm-version
-        (message "VM version is: %s" vm-version)
-      (message "VM version was not discovered when VM was loaded")))
-  (or vm-version "unknown"))
-
-(defun vm-version-commit ()
-  "Display and the value of the variable `vm-version-commit'."
-  (interactive)
-  (when (vm-interactive-p)
-    (if vm-version-commit
-        (message "VM commit is: %s" vm-version-commit)
-      (message "VM commit was not discovered when VM was loaded")))
-   (or vm-version-commit "unknown"))
-
-(defun vm-menu-can-eval-item-name ()
-  (and (featurep 'xemacs)
-       (fboundp 'check-menu-syntax)
-       (condition-case nil
-          (check-menu-syntax '("bar" ((identity "foo") 'ding t)))
-        (error nil))))
-
-(defun vm-multiple-frames-possible-p ()
-  (cond ((featurep 'xemacs)
-        (or (memq 'win (device-matching-specifier-tag-list))
-            (featurep 'tty-frames)))
-        ((not (featurep 'xemacs))
-         (fboundp 'make-frame))))
- 
-(defun vm-mouse-support-possible-p ()
-  (cond ((featurep 'xemacs)
-         (featurep 'window-system))
-        ((not (featurep 'xemacs))
-         (fboundp 'track-mouse))))
- 
-(defun vm-mouse-support-possible-here-p ()
-  (cond ((featurep 'xemacs)
-        (memq 'win (device-matching-specifier-tag-list)))
-       ((not (featurep 'xemacs))
-        (memq window-system '(x mac w32 win32)))))
-
-(defun vm-menu-support-possible-p ()
-  (cond ((featurep 'xemacs)
-        (featurep 'menubar))
-       ((not (featurep 'xemacs))
-        (fboundp 'menu-bar-mode))))
- 
-(defun vm-menubar-buttons-possible-p ()
-  "Menubar buttons are menus that have an immediate action.  Some
-Windowing toolkits do not allow such buttons.  This says whether such
-buttons are possible under the current windowing system."
-  (not
-   (cond ((featurep 'xemacs) (memq (device-type) '(gtk ns)))
-        ((not (featurep 'xemacs)) (or (and (eq window-system 'x) (featurep 
'gtk))
-                           (eq window-system 'ns))))))
-
-(defun vm-toolbar-support-possible-p ()
-  (or (and (featurep 'xemacs) (featurep 'toolbar))
-      (and (not (featurep 'xemacs)) (fboundp 'tool-bar-mode) (boundp 
'tool-bar-map))))
-
-(defun vm-multiple-fonts-possible-p ()
-  (cond ((featurep 'xemacs)
-        (memq (device-type) '(x gtk mswindows)))
-       ((not (featurep 'xemacs))
-        (memq window-system '(x mac w32 win32)))))
-
-(defun vm-images-possible-here-p ()
-  (or (and (featurep 'xemacs) (memq (device-type) '(x gtk mswindows)))
-      (and (not (featurep 'xemacs)) window-system
-          (or (fboundp 'image-type-available-p)
-              (and (stringp vm-imagemagick-convert-program)
-                   (stringp vm-imagemagick-identify-program))))))
-
-(defun vm-image-type-available-p (type)
-  (if (fboundp 'image-type-available-p)
-      (image-type-available-p type)
-    (or (featurep type) (eq type 'xbm))))
-
-(defun vm-load-features (feature-list &optional silent)
-  "Try to load those features listed in FEATURE_LIST.
-If SILENT is t, do not display warnings for unloadable features.
-Return the list of loaded features."
-  (setq feature-list
-        (mapcar (lambda (f)
-                  (condition-case nil
-                      (progn (require f)
-                             f)
-                    (error
-                     (if (load (format "%s" f) t)
-                         f
-                       (when (not silent)
-                         (message "WARNING: Could not load feature %S." f)
-                         ;; (sit-for 1)
-                         (message "WARNING: Related functions may not work 
correctly!")
-                         ;; (sit-for 1)
-                        )
-                       nil))))
-                feature-list))
-  (delete nil feature-list))
-
-(provide 'vm-version)
-;;; vm-version.el ends here
diff --git a/lisp/vm-w3.el b/lisp/vm-w3.el
index a59bf8d017..eca7b7d698 100644
--- a/lisp/vm-w3.el
+++ b/lisp/vm-w3.el
@@ -29,7 +29,7 @@
 (require 'vm-mime)
 
 (eval-and-compile
-  (require 'vm-version)
+  (require 'vm-misc)
   (vm-load-features '(w3) byte-compile-current-file))
 
 (declare-function w3-region "ext:w3-display.el" (st nd))
diff --git a/lisp/vm-w3m.el b/lisp/vm-w3m.el
index 9ac63233c0..ea53118d43 100644
--- a/lisp/vm-w3m.el
+++ b/lisp/vm-w3m.el
@@ -32,7 +32,7 @@
 ;;; Code:
 
 (require 'vm-mime)
-(require 'vm-version)
+(require 'vm-misc)
 
 (eval-and-compile (vm-load-features '(w3m) byte-compile-current-file))
 
diff --git a/lisp/vm.el b/lisp/vm.el
index 910b71808a..293eeffed2 100644
--- a/lisp/vm.el
+++ b/lisp/vm.el
@@ -34,7 +34,6 @@
 
 (provide 'vm)
 
-(require 'vm-version)
 (require 'vm-macro)
 (require 'vm-misc)
 (require 'vm-folder)
@@ -1687,4 +1686,56 @@ draft messages."
   ;; to be called from the file containg the `Version:' header.
   (package-get-version))
 
+(defun vm--version-info-from-conf ()
+  "Return version and commit from vm-version-conf.el if it exists."
+  (when (ignore-errors (load "vm-version-conf"))
+    (list vm-version-config vm-version-commit-config)))
+
+(defun vm--commit-from-package (pkg)
+  "Get commit hash from PKG, whether VC-installed or archive-installed."
+  (let ((desc (package-get-descriptor pkg)))
+    (or (when (package-vc-p desc)
+          (package-vc-commit desc))
+        (alist-get :commit (package-desc-extras desc)))))
+
+(defun vm--version-info-from-package ()
+  "Return version and commit if VM is loaded from a package."
+  (let ((package-version (vm-get-package-version)))
+    (if package-version
+        (list package-version (vm--commit-from-package 'vm))
+      (list nil nil))))
+
+;; Define vm-version and vm-version-commit
+(let ((version-info (or (vm--version-info-from-conf)
+                        (vm--version-info-from-package)
+                        (list nil nil))))
+  (defconst vm-version (nth 0 version-info)
+    "Version number of VM.")
+  (defconst vm-version-commit (nth 1 version-info)
+    "Git commit number of VM.")
+  (unless vm-version
+    (warn "Can't obtain vm-version from package or vm-version-conf.el"))
+  (unless vm-version-commit
+    (warn "Can't obtain vm-version-commit from package or 
vm-version-conf.el")))
+
+;;;###autoload
+(defun vm-version ()
+  "Display and return the value of the variable `vm-version'."
+  (interactive)
+  (when (vm-interactive-p)
+    (if vm-version
+        (message "VM version is: %s" vm-version)
+      (message "VM version was not discovered when VM was loaded")))
+  (or vm-version "unknown"))
+
+;;;###autoload
+(defun vm-version-commit ()
+  "Display and the value of the variable `vm-version-commit'."
+  (interactive)
+  (when (vm-interactive-p)
+    (if vm-version-commit
+        (message "VM commit is: %s" vm-version-commit)
+      (message "VM commit was not discovered when VM was loaded")))
+   (or vm-version-commit "unknown"))
+
 ;;; vm.el ends here

Reply via email to