On 14 April 2017 at 14:10, Jean Delvare <jdelv...@suse.de> wrote: > Hi guys, > > I write to you because you have touched quilt.el in the past years. > > I get the following warnings about quilt.el in OBS, I am wondering if > any of you can take a look and fix them? > >> In quilt-editable: >> quilt.el:177:26:Warning: reference to free variable `quilt-edit-top-only' >> >> In quilt-edit-patch: >> quilt.el:379:56:Warning: `toggle-read-only' is an obsolete function (as of >> 24.3); use `read-only-mode' instead. >> >> In quilt-mode: >> quilt.el:554:23:Warning: `toggle-read-only' is an obsolete function (as of >> 24.3); use `read-only-mode' instead. >> quilt.el:555:18:Warning: `toggle-read-only' is an obsolete function (as of >> 24.3); use `read-only-mode' instead. >
Hi Jean, Please see patches below. I also fixed a small issue with quilt-top-patch which stripped the folder where it shouldn't Leo.
From 65aadc7dbd9fb53048897b0938e9633520b175ba Mon Sep 17 00:00:00 2001 From: leo <event.r...@gmail.com> Date: Wed, 19 Apr 2017 15:01:47 +0100 Subject: [PATCH 3/3] quilt.el: don't strip directory in quilt-top-patch as it could be a part of patch name --- lib/quilt.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/quilt.el b/lib/quilt.el index 3dfdec3..545e965 100644 --- a/lib/quilt.el +++ b/lib/quilt.el @@ -152,8 +152,7 @@ "Return the top patch name. return nil if there is the bottom of patch stack." (if (quilt-bottom-p) nil - (file-name-nondirectory - (substring (quilt-cmd-to-string "top") 0 -1)))) + (substring (quilt-cmd-to-string "top") 0 -1))) (defun quilt-complete-list (p l) "Call 'completing-read' with prompt P and list L." @@ -186,7 +185,7 @@ (defun quilt-short-patchname () "Return shortened name of top patch. Return nil if there is on the bottom of patch stack." - (let ((p (quilt-top-patch))) + (let ((p (file-name-nondirectory (quilt-top-patch)))) (if (not p) "none" (let ((p2 (file-name-sans-extension p))) -- 2.7.4
From 2dc20e719be8ee3aa7fae4e273f08488c71213ac Mon Sep 17 00:00:00 2001 From: leo <event.r...@gmail.com> Date: Wed, 19 Apr 2017 15:01:07 +0100 Subject: [PATCH 2/3] quilt.el: replace deprecated toggle-read-only function call with read-only-mode --- lib/quilt.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/quilt.el b/lib/quilt.el index 1890a67..3dfdec3 100644 --- a/lib/quilt.el +++ b/lib/quilt.el @@ -376,7 +376,7 @@ editability adjusted." patch))) (if (file-exists-p pf) (progn (find-file pf) - (toggle-read-only)) + (read-only-mode 0)) (message (format "%s doesn't exist yet." pf))))))))) (defun quilt-patches () @@ -552,8 +552,8 @@ editability adjusted." (let ((f (quilt-buffer-file-name-safe))) (if (quilt-owned-p f) (if (not (quilt-editable f)) - (toggle-read-only 1) - (toggle-read-only 0))) + (read-only-mode 1) + (read-only-mode 0))) (quilt-update-modeline)))) (defun quilt-hook () -- 2.7.4
From 7dd72b7907842599044f85553792da6e303472b9 Mon Sep 17 00:00:00 2001 From: leo <event.r...@gmail.com> Date: Wed, 19 Apr 2017 15:00:18 +0100 Subject: [PATCH 1/3] quilt.el: define quilt-edit-top-only before it's used --- lib/quilt.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/quilt.el b/lib/quilt.el index c1acaab..1890a67 100644 --- a/lib/quilt.el +++ b/lib/quilt.el @@ -166,6 +166,7 @@ (setq n (1+ n)))) (completing-read p l nil t)) +(defvar quilt-edit-top-only 't) (defun quilt-editable (f) "Return t if F is editable in terms of current patch. Return nil if otherwise." (let ((qd (quilt-dir)) @@ -537,7 +538,6 @@ editability adjusted." (defvar quilt-mode nil) (make-variable-buffer-local 'quilt-mode) -(defvar quilt-edit-top-only 't) (defun quilt-mode (&optional arg) "Toggle 'quilt-mode'. Enable 'quilt-mode' if ARG is positive. -- 2.7.4
_______________________________________________ Quilt-dev mailing list Quilt-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/quilt-dev