[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: [PATCH] w3m-lnum add highlight



In [emacs-w3m : No.11469] Andrey Kotlarski wrote:
> I've done another set of changes/enhancements to w3m-lnum.el
[...]
Thanks.  I've installed the patch with the following modifications:

* w3m-util.el (w3m-replace-regexps-in-string): Move from w3m-lnum.el;
 use w3m-replace-in-string instead of replace-regexp-in-string that is
 not available in XEmacs 21.4; make it a Lisp function.
(w3m-string-match-p, w3m-substring-no-properties): New functions.

* w3m-lnum.el (w3m-link-set-numbering): Use w3m-string-match-p instead
 of string-match-p that is not available in Emacs 21~22 and XEmacs.
(w3m-read-int-interactive): Use w3m-substring-no-properties instead of
 substring-no-properties that is not available in Emacs 21, XEmacs 21.4,
 and SXEmacs.
(w3m-linknum-follow): Remove the 5th arg passed to read-string.  It is
 not available in XEmacs.

BTW, I wondered why the macro `w3m-replace-regexps-in-string',
that calls itself recursively, works.  Yes, it works.  But I'd
been believing that the `funcall' to a compiled macro causes the
`invalid-function' error:

(defmacro foo () "foo")
(funcall 'foo)

It likely happens when compiling a Lisp code without loading the
macro definition, though I guess the code in question probably
uses another way than `funcall'.  (I made it a normal Lisp
function so that it may be easily traced  to know how it works.)