[slime-cvs] CVS slime

CVS User trittweiler trittweiler at common-lisp.net
Fri Mar 6 23:23:53 UTC 2009


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv5623

Modified Files:
	ChangeLog slime.el 
Log Message:
	* slime.el ([portability] getf): Redefine `getf' on Emacs21 to
	work on malformed plists like it does on later Emacsen. This made
	the `find-local-definitions' test case fail on Emacs21.


--- /project/slime/cvsroot/slime/ChangeLog	2009/03/04 20:40:01	1.1708
+++ /project/slime/cvsroot/slime/ChangeLog	2009/03/06 23:23:52	1.1709
@@ -1,3 +1,9 @@
+2009-03-07  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	* slime.el ([portability] getf): Redefine `getf' on Emacs21 to
+	work on malformed plists like it does on later Emacsen. This made
+	the `find-local-definitions' test case fail on Emacs21.
+
 2009-03-04  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	* slime.el (slime-check-fancy-symbol-name): Use
--- /project/slime/cvsroot/slime/slime.el	2009/03/04 20:40:02	1.1142
+++ /project/slime/cvsroot/slime/slime.el	2009/03/06 23:23:52	1.1143
@@ -8270,8 +8270,12 @@
 (when (featurep 'xemacs)
   (require 'overlay))
 
+(defun slime-emacs-21-p ()
+  (and (not (featurep 'xemacs))
+       (= emacs-major-version 21)))
+
 (if (and (featurep 'emacs) (>= emacs-major-version 22))
-    ;;;  N.B. The 2nd, and 6th return value cannot be relied upon.
+    ;;  N.B. The 2nd, and 6th return value cannot be relied upon.
     (defun slime-current-parser-state ()
       ;; `syntax-ppss' does not save match data as it invokes
       ;; `beginning-of-defun' implicitly which does not save match
@@ -8284,6 +8288,18 @@
           (beginning-of-defun)
           (parse-partial-sexp (point) original-pos)))))
 
+;;; `getf', `get', `symbol-plist' do not work on malformed plists
+;;; on Emacs21. On later versions they do.
+(when (slime-emacs-21-p)
+  ;; Perhaps we should rather introduce a new `slime-getf' than
+  ;; redefining. But what about (setf getf)? (A redefinition is not
+  ;; necessary, except for consistency.)
+  (defun getf (plist property &optional default)
+    (loop for (prop . val) on plist 
+          when (eq prop property) return (car val)
+          finally (return default))))
+
+
 (defun slime-split-string (string &optional separators omit-nulls)
   "This is like `split-string' in Emacs22, but also works in 21."
   (let ((splits (split-string string separators)))
@@ -8636,9 +8652,6 @@
      (select-window ,window)
      , at body))
 
-(defun slime-emacs-21-p ()
-  (and (not (featurep 'xemacs))
-       (= emacs-major-version 21)))
 
 (when (featurep 'xemacs)
   (add-hook 'sldb-hook 'sldb-xemacs-emulate-point-entered-hook))





More information about the slime-cvs mailing list