rpms/emacs-common-muse/devel muse-3.03-fixes.patch, NONE, 1.1 emacs-common-muse.spec, 1.17, 1.18

Jonathan G. Underwood (jgu) fedora-extras-commits at redhat.com
Thu Jul 12 21:22:10 UTC 2007


Author: jgu

Update of /cvs/extras/rpms/emacs-common-muse/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26611

Modified Files:
	emacs-common-muse.spec 
Added Files:
	muse-3.03-fixes.patch 
Log Message:
* Thu Jul 12 2007 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 3.03-3
- Added patch with various fixes from upstream maintainer to fix issues raised
  in BZ 247369


muse-3.03-fixes.patch:

--- NEW FILE muse-3.03-fixes.patch ---
Only in muse: {arch}
Only in muse: .arch-ids
diff -ru muse-3.03/ChangeLog muse/ChangeLog
--- muse-3.03/ChangeLog	2007-06-17 18:13:56.000000000 +0100
+++ muse/ChangeLog	2007-07-12 22:00:06.000000000 +0100
@@ -1,3 +1,43 @@
+2007-07-12  Michael Olson  <mwolson at gnu.org>
+
+	* lisp/muse-wiki.el (muse-wiki-interwiki-regexp): Set to nil by
+	default, rather than the empty string.  This really fixes the bug
+	that occurred when using Muse with muse-project-alist set to nil.
+	Thanks to Jonathan Underwood for the report.
+	(muse-wiki-update-interwiki-regexp): Set
+	muse-wiki-interwiki-regexp to nil if muse-project-alist is not
+	defined.
+	(muse-wiki-handle-implicit-interwiki)
+	(muse-wiki-handle-explicit-interwiki): Handle case where
+	muse-wiki-interwiki-regexp is nil.
+
+2007-07-10  Michael Olson  <mwolson at gnu.org>
+
+	* lisp/muse-mode.el (muse-grep): Abort search if the current
+	project contains no directories.
+
+	* lisp/muse-project.el (muse-project-file-alist): If
+	muse-project-alist is not defined, or project is nil, return nil
+	right away.  This ought to fix a bug that occurred when using Muse
+	with muse-project-alist set to nil.
+	(muse-project-of-file): Make sure muse-project-alist is not nil.
+	(muse-project-save-buffers): Make sure project is not nil.
+
+	* lisp/muse-wiki.el (muse-wiki-resolve-project-page): Deal with
+	case where muse-project-alist is nil.
+
+	* lisp/muse.el (muse-replace-regexp-in-string): Explicitly check
+	for XEmacs, since color-theme.el is poorly behaved, and defines
+	its own replace-in-string.  Bad color-theme.el -- no cookie for
+	you.
+
+2007-07-01  Michael Olson  <mwolson at gnu.org>
+
+	* lisp/muse-wiki.el (muse-wiki-handle-explicit-interwiki): Narrow
+	to the end of the link part, so as to exclude the description from
+	the match.  This fixes a bug with three-part links that have
+	descriptions.  Thanks to everyone who pointed it out.
+
 2007-06-17  Michael Olson  <mwolson at gnu.org>
 
 	* examples/QuickStart.muse: Make images local so that the Info
Only in muse/contrib: .arch-ids
Only in muse/contrib/pyblosxom: .arch-ids
Only in muse/etc: .arch-ids
Only in muse/examples: .arch-ids
Only in muse/examples/johnw: .arch-ids
Only in muse/examples/mwolson: .arch-ids
Only in muse/examples/mwolson/stylesheets: .arch-ids
Only in muse/examples/mwolson/templates: .arch-ids
Only in muse/experimental: .arch-ids
Only in muse/lisp: .arch-ids
Only in muse-3.03/lisp: muse-autoloads.el
diff -ru muse-3.03/lisp/muse.el muse/lisp/muse.el
--- muse-3.03/lisp/muse.el	2007-06-17 18:07:38.000000000 +0100
+++ muse/lisp/muse.el	2007-07-12 21:56:52.000000000 +0100
@@ -446,7 +446,7 @@
 If fourth arg FIXEDCASE is non-nil, do not alter case of replacement text.
 If fifth arg LITERAL is non-nil, insert REPLACEMENT literally."
   (cond
-   ((fboundp 'replace-in-string)
+   ((and (featurep 'xemacs) (fboundp 'replace-in-string))
     (replace-in-string text regexp replacement literal))
    ((fboundp 'replace-regexp-in-string)
     (replace-regexp-in-string regexp replacement text fixedcase literal))
diff -ru muse-3.03/lisp/muse-mode.el muse/lisp/muse-mode.el
--- muse-3.03/lisp/muse-mode.el	2007-06-16 00:06:37.000000000 +0100
+++ muse/lisp/muse-mode.el	2007-07-12 21:56:52.000000000 +0100
@@ -722,16 +722,19 @@
                             (shell-quote-argument
                              (expand-file-name dir)))
                           muse-directories " ")))
