Package: dpkg-dev-el Version: 35.2 Severity: normal Tags: patch When C-c C-a DM-Upload-Allowed emacs reports (wrong-type-argument number-or-marker-p nil)
Attached patch modifies `debian-control-mode-add-field' to use case insensitive completion and insert new field with `upcase-initials' instead of `capitalize'. It also handles non-standard fields. -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.1.0-rc7-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages dpkg-dev-el depends on: ii debian-el 35.2 ii emacs-snapshot [emacsen] 1:20111213-1 ii xemacs21-mule [emacsen] 21.4.22-3.2 Versions of packages dpkg-dev-el recommends: ii wget 1.13.4-1 Versions of packages dpkg-dev-el suggests: ii dpkg-dev 1.16.1.2 -- no debconf information
--- elisp/dpkg-dev-el/debian-control-mode.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) --- a/elisp/dpkg-dev-el/debian-control-mode.el +++ b/elisp/dpkg-dev-el/debian-control-mode.el @@ -376,12 +376,12 @@ (error "Couldn't find Package or Source field"))) (fields (if binary-p debian-control-binary-fields - debian-control-source-fields))) + debian-control-source-fields)) + (completion-ignore-case t)) (list binary-p - (capitalize - (completing-read (format "Add %s package field: " (if binary-p "binary" "source")) - (mapcar #'(lambda (x) (cons x nil)) fields)))))) + (completing-read (format "Add %s package field: " (if binary-p "binary" "source")) + (mapcar #'(lambda (x) (cons x nil)) fields))))) (require 'cl) (let ((fields (if binary debian-control-binary-fields @@ -421,12 +421,12 @@ ;; If the field is already present, just jump to it (if (setq x (assoc field curfields)) (goto-char (cdr x)) - (let* ((pos (position field fields :test #'string-equal)) + (let* ((pos (or (position field fields :test #'string-equal) + -1)) (prevfields (subseq fields 0 pos)) - (nextfields (subseq fields (1+ pos))) - (cur nil)) - (while (or prevfields - nextfields) + (nextfields (subseq fields (1+ pos)))) + (if (not (wholenump pos)) + (goto-char (cdar curfields)) (when prevfields (when (setq x (assoc (pop prevfields) curfields)) (setq prevfields nil nextfields nil) @@ -440,7 +440,7 @@ (when (looking-at "^Description") (forward-line -1)) (end-of-line) - (insert "\n" field ": "))))))) + (insert "\n" (upcase-initials field) ": "))))))) (defun debian-control-visit-policy (format) "Visit the Debian Policy manual in format FORMAT.