From 485eed3e579de76199d25f172c44589307a0aeba Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 13 Apr 2021 15:11:24 -0600 Subject: [PATCH] Version 4.2. - Drop upstreamed -iedit patch. - Add -emacs patch to fix various Emacs issues. --- .gitignore | 10 +--- ocaml-merlin-emacs.patch | 103 +++++++++++++++++++++++++++++++++++++++ ocaml-merlin-iedit.patch | 38 --------------- ocaml-merlin.spec | 23 ++++----- sources | 2 +- 5 files changed, 118 insertions(+), 58 deletions(-) create mode 100644 ocaml-merlin-emacs.patch delete mode 100644 ocaml-merlin-iedit.patch diff --git a/.gitignore b/.gitignore index 973c9f0..30f0438 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,2 @@ -/merlin-3.2.2.tar.gz -/merlin-3.3.1.tar.gz -/merlin-3.3.2.tar.gz -/merlin-3.3.3.tar.gz -/merlin-v3.3.4-preview1.tbz -/merlin-v3.3.4.tbz -/merlin-3.3.7-4.11-preview1.tar.gz -/merlin-4.1.tar.gz +/merlin-*.tar.gz +/merlin-*.tbz diff --git a/ocaml-merlin-emacs.patch b/ocaml-merlin-emacs.patch new file mode 100644 index 0000000..68ed692 --- /dev/null +++ b/ocaml-merlin-emacs.patch @@ -0,0 +1,103 @@ +Fixes these warnings: + +In ac-merlin-locate: +merlin-ac.el:142:8:Warning: merlin-locate called with 1 argument, but accepts + only 0 + +In toplevel form: +merlin-cap.el:30:1:Warning: Unused lexical argument `state' + +In merlin-company-backend: +merlin-company.el:112:23:Warning: merlin-locate called with 1 argument, but + accepts only 0 +Iedit default key binding is C-; + +In toplevel form: +merlin-iedit.el:49:1:Warning: Unused lexical argument `c' +merlin-iedit.el:49:1:Warning: Unused lexical argument `b' + +In toplevel form: +merlin-xref.el:16:1:Warning: Unused lexical argument `symbol' +merlin-xref.el:24:1:Warning: Unused lexical argument `symbol' + +In end of data: +merlin.el:1924:1:Warning: the following functions are not known to be defined: + first, rest + +--- a/emacs/merlin-ac.el 2021-04-13 02:53:39.000000000 -0600 ++++ b/emacs/merlin-ac.el 2021-04-13 14:15:33.735325907 -0600 +@@ -139,7 +139,7 @@ wrong then recompute it." + (when (popup-hidden-p ac-menu) + (ac-show-menu)) + (let ((merlin-locate-in-new-window 'always)) +- (merlin-locate (ac-selected-candidate))) ++ (merlin-locate-ident (ac-selected-candidate))) + (ac-show-menu))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +--- a/emacs/merlin-cap.el 2021-04-13 02:53:39.000000000 -0600 ++++ b/emacs/merlin-cap.el 2021-04-13 14:18:43.383116394 -0600 +@@ -27,7 +27,7 @@ trigger useless merlin calls.") + + ;; Internal functions + +-(defun merlin-cap--lookup (string state) ++(defun merlin-cap--lookup (string _state) + "Lookup the entry STRING inside the completion table." + (let ((ret (assoc string merlin-cap--table))) + (if ret (message "%s%s" (car ret) (cdr ret))))) +--- a/emacs/merlin-company.el 2021-04-13 02:53:39.000000000 -0600 ++++ b/emacs/merlin-company.el 2021-04-13 14:32:00.527211921 -0600 +@@ -109,7 +109,7 @@ + (doc-buffer (merlin-company--doc-buffer arg)) + (location + (ignore-errors +- (let ((data (merlin-locate arg))) ++ (let ((data (merlin-locate-ident arg))) + (when (listp data) + (let ((filename (merlin-lookup 'file data (buffer-file-name))) + (linum (cdr (assoc 'line (assoc 'pos data))))) +--- a/emacs/merlin.el 2021-04-13 02:53:39.000000000 -0600 ++++ b/emacs/merlin.el 2021-04-13 14:11:50.200586231 -0600 +@@ -1267,8 +1267,8 @@ strictly within, or nil if there is no s + "Returns the first `hole` of the list such that + `(funcall comp hole current-point)`" + (when holes +- (let* ((head (first holes)) +- (tail (rest holes)) ++ (let* ((head (cl-first holes)) ++ (tail (cl-rest holes)) + (start (merlin-lookup 'start head)) + (hole-point (merlin-make-point start))) + (if (funcall comp hole-point current-point) +--- a/emacs/merlin-iedit.el 2021-04-13 02:53:39.000000000 -0600 ++++ b/emacs/merlin-iedit.el 2021-04-13 14:19:18.000078147 -0600 +@@ -56,7 +56,7 @@ + (if (listp r) + (cl-letf (((symbol-function 'iedit-printable) #'merlin-iedit--printable) + ((symbol-function 'iedit-make-occurrences-overlays) +- (lambda (a b c) ++ (lambda (a _b _c) + (merlin-iedit--make-occurrences-overlays a)))) + (iedit-start r (point-min) (point-max))) + (message r)))))) +--- a/emacs/merlin-xref.el 2021-04-13 02:53:39.000000000 -0600 ++++ b/emacs/merlin-xref.el 2021-04-13 14:19:51.431041212 -0600 +@@ -13,7 +13,7 @@ + (goto-char loc) + (buffer-substring (line-beginning-position) (line-end-position)))) + +-(cl-defmethod xref-backend-references ((_backend (eql merlin-xref)) symbol) ++(cl-defmethod xref-backend-references ((_backend (eql merlin-xref)) _symbol) + (mapcar + (lambda (loc) + (let ((pt (merlin-make-point (alist-get 'start loc)))) +@@ -21,7 +21,7 @@ + (xref-make-buffer-location (current-buffer) pt)))) + (merlin--occurrences))) + +-(cl-defmethod xref-backend-definitions ((_backend (eql merlin-xref)) symbol) ++(cl-defmethod xref-backend-definitions ((_backend (eql merlin-xref)) _symbol) + (let* ((loc (merlin-locate)) + (file (alist-get 'file loc)) + (pos (alist-get 'pos loc)) diff --git a/ocaml-merlin-iedit.patch b/ocaml-merlin-iedit.patch deleted file mode 100644 index 1ddf2c6..0000000 --- a/ocaml-merlin-iedit.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/emacs/merlin-company.el 2021-02-16 03:29:29.000000000 -0700 -+++ b/emacs/merlin-company.el 2021-03-09 16:53:30.948523612 -0700 -@@ -29,6 +29,7 @@ - - (defcustom merlin-company-everywhere t - "Non-nil to offer completions in comments and strings." -+ :group 'merlin - :type 'boolean) - - ;; Internal functions ---- a/emacs/merlin-iedit.el 2021-02-16 03:29:29.000000000 -0700 -+++ b/emacs/merlin-iedit.el 2021-03-10 09:03:03.533151403 -0700 -@@ -32,8 +32,8 @@ - iedit-read-only-occurrences-overlays) - (push (iedit-make-occurrence-overlay beginning ending) - iedit-occurrences-overlays)))) -- (when (and occurrences iedit-unmatched-lines-invisible) -- (iedit-hide-unmatched-lines iedit-occurrence-context-lines)))) -+ (when (and occurrences iedit-hiding) -+ (iedit-hide-context-lines iedit-occurrence-context-lines)))) - (length occurrences)) - - (defun merlin-iedit-occurrences () -@@ -44,10 +44,10 @@ - "-identifier-at" (merlin/unmake-point (point))))) - (when r - (if (listp r) -- (flet ((iedit-printable (a) -- (merlin-iedit--printable)) -- (iedit-make-occurrences-overlays (a b c) -- (merlin-iedit--make-occurrences-overlays a))) -+ (cl-flet ((iedit-printable (a) -+ (merlin-iedit--printable)) -+ (iedit-make-occurrences-overlays (a b c) -+ (merlin-iedit--make-occurrences-overlays a))) - (iedit-start r (point-min) (point-max))) - (message r)))))) - diff --git a/ocaml-merlin.spec b/ocaml-merlin.spec index ec2b173..23fbb4b 100644 --- a/ocaml-merlin.spec +++ b/ocaml-merlin.spec @@ -3,10 +3,11 @@ %endif %global srcname merlin +%global ocamlver 412 Name: ocaml-%{srcname} -Version: 4.1 -Release: 2%{?dist} +Version: 4.2 +Release: 1%{?dist} Summary: Context sensitive completion for OCaml # The entire source is MIT except: @@ -20,11 +21,11 @@ Summary: Context sensitive completion for OCaml # The final license is due to the linking exception on the LGPLv2 files. License: MIT and QPL URL: https://ocaml.github.io/%{srcname}/ -Source0: https://github.com/ocaml/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz +Source0: https://github.com/ocaml/%{srcname}/releases/download/v%{version}-%{ocamlver}/%{srcname}-v%{version}-%{ocamlver}.tbz # Fix the tests to work with /usr/lib64 as well as /usr/lib Patch0: %{name}-test-lib64.patch -# Update the Emacs interface for recent changes to emacs-iedit -Patch1: %{name}-iedit.patch +# Fix various issues in the Emacs interface +Patch1: %{name}-emacs.patch BuildRequires: emacs BuildRequires: emacs-auto-complete @@ -92,7 +93,7 @@ Requires: vim-filesystem This package contains the Vim interface to merlin. %prep -%autosetup -n %{srcname}-%{version} -p1 +%autosetup -n %{srcname}-v%{version}-%{ocamlver} -p1 %build dune build %{_smp_mflags} @@ -110,11 +111,6 @@ find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete # We install the documentation with the doc macro rm -fr %{buildroot}%{_prefix}/doc -%ifarch %{ocaml_native_compiler} -# Add missing executable bits -find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod a+x {} \+ -%endif - # Reinstall vim files to Fedora default location mkdir -p %{buildroot}%{vimfiles_root} mv %{buildroot}%{_datadir}/%{srcname}/vim/* %{buildroot}%{vimfiles_root} @@ -152,6 +148,11 @@ dune runtest %{vimfiles_root}/*/* %changelog +* Tue Apr 13 2021 Jerry James - 4.2-1 +- Version 4.2 +- Drop upstreamed -iedit patch +- Add -emacs patch to fix various Emacs issues + * Fri Mar 26 2021 Jerry James - 4.1-2 - Fix tests on 64-bit systems with the -test-lib64 patch - Add -emacs-iedit patch to adapt to recent iedit changes diff --git a/sources b/sources index b1cd0ce..7c3a984 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (merlin-4.1.tar.gz) = f0f3ada007f8214b97a8557bddca87eded48ee01a8bb88aba6476e52881ead52d9f47e2666a9292b5c6a490e4cfdc7d8bb322e8489f78eaac7b0f80b6d1e87bc +SHA512 (merlin-v4.2-412.tbz) = 27fbfb2ac50d7cd86807bd8cb02ff1e4661ee46abf071b9bec505e1df6d41f366c9c287988e66096fb7a14b67fd806df39c56b9f70c53ec40612192ba2a0e530