Re: [Orgmode] [BUG]: function looking-back (XEmacs incompatibility)
Superb, thanks. >>>>> Regarding 'Re: [Orgmode] [BUG]: function looking-back (XEmacs >>>>> incompatibility)'; Carsten Dominik adds: > Hi RIchard, this code is already (and has been for a few weeks) in > org-compat.el -- Udv, Richard ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [BUG]: function looking-back (XEmacs incompatibility)
Hi RIchard, this code is already (and has been for a few weeks) in org-compat.el - Carsten On Dec 2, 2009, at 1:37 AM, Richard KLINDA wrote: 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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [BUG]: function looking-back (XEmacs incompatibility)
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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode