GNU bug report logs -
#22616
25.0.50; Change to lm-header breaks lm-header-multiline
Previous Next
Reported by: Jonas Bernoulli <jonas <at> bernoul.li>
Date: Wed, 10 Feb 2016 16:18:02 UTC
Severity: normal
Merged with 22510
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.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Thu, 12 May 2016 01:34:44 +0300
with message-id <ee869c3b-475a-3276-ca2a-e85df6a5e026 <at> yandex.ru>
and subject line Re: bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline
has caused the debbugs.gnu.org bug report #22616,
regarding 25.1.50; error in lm-header-multiline
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
22616: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22616
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
Version: 25.1
On 05/11/2016 03:00 AM, Dmitry Gutov wrote:
> Moving save-excursion there does help.
Applied, and closing.
Thanks all.
This bug report was last modified 9 years and 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.