From e6ce3abd2a033dc8515886ab52b449ce428a6122 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Mon, 29 Aug 2005 06:04:51 +0000 Subject: [PATCH] Reinstate former extended character class rules. * lisp/muse-regexps.el (muse-regexp-use-character-classes): Looks like extended regexps really don't work well on Emacs 21.2 or 21.3, so document that. (muse-regexp-emacs-revision): New variable that indicates the revision number of this version of Emacs. (muse-extreg-usable-p): Reinstate old rules -- Emacs 21.2 and 21.3 aren't working well enough with extended character classes in regexps. * lisp/muse.el (muse-version): If INSERT option is given, insert the text instead of just displaying it. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-212 --- ChangeLog | 22 ++++++++++++++++++++++ lisp/muse-regexps.el | 25 ++++++++++++++++++------- lisp/muse.el | 11 +++++++---- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17a0f04..89b647c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,28 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-08-29 06:04:51 GMT Michael Olson patch-212 + + Summary: + Reinstate former extended character class rules. + Revision: + muse--main--1.0--patch-212 + + * lisp/muse-regexps.el (muse-regexp-use-character-classes): Looks like + extended regexps really don't work well on Emacs 21.2 or 21.3, so + document that. + (muse-regexp-emacs-revision): New variable that indicates the revision + number of this version of Emacs. + (muse-extreg-usable-p): Reinstate old rules -- Emacs 21.2 and 21.3 + aren't working well enough with extended character classes in regexps. + + * lisp/muse.el (muse-version): If INSERT option is given, insert the text + instead of just displaying it. + + modified files: + ChangeLog lisp/muse-regexps.el lisp/muse.el + + 2005-08-28 23:59:03 GMT Michael Olson patch-211 Summary: diff --git a/lisp/muse-regexps.el b/lisp/muse-regexps.el index 2cdaba6..20e045b 100644 --- a/lisp/muse-regexps.el +++ b/lisp/muse-regexps.el @@ -42,17 +42,24 @@ "Indicate whether to use extended character classes like [:space:]. If 'undecided, Muse will use them if your emacs is known to support them. -Emacs 22 and Emacs 21.3.50 are known to support them, XEmacs does -not support them +Emacs 22 and Emacs 21.3.50 are known to support them. XEmacs +does not support them. -Emacs 21.2 or higher might support them, but the maintainer is -uncertain, so by default extended regexps are not used with these -versions of Emacs." +Emacs 21.2 or higher support them, but with enough annoying edge +cases that the sanest default is to leave them disabled." :type '(choice (const :tag "Yes" t) (const :tag "No" nil) (const :tag "Let Muse decide" undecided)) :group 'muse-regexp) +(defvar muse-regexp-emacs-revision + (and (save-match-data + (string-match "^[0-9]+\\.[0-9]+\\.\\([0-9]+\\)" + emacs-version)) + (match-string 1 emacs-version) + (string-to-number (match-string 1 emacs-version))) + "The revision number of this version of Emacs.") + (defun muse-extreg-usable-p () "Return non-nil if extended character classes can be used, nil otherwise. @@ -65,9 +72,13 @@ options." ((eq muse-regexp-use-character-classes nil) nil) ((featurep 'xemacs) nil) ; unusable on XEmacs - ((> emacs-major-version 21) t) + ((> emacs-major-version 21) t) ; usable if > 21 ((< emacs-major-version 21) nil) - ((> emacs-minor-version 2) t) + ((< emacs-minor-version 3) nil) + ;; don't use if version is of format 21.x + ((null muse-regexp-emacs-revision) nil) + ;; only trust 21.3.50 or higher + ((>= muse-regexp-emacs-revision 50) t) (t nil))) (defcustom muse-regexp-blank diff --git a/lisp/muse.el b/lisp/muse.el index dc4a1af..e1c4d9b 100644 --- a/lisp/muse.el +++ b/lisp/muse.el @@ -48,10 +48,13 @@ (defvar muse-version "3.01.91 (3.02 RC2)" "The version of Muse currently loaded") -(defun muse-version () - "Display the version of Muse that is currently loaded." - (interactive) - (message muse-version)) +(defun muse-version (&optional insert) + "Display the version of Muse that is currently loaded. +If INSERT is non-nil, insert the text instead of displaying it." + (interactive "P") + (if insert + (insert muse-version) + (message muse-version))) (defgroup muse nil "Options controlling the behavior of Muse. -- 2.11.4.GIT