"Ilya N. Golubev" <gin(a)mo.msk.ru> writes:
Revision 1.22 of `add-log.el' uses fsf compatibility definitions
that
are currently present in 21.5 only, not in 21.4. Trying to use it in
21.4 signals errors. Certainly copying 21.5 changes defining these
functions to 21.4 makes sense, to facilitate porting both this and
other fsf code. Will post patch on request.
* add-log.el (add-change-log-entry): Use `point-at-eol',
`point-at-bol' instead of `line-end-position',
`line-beginning-position', which are not defined in current 21.4.
(add-log-current-defun): Ditto.
(match-string-no-properties): Copy from 21.5 `subr.el', for use in
current 21.4.
--- add-log.el 24 Nov 2004 22:36:46 -0000 1.1.3.2
+++ add-log.el 29 Nov 2004 22:40:14 -0000 1.2
@@ -571,7 +571,7 @@
(goto-char (match-beginning 0))
;; Delete excess empty lines; make just 2.
(while (and (not (eobp)) (looking-at "^\\s *$"))
- (delete-region (point) (line-beginning-position 2)))
+ (delete-region (point) (point-at-bol 2)))
(insert-char ?\n 2)
(forward-line -2)
(indent-relative-maybe))
@@ -580,7 +580,7 @@
(while (looking-at "\\sW")
(forward-line 1))
(while (and (not (eobp)) (looking-at "^\\s *$"))
- (delete-region (point) (line-beginning-position 2)))
+ (delete-region (point) (point-at-bol 2)))
(insert-char ?\n 3)
(forward-line -2)
(indent-to left-margin)
@@ -611,7 +611,7 @@
(> fill-column (+ (current-column) (length defun) 4)))
(progn (delete-region (point) pos) (insert ", "))
(if (looking-at "):")
- (delete-region (+ 1 (point)) (line-end-position)))
+ (delete-region (+ 1 (point)) (point-at-eol)))
(goto-char pos)
(insert "("))
(set-marker pos nil))
@@ -743,6 +743,21 @@
'(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode)
"*Modes that look like TeX to `add-log-current-defun'.")
+(defun-when-void match-string-no-properties (num &optional string)
+ "Return string of text matched by last search, without text properties.
+NUM specifies which parenthesized expression in the last regexp.
+ Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
+Zero means the entire text matched by the whole regexp or whole string.
+STRING should be given if the last search was by `string-match' on STRING."
+ (if (match-beginning num)
+ (if string
+ (let ((result
+ (substring string (match-beginning num) (match-end num))))
+ (set-text-properties 0 (length result) nil result)
+ result)
+ (buffer-substring-no-properties (match-beginning num)
+ (match-end num)))))
+
;;;###autoload
(defun add-log-current-defun ()
"Return name of function definition point is in, or nil.
@@ -915,7 +930,7 @@
(goto-char (match-beginning 0))
(buffer-substring-no-properties
(1+ (point)) ; without initial backslash
- (line-end-position)))))
+ (point-at-eol)))))
((eq major-mode 'texinfo-mode)
(if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t)
(match-string-no-properties 1)))
Norbert,
Can you please apply this patch? Without this (or some other)
patch, I cannot add ChangeLog entries in 21.4.
Thanks,
Vin