From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard KLINDA Subject: [BUG]: function looking-back (XEmacs incompatibility) Date: Wed, 02 Dec 2009 01:37:35 +0100 Message-ID: <878wdmw6r4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFdBj-0000cY-Lp for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 19:35:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFdBf-0000bp-4r for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 19:35:23 -0500 Received: from [199.232.76.173] (port=51816 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFdBe-0000bm-W9 for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 19:35:19 -0500 Received: from viefep15-int.chello.at ([62.179.121.35]:9561) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFdBe-0004Eg-G4 for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 19:35:18 -0500 Received: from edge04.upc.biz ([192.168.13.239]) by viefep15-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091202003516.YIWZ10074.viefep15-int.chello.at@edge04.upc.biz> for ; Wed, 2 Dec 2009 01:35:16 +0100 Received: from ignotus by localhost with local (masqmail 0.2.21) id 1NFdDr-6oK-00 for ; Wed, 02 Dec 2009 01:37:35 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org XEmacs and older Emacs (22 and below) don't have the function LOOKING-BACK. I've found a definiton of it here: http://moinmo.in/EmacsForMoinMoin ,---- | (or (fboundp 'looking-back) | ; taken straight out of http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/subr.el?rev=1.530&view=auto | (defun looking-back (regexp &optional limit greedy) | "Return non-nil if text before point matches regular expression REGEXP. | 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 | before LIMIT. | 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)) | (pos | (save-excursion | (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t) | (point))))) | (if (and greedy pos) | (save-restriction | (narrow-to-region (point-min) start) | (while (and (> pos (point-min)) | (save-excursion | (goto-char pos) | (backward-char 1) | (looking-at (concat "\\(?:" regexp "\\)\\'")))) | (setq pos (1- pos))) | (save-excursion | (goto-char pos) | (looking-at (concat "\\(?:" regexp "\\)\\'"))))) | (not (null pos))))) `---- -- Richard