-    (while (string-match "%W" str)
-      (setq str (replace-match string t t str)))
-    (while (string-match "%D" str)
-      (setq str (replace-match dirs t t str)))
-    (if (fboundp 'compilation-start)
-        (compilation-start str nil (lambda (&rest args) "*search*")
-                           grep-regexp-alist)
-      (and (fboundp 'compile-internal)
-           (compile-internal str "No more search hits" "search"
-                             nil grep-regexp-alist)))))
+    (if (string= dirs "")
+        (muse-display-warning
+         "No directories were found in the current project; aborting search")
+      (while (string-match "%W" str)
+        (setq str (replace-match string t t str)))
+      (while (string-match "%D" str)
+        (setq str (replace-match dirs t t str)))
+      (if (fboundp 'compilation-start)
+          (compilation-start str nil (lambda (&rest args) "*search*")
+                             grep-regexp-alist)
+        (and (fboundp 'compile-internal)
+             (compile-internal str "No more search hits" "search"
+                               nil grep-regexp-alist))))))
 
 ;;;###autoload
 (defun muse-search-with-command (text)
diff -ru muse-3.03/lisp/muse-project.el muse/lisp/muse-project.el
--- muse-3.03/lisp/muse-project.el	2007-06-17 18:13:06.000000000 +0100
+++ muse/lisp/muse-project.el	2007-07-12 21:56:52.000000000 +0100
@@ -436,58 +436,59 @@
 contents have changed.  On Windows, it is always reread from
 disk."
   (setq project (muse-project project))
-  (let* ((file-alist (assoc (car project) muse-project-file-alist))
-         (last-mod (cdr (cdr file-alist))))
-    ;; Determine the last modified of any directory mentioned in the
-    ;; project's pattern list
-    (unless (or muse-under-windows-p no-check-p)
-      (let ((pats (cadr project)))
-        (while pats
-          (if (symbolp (car pats))
-              (setq pats (cddr pats))
-            (let* ((fnd (file-name-directory (car pats)))
-                   (dir (cond ((file-directory-p (car pats))
-                               (car pats))
-                              ((and (not (file-readable-p (car pats)))
-                                    fnd
-                                    (file-directory-p fnd))
-                               fnd))))
-              (when dir
-                (let ((mod-time (nth 5 (file-attributes dir))))
-                  (when (or (null last-mod)
-                            (and mod-time
-                                 (muse-time-less-p last-mod mod-time)))
-                    (setq last-mod mod-time)))))
-            (setq pats (cdr pats))))))
-    ;; Either return the currently known list, or read it again from
-    ;; disk
-    (if (or (and no-check-p (cadr file-alist))
-            muse-updating-file-alist-p
-            (not (or muse-under-windows-p
-                     (null (cddr file-alist))
-                     (null last-mod)
-                     (muse-time-less-p (cddr file-alist) last-mod))))
-        (cadr file-alist)
-      (if file-alist
-          (setcdr (cdr file-alist) last-mod)
-        (setq file-alist (cons (car project) (cons nil last-mod))
-              muse-project-file-alist
-              (cons file-alist muse-project-file-alist)))
-      ;; Read in all of the file entries
-      (let ((muse-updating-file-alist-p t))
-        (prog1
-            (save-match-data
-              (setcar
-               (cdr file-alist)
-               (let* ((names (list t))
-                      (pats (cadr project)))
-                 (while pats
-                   (if (symbolp (car pats))
-                       (setq pats (cddr pats))
-                     (nconc names (muse-project-file-entries (car pats)))
-                     (setq pats (cdr pats))))
-                 (cdr names))))
-          (run-hooks 'muse-project-file-alist-hook))))))
+  (when (and project muse-project-alist)
+    (let* ((file-alist (assoc (car project) muse-project-file-alist))
+           (last-mod (cdr (cdr file-alist))))
+      ;; Determine the last modified of any directory mentioned in the
+      ;; project's pattern list
+      (unless (or muse-under-windows-p no-check-p)
+        (let ((pats (cadr project)))
+          (while pats
+            (if (symbolp (car pats))
+                (setq pats (cddr pats))
+              (let* ((fnd (file-name-directory (car pats)))
+                     (dir (cond ((file-directory-p (car pats))
+                                 (car pats))
+                                ((and (not (file-readable-p (car pats)))
+                                      fnd
+                                      (file-directory-p fnd))
+                                 fnd))))
+                (when dir
+                  (let ((mod-time (nth 5 (file-attributes dir))))
+                    (when (or (null last-mod)
+                              (and mod-time
+                                   (muse-time-less-p last-mod mod-time)))
+                      (setq last-mod mod-time)))))
+              (setq pats (cdr pats))))))
+      ;; Either return the currently known list, or read it again from
+      ;; disk
+      (if (or (and no-check-p (cadr file-alist))
+              muse-updating-file-alist-p
+              (not (or muse-under-windows-p
+                       (null (cddr file-alist))
+                       (null last-mod)
+                       (muse-time-less-p (cddr file-alist) last-mod))))
+          (cadr file-alist)
+        (if file-alist
+            (setcdr (cdr file-alist) last-mod)
+          (setq file-alist (cons (car project) (cons nil last-mod))
+                muse-project-file-alist
+                (cons file-alist muse-project-file-alist)))
+        ;; Read in all of the file entries
+        (let ((muse-updating-file-alist-p t))
+          (prog1
+              (save-match-data
+                (setcar
+                 (cdr file-alist)
+                 (let* ((names (list t))
+                        (pats (cadr project)))
+                   (while pats
+                     (if (symbolp (car pats))
+                         (setq pats (cddr pats))
+                       (nconc names (muse-project-file-entries (car pats)))
+                       (setq pats (cdr pats))))
+                   (cdr names))))
+            (run-hooks 'muse-project-file-alist-hook)))))))
 
 (defun muse-project-of-file (&optional pathname)
   "Determine which project the given PATHNAME relates to.
@@ -497,6 +498,7 @@
     (unless pathname (setq pathname (muse-current-file)))
     (save-match-data
       (when (and (stringp pathname)
+                 muse-project-alist
                  (not (string= pathname ""))
                  (not (let ((case-fold-search nil))
                         (or (string-match muse-project-ignore-regexp
@@ -742,33 +744,34 @@
 
 (defun muse-project-save-buffers (&optional project)
   (setq project (muse-project project))
-  (map-y-or-n-p
-   (function
-    (lambda (buffer)
-      (and (buffer-modified-p buffer)
-           (not (buffer-base-buffer buffer))
-           (or (buffer-file-name buffer)
-               (progn
-                 (set-buffer buffer)
-                 (and buffer-offer-save
-                      (> (buffer-size) 0))))
-           (with-current-buffer buffer
-             (let ((proj (muse-project-of-file)))
-               (and proj (string= (car proj)
-                                  (car project)))))
-           (if (buffer-file-name buffer)
-               (format "Save file %s? "
-                       (buffer-file-name buffer))
-             (format "Save buffer %s? "
-                     (buffer-name buffer))))))
-   (function
-    (lambda (buffer)
-      (set-buffer buffer)
-      (save-buffer)))
-   (buffer-list)
-   '("buffer" "buffers" "save")
-   (if (boundp 'save-some-buffers-action-alist)
-       save-some-buffers-action-alist)))
+  (when project
+    (map-y-or-n-p
+     (function
+      (lambda (buffer)
+        (and (buffer-modified-p buffer)
+             (not (buffer-base-buffer buffer))
+             (or (buffer-file-name buffer)
+                 (progn
+                   (set-buffer buffer)
+                   (and buffer-offer-save
+                        (> (buffer-size) 0))))
+             (with-current-buffer buffer
+               (let ((proj (muse-project-of-file)))
+                 (and proj (string= (car proj)
+                                    (car project)))))
+             (if (buffer-file-name buffer)
+                 (format "Save file %s? "
+                         (buffer-file-name buffer))
+               (format "Save buffer %s? "
+                       (buffer-name buffer))))))
+     (function
+      (lambda (buffer)
+        (set-buffer buffer)
+        (save-buffer)))
+     (buffer-list)
+     '("buffer" "buffers" "save")
+     (if (boundp 'save-some-buffers-action-alist)
+         save-some-buffers-action-alist))))
 
 (defun muse-project-publish-default (project styles &optional force)
   "Publish the pages of PROJECT that need publishing."
diff -ru muse-3.03/lisp/muse-wiki.el muse/lisp/muse-wiki.el
--- muse-3.03/lisp/muse-wiki.el	2007-06-14 03:19:39.000000000 +0100
+++ muse/lisp/muse-wiki.el	2007-07-12 22:00:06.000000000 +0100
@@ -117,7 +117,7 @@
   :type 'boolean
   :group 'muse-wiki)
 
-(defvar muse-wiki-interwiki-regexp ""
+(defvar muse-wiki-interwiki-regexp nil
   "Regexp that matches all interwiki links.
 
 This is automatically generated by setting `muse-wiki-interwiki-alist'.
@@ -157,7 +157,8 @@
 (defun muse-wiki-update-interwiki-regexp ()
   "Update the value of `muse-wiki-interwiki-regexp' based on
 `muse-wiki-interwiki-alist' and `muse-project-alist'."
-  (when muse-project-alist
+  (if (null muse-project-alist)
+      (setq muse-wiki-interwiki-regexp nil)
     (setq muse-wiki-interwiki-regexp
           (concat "\\<\\(" (regexp-opt (mapcar #'car muse-project-alist))
                   (when muse-wiki-interwiki-alist
@@ -238,9 +239,10 @@
                     (car muse-project-alist))
         page (or page (muse-get-keyword :default
                                         (cadr project))))
-  (let* ((page-path (muse-project-page-file page project))
-         (remote-styles (when page-path (muse-project-applicable-styles
-                                         page-path (cddr project))))
+  (let* ((page-path (and muse-project-alist
+                         (muse-project-page-file page project)))
+         (remote-styles (and page-path (muse-project-applicable-styles
+                                        page-path (cddr project))))
          (local-style (muse-project-current-output-style)))
     (cond ((and remote-styles local-style muse-publishing-p)
            (muse-project-resolve-link page local-style remote-styles))
@@ -260,8 +262,9 @@
   "If STRING or point has an interwiki link, resolve it to a filename.
 
 Match string 0 is set to the link."
-  (when (if string (string-match muse-wiki-interwiki-regexp string)
-          (looking-at muse-wiki-interwiki-regexp))
+  (when (and muse-wiki-interwiki-regexp
+             (if string (string-match muse-wiki-interwiki-regexp string)
+               (looking-at muse-wiki-interwiki-regexp)))
     (let* ((project (match-string 1 string))
            (subst (cdr (assoc project muse-wiki-interwiki-alist)))
            (word (match-string 3 string))
@@ -281,8 +284,11 @@
 (defun muse-wiki-handle-explicit-interwiki (&optional string)
   "If STRING or point has an interwiki link, resolve it to a filename."
   (let ((right-pos (if string (length string) (match-end 1))))
-    (when (if string (string-match muse-wiki-interwiki-regexp string)
-            (looking-at muse-wiki-interwiki-regexp))
+    (when (and muse-wiki-interwiki-regexp
+               (if string (string-match muse-wiki-interwiki-regexp string)
+                 (save-restriction
+                   (narrow-to-region (point) right-pos)
+                   (looking-at muse-wiki-interwiki-regexp))))
       (let* ((project (match-string 1 string))
              (subst (cdr (assoc project muse-wiki-interwiki-alist)))
              (anchor (and (match-beginning 4)
Only in muse/scripts: .arch-ids
Only in muse/texi: .arch-ids


Index: emacs-common-muse.spec
===================================================================
RCS file: /cvs/extras/rpms/emacs-common-muse/devel/emacs-common-muse.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- emacs-common-muse.spec	2 Jul 2007 20:35:40 -0000	1.17
+++ emacs-common-muse.spec	12 Jul 2007 21:21:38 -0000	1.18
@@ -11,7 +11,7 @@
 
 Name: emacs-common-muse
 Version: 3.03
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: Emacs Muse is an authoring and publishing environment for Emacs
 Group: Applications/Editors
 License: GPL        
@@ -21,6 +21,7 @@
 
 BuildArch: noarch
 Source0: http://download.gna.org/muse-el/%{pkg}-%{version}.tar.gz
+Patch0: muse-3.03-fixes.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: emacs >= %{emacs_ver}
@@ -83,6 +84,7 @@
 
 %prep
 %setup -q -n %{pkg}-%{version}
+%patch0 -p1
 
 %build 
 # Note that %{_smp_mflags} causes make to hang sometimes here.
@@ -193,6 +195,10 @@
 %endif
 
 %changelog
+* Thu Jul 12 2007 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 3.03-3
+- Added patch with various fixes from upstream maintainer to fix issues raised
+  in BZ 247369
+
 * Mon Jul  2 2007 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 3.03-2
 - Add BuildRequires for tetex-latex so pdf files get built
 




More information about the fedora-extras-commits mailing list