Python mode - `C-c |' feature suggestion

François Pinard pinard at iro.umontreal.ca
Tue Feb 22 22:55:34 CET 2000


Alex <alex at somewhere.round.here> writes:

> Must-be-an-anti-XEmacs-conspiracy'ly

I sometimes wonder, yes.  (Even if I don't use XEmacs much myself :-).

> > The `-no-properties' functions are less portable.

> It just popped up when I hit complete.

Just to be complete, it does happen that properties get in the way.
In some portable code, I use this:


;; Protect string comparisons from text properties if possible.
(eval-and-compile
  (fset 'po-buffer-substring
	(symbol-function (if (fboundp 'buffer-substring-no-properties)
			     'buffer-substring-no-properties
			   'buffer-substring)))
  (if (fboundp 'match-string-no-properties)
      (fset 'po-match-string (symbol-function 'match-string-no-properties))

    (defun po-match-string (number)
      "Return string of text matched by last search."
      (po-buffer-substring (match-beginning number) (match-end number)))))

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list