xemacs or Python mode
andreas.roehler at online.de
Sun Apr 17 15:07:13 EDT 2011
Am 17.04.2011 05:22, schrieb Jerry James:
> On Fri, Apr 15, 2011 at 11:59 PM, Eric S. Johansson<esj at harvee.org> wrote:
>> In some buffers of Python code and not others when I press the backspace key, it
>> tells me:
>> symbols function definition is void: looking-back.
>> I'm testing out on the latest branches of Python-mode and I'm trying to figure
>> out if this is something I'm doing wrong with xemacs or it is a bug.
>> What do I need to do to debug this?
> Options->Troubleshooting->Debug on Error
> Then provoke the problem and show us the backtrace. We need to know
> which code is calling the looking-back function which, as far as I
> know, has never been ported from Emacs.
IIRC sent a patch implementing it around two years ago.
Maybe the GPLv3 question blocked it that time.
Provided it inside python-mode.el for now, so it should not be an issue
(when (featurep 'xemacs)
(unless (functionp 'looking-back)
;; from GNU Emacs subr.el
(defun looking-back (regexp &optional limit greedy)
"Return non-nil if text before point matches regular expression
Like `looking-at' except matches before point, and is slower.
LIMIT if non-nil speeds up the search by specifying a minimum
starting position, to avoid checking matches that would start
If GREEDY is non-nil, extend the match backwards as far as possible,
stopping when a single additional previous character cannot be part
of a match for REGEXP."
(let ((start (point))
(and (re-search-backward (concat "\\(?:" regexp
"\\)\\=") limit t)
(if (and greedy pos)
(narrow-to-region (point-min) start)
(while (and (> pos (point-min))
(looking-at (concat "\\(?:" regexp
(setq pos (1- pos)))
(looking-at (concat "\\(?:" regexp "\\)\\'")))))
(not (null pos))))))
More information about the XEmacs-Beta