]> code.delx.au - gnu-emacs-elpa/commitdiff
Miscellaneous cleanup.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 15 Oct 2014 20:47:38 +0000 (16:47 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 15 Oct 2014 20:47:38 +0000 (16:47 -0400)
* muse/muse-publish.el (muse-current-output-style): Declare.
* muse/muse-project.el (muse-project-set-variables): Only call
make-local-hook if it exists.
* muse/muse-html.el (muse-html-src-tag): Use font-lock-ensure
when available.
* muse/muse-project.el (muse-project-alist-get, muse-project-alist-set):
* muse/muse-blosxom.el (muse-blosxom-new-entry): Avoid add-to-list
on local var.
* muse/htmlize-hack.el: Require `cl' at run-time as well.
* muse/cgi.el (cgi-decode): Avoid `flet'.

packages/muse/cgi.el
packages/muse/htmlize-hack.el
packages/muse/muse-backlink.el
packages/muse/muse-blosxom.el
packages/muse/muse-html.el
packages/muse/muse-project.el
packages/muse/muse-publish.el

index 936b33f4d1103fd013cb82cab535c55b3980621d..0e85a52e7f89a5db0087cf04d4c0cd08b35647b1 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cgi.el -- Using Emacs for CGI scripting
 
 ;;; cgi.el -- Using Emacs for CGI scripting
 
-;; Copyright (C) 2000, 2006, 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2006, 2012, 2014 Free Software Foundation, Inc.
 
 ;; Author: Eric Marsden  <emarsden@laas.fr>
 ;;         Michael Olson <mwolson@gnu.org> (slight modifications)
 
 ;; Author: Eric Marsden  <emarsden@laas.fr>
 ;;         Michael Olson <mwolson@gnu.org> (slight modifications)
 ;; Substrings are plus-decoded and then URI-decoded.
 (defun cgi-decode (q)
   (when q
 ;; Substrings are plus-decoded and then URI-decoded.
 (defun cgi-decode (q)
   (when q
-    (flet ((split-= (str)
-           (let ((pos (or (cgi-position ?= str) 0)))
-             (cons (cgi-decode-string (substring str 0 pos))
-                   (cgi-decode-string (substring str (+ pos 1)))))))
-      (mapcar #'split-= (split-string q "&")))))
+    (let ((split-=
+           (lambda (str)
+             (let ((pos (or (cgi-position ?= str) 0)))
+               (cons (cgi-decode-string (substring str 0 pos))
+                     (cgi-decode-string (substring str (+ pos 1))))))))
+      (mapcar split-= (split-string q "&")))))
 
 (defun cgi-lose (fmt &rest args)
   (let ((why (apply #'format fmt args)))
 
 (defun cgi-lose (fmt &rest args)
   (let ((why (apply #'format fmt args)))
index e6239464658580979622f046af95f86e9dcec1ea..61627b66aec6b21885e355097297a0578250fa36 100644 (file)
@@ -2,7 +2,7 @@
 ;; To use it, add the path to this directory to your load path and
 ;; add (require 'htmlize-hack) to your Emacs init file.
 
 ;; To use it, add the path to this directory to your load path and
 ;; add (require 'htmlize-hack) to your Emacs init file.
 
-(eval-when-compile (require 'cl))
+(require 'cl)
 (if t (require 'htmlize))               ; Don't load during compilation.
 
 (when (equal htmlize-version "1.34")
 (if t (require 'htmlize))               ; Don't load during compilation.
 
 (when (equal htmlize-version "1.34")
index bc21dddde8caf72ae5cd31d3b46766f77ee744ac..d5b7ebdf8a05184964a3abc73082a3f261d3fe0f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; muse-backlink.el --- backlinks for Muse
 
 ;;; muse-backlink.el --- backlinks for Muse
 
-;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2014
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Jim Ottaway <j.ottaway@lse.ac.uk>
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Jim Ottaway <j.ottaway@lse.ac.uk>
@@ -261,7 +261,7 @@ The parent buffer of the forthcomingly visited muse page.")
       (save-buffer)
       (when muse-backlink-parent-buffer
         (with-current-buffer muse-backlink-parent-buffer
       (save-buffer)
       (when muse-backlink-parent-buffer
         (with-current-buffer muse-backlink-parent-buffer
-          (font-lock-fontify-buffer))))
+          (font-lock-fontify-buffer)))) ;FIXME: Why?  --Stef
     (setq muse-backlink-links nil
           muse-backlink-parent-buffer nil
           muse-backlink-pending nil)
     (setq muse-backlink-links nil
           muse-backlink-parent-buffer nil
           muse-backlink-pending nil)
index 78038d703e1e30bb7e4163ba8a72ee1eccb78a99..d7bce9c40cab5924751ad483bb7b21548433a7a1 100644 (file)
@@ -1,6 +1,6 @@
 ;;; muse-blosxom.el --- publish a document tree for serving by (py)Blosxom
 
 ;;; muse-blosxom.el --- publish a document tree for serving by (py)Blosxom
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Michael Olson <mwolson@gnu.org>
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Michael Olson <mwolson@gnu.org>
@@ -258,7 +258,8 @@ The page will be initialized with the current date and TITLE."
               (tags nil))
           (while (progn (setq tag (read-string "Tag (RET to continue): "))
                         (not (string= tag "")))
               (tags nil))
           (while (progn (setq tag (read-string "Tag (RET to continue): "))
                         (not (string= tag "")))
-            (add-to-list 'tags tag t))
+            (unless (member tag tags)
+              (setq tags (append tags (list tag)))))
           tags)
       (funcall muse-completing-read-function
                "Category: "
           tags)
       (funcall muse-completing-read-function
                "Category: "
index 6a9356bfb719c33cb424ac8c8447542a05cc7770..2473025f03767d7e911a397cc538d171ecc8a653 100644 (file)
@@ -1,6 +1,6 @@
 ;;; muse-html.el --- publish to HTML and XHTML
 
 ;;; muse-html.el --- publish to HTML and XHTML
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014
 ;;   Free Software Foundation, Inc.
 
 ;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
 ;;   Free Software Foundation, Inc.
 
 ;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
@@ -667,7 +667,9 @@ This tag requires htmlize 1.34 or later in order to work."
               (if (functionp mode)
                   (funcall mode)
                 (fundamental-mode))
               (if (functionp mode)
                   (funcall mode)
                 (fundamental-mode))
-              (font-lock-fontify-buffer)
+              (if (fboundp 'font-lock-ensure)
+                  (font-lock-ensure)
+                (font-lock-fontify-buffer))
               ;; silence the byte-compiler
               (when (fboundp 'htmlize-region-for-paste)
                 ;; transform the region to HTML
               ;; silence the byte-compiler
               (when (fboundp 'htmlize-region-for-paste)
                 ;; transform the region to HTML
index 7489706d1e82c8b340ef05fa3a37677105926245..d609735766cca6d9b570c01f43703a211b6ece83 100644 (file)
@@ -1,6 +1,6 @@
 ;;; muse-project.el --- handle Muse projects
 
 ;;; muse-project.el --- handle Muse projects
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014
 ;;   Free Software Foundation, Inc.
 
 ;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
 ;;   Free Software Foundation, Inc.
 
 ;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
@@ -86,11 +86,13 @@ has been modified via the customize interface.")
           ;; Turn settings of first part into cons cells, symbol->string
           (while head
             (cond ((stringp (car head))
           ;; Turn settings of first part into cons cells, symbol->string
           (while head
             (cond ((stringp (car head))
-                   (add-to-list 'res (car head) t)
+                   (unless (member (car head) res)
+                     (setq res (append res (list (car head)))))
                    (setq head (cdr head)))
                   ((symbolp (car head))
                    (setq head (cdr head)))
                   ((symbolp (car head))
-                   (add-to-list 'res (list (symbol-name (car head))
-                                           (cadr head)) t)
+                   (let ((x (list (symbol-name (car head)) (cadr head))))
+                     (unless (member x res)
+                       (setq res (append res (list x)))))
                    (setq head (cddr head)))
                   (t
                    (setq head (cdr head)))))
                    (setq head (cddr head)))
                   (t
                    (setq head (cdr head)))))
@@ -123,10 +125,13 @@ Muse can make use of."
         ;; Turn cons cells into flat list, string->symbol
         (while head
           (cond ((stringp (car head))
         ;; Turn cons cells into flat list, string->symbol
         (while head
           (cond ((stringp (car head))
-                 (add-to-list 'res (car head) t))
+                 (unless (member (car head) res)
+                   (setq res (append res (list (car head))))))
                 ((consp (car head))
                 ((consp (car head))
-                 (add-to-list 'res (intern (caar head)) t)
-                 (add-to-list 'res (car (cdar head)) t)))
+                 (let ((x (intern (caar head)))
+                       (y (car (cdar head))))
+                   (unless (member x res) (setq res (append res (list x))))
+                   (unless (member y res) (setq res (append res (list y)))))))
           (setq head (cdr head)))
         (setcdr (car val) (cons res (cdr (cdar val)))))
       (let ((styles (cdar val)))
           (setq head (cdr head)))
         (setcdr (car val) (cons res (cdr (cdar val)))))
       (let ((styles (cdar val)))
@@ -942,7 +947,8 @@ prompting for one."
       (setq sym (car vars))
       (setq custom-set (or (get sym 'custom-set) 'set))
       (setq var (if (eq (get sym 'custom-type) 'hook)
       (setq sym (car vars))
       (setq custom-set (or (get sym 'custom-set) 'set))
       (setq var (if (eq (get sym 'custom-type) 'hook)
-                    (make-local-hook sym)
+                    (if (fboundp 'make-local-hook)
+                        (make-local-hook sym))
                   (make-local-variable sym)))
       (funcall custom-set var (car (cdr vars)))
       (setq vars (cdr (cdr vars))))))
                   (make-local-variable sym)))
       (funcall custom-set var (car (cdr vars)))
       (setq vars (cdr (cdr vars))))))
index ec6e176e3fb1bcfa6b43d9ece249290d861f28ed..cbcd4158e7d88eb11466df1d942ce61acf614090 100644 (file)
@@ -1,6 +1,6 @@
 ;;; muse-publish.el --- base publishing implementation
 
 ;;; muse-publish.el --- base publishing implementation
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014
 ;;   Free Software Foundation, Inc.
 
 ;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
 ;;   Free Software Foundation, Inc.
 
 ;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
@@ -845,6 +845,8 @@ the file is published no matter what."
             (muse-style-run-hooks :final style file output-path target)))
         t))))
 
             (muse-style-run-hooks :final style file output-path target)))
         t))))
 
+(defvar muse-current-output-style)
+
 ;;;###autoload
 (defun muse-publish-this-file (style output-dir &optional force)
   "Publish the currently-visited file.
 ;;;###autoload
 (defun muse-publish-this-file (style output-dir &optional force)
   "Publish the currently-visited file.