aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love1999-09-06 21:20:57 +0000
committerDave Love1999-09-06 21:20:57 +0000
commit32a605b478e867eda2179b7cf673beb26f7b58b4 (patch)
tree4b6a623bb403181481f9ba1955c17527c4693d8d
parente22730400f8b596027f8d01e1f51119e02f72367 (diff)
downloademacs-32a605b478e867eda2179b7cf673beb26f7b58b4.tar.gz
emacs-32a605b478e867eda2179b7cf673beb26f7b58b4.zip
Don't conditionally define caddr.
(quickurl-url-comment): Use nth, not caddr in function and defsetf.
-rw-r--r--lisp/quickurl.el15
1 files changed, 2 insertions, 13 deletions
diff --git a/lisp/quickurl.el b/lisp/quickurl.el
index aaf68650c07..e87e12409ff 100644
--- a/lisp/quickurl.el
+++ b/lisp/quickurl.el
@@ -98,17 +98,6 @@
98 (defmacro defcustom (symbol init docstring &rest rest) 98 (defmacro defcustom (symbol init docstring &rest rest)
99 `(defvar ,symbol ,init ,docstring)))) 99 `(defvar ,symbol ,init ,docstring))))
100 100
101;; `caddr' is a function in cl and so might not always be available
102;; (remembering the general rule that says cl functions should not be used,
103;; only cl macros). So, to make use of `caddr' without forcing the load of
104;; cl-seq we'll define our own.
105
106(eval-when (load eval)
107 (unless (fboundp 'caddr)
108 (defun caddr (l)
109 "Return the `car' of the `cddr' of L."
110 (car (cddr l)))))
111
112;; Customize options. 101;; Customize options.
113 102
114(defgroup quickurl nil 103(defgroup quickurl nil
@@ -238,7 +227,7 @@ Note that this function is a setfable place."
238If the URL has no comment an empty string is returned. Also note that this 227If the URL has no comment an empty string is returned. Also note that this
239function is a setfable place." 228function is a setfable place."
240 (if (quickurl-url-commented-p url) 229 (if (quickurl-url-commented-p url)
241 (caddr url) 230 (nth 2 url)
242 "")) 231 ""))
243 232
244(defsetf quickurl-url-comment (url) (store) 233(defsetf quickurl-url-comment (url) (store)
@@ -246,7 +235,7 @@ function is a setfable place."
246 (if (quickurl-url-commented-p ,url) 235 (if (quickurl-url-commented-p ,url)
247 (if (zerop (length ,store)) 236 (if (zerop (length ,store))
248 (setf (cdr ,url) (cadr ,url)) 237 (setf (cdr ,url) (cadr ,url))
249 (setf (caddr ,url) ,store)) 238 (setf (nth 2 ,url) ,store))
250 (unless (zerop (length ,store)) 239 (unless (zerop (length ,store))
251 (setf (cdr ,url) (list (cdr ,url) ,store))))) 240 (setf (cdr ,url) (list (cdr ,url) ,store)))))
252 241