GNU bug report logs - #22510
25.1.50; error in lm-header-multiline

Previous Next

Package: emacs;

Reported by: John Kitchin <jkitchin <at> andrew.cmu.edu>

Date: Sun, 31 Jan 2016 23:09:02 UTC

Severity: normal

Merged with 22616

Found in versions 25.0.50, 25.1.50

Fixed in version 25.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22510 in the body.
You can then email your comments to 22510 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22510; Package emacs. (Sun, 31 Jan 2016 23:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Kitchin <jkitchin <at> andrew.cmu.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 31 Jan 2016 23:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Kitchin <jkitchin <at> andrew.cmu.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; error in lm-header-multiline
Date: Sun, 31 Jan 2016 17:56:12 -0500
I think there is a bug in lm-header-multiline in lisp-mnt.el.

It does not actually read multiline headers because in line 285, the
call to lm-header does not move point, and the subsequent code does not
read the next lines.

I do not see a good fix. One could modify the lm-header code or add the
code to lm-header-multiline. I am not sure of the implications of either
of these.

Here is my solution that returns single and multiline headers. I have
signed FSF papers, so you are welcome to this code if you like it.

thanks,

(defun lm-header (header)
  "Return the contents of the header named HEADER.
If the HEADER is multiline, a list of strings is returned."
  (save-excursion
    (goto-char (point-min))
    (let ((case-fold-search t)
          res)
      (when (and (re-search-forward
                  (lm-get-header-re header)
                  (lm-code-mark) t)
                 ;;   RCS ident likes format "$identifier: data$"
                 (looking-at
                  (if (save-excursion
                        (skip-chars-backward "^$" (match-beginning 0))
                        (= (point) (match-beginning 0)))
                      "[^\n]+" "[^$\n]+")))
        (setq res (list (match-string-no-properties 0)))
        (forward-line 1)
        (while (looking-at "^;+\\(\t\\|[\t\s]\\{2,\\}\\)\\(.+\\)")
          (push (match-string-no-properties 2) res)
          (forward-line 1))
        (setq res (nreverse res))
        (if (= 1 (length res))
            (car res)
          res)))))



--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu




Merged 22510 22616. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 10 Feb 2016 16:31:01 GMT) Full text and rfc822 format available.

Added indication that bug 22510 blocks19759 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 10 Feb 2016 16:32:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 Jun 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.