changeset 92814:31a0ecf62949

Remove the `function' in `(function (lambda'. Replace `(car (cdr' with cadr'. Formatting change - collect closing parens.
author Glenn Morris <rgm@gnu.org>
date Thu, 13 Mar 2008 03:32:41 +0000
parents 9c73b1f69e7e
children 8f33820cee18
files lisp/mail/supercite.el
diffstat 1 files changed, 69 insertions(+), 110 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/supercite.el	Thu Mar 13 03:29:35 2008 +0000
+++ b/lisp/mail/supercite.el	Thu Mar 13 03:32:41 2008 +0000
@@ -182,8 +182,8 @@
 		   (concat "\\("
 			   (sc-cite-regexp "")
 			   "\\)"
-			   (sc-cite-regexp sc-citation-nonnested-root-regexp))
-		   )))
+			   (sc-cite-regexp
+			    sc-citation-nonnested-root-regexp)))))
     ;; blank lines mean paragraph separators, so fill the last cited
     ;; paragraph, unless sc-cite-blank-lines-p is non-nil, in which
     ;; case we treat blank lines just like any other line.
@@ -210,8 +210,7 @@
     ;; citations, so cite it with a non-nested citation
     (t                          (sc-cite-line))
     ;; be sure when we're done that we fill the last cited paragraph.
-    (end                        (sc-fill-if-different ""))
-    )
+    (end                        (sc-fill-if-different "")))
   "Default REGI frame for citing a region."
   :type '(repeat (repeat sexp))
   :group 'supercite-frames)
@@ -221,8 +220,7 @@
   '(;; do nothing on a blank line
     ("^[ \t]*$"       nil)
     ;; if the line is cited, uncite it
-    ((sc-cite-regexp) (sc-uncite-line))
-    )
+    ((sc-cite-regexp) (sc-uncite-line)))
   "Default REGI frame for unciting a region."
   :type '(repeat (repeat sexp))
   :group 'supercite-frames)
@@ -238,8 +236,7 @@
     ;; otherwise, the line is uncited, so just cite it
     (t                (sc-cite-line))
     ;; be sure when we're done that we fill the last cited paragraph.
-    (end              (sc-fill-if-different ""))
-    )
+    (end              (sc-fill-if-different "")))
   "Default REGI frame for reciting a region."
   :type '(repeat (repeat sexp))
   :group 'supercite-frames)
@@ -479,8 +476,7 @@
     (sc-header-attributed-writes)
     (sc-header-author-writes)
     (sc-header-verbose)
-    (sc-no-blank-line-or-header)
-    )
+    (sc-no-blank-line-or-header))
   "List of reference header rewrite functions.
 The variable `sc-preferred-header-style' controls which function in
 this list is chosen for automatic reference header insertions.
@@ -619,11 +615,10 @@
 Note that WORD is a string and LETTER is a character.  All LETTERs in
 the list should be unique."
   (let* ((prompt (concat
-		  (mapconcat (function (lambda (elt) (car elt))) alist ", ")
+		  (mapconcat (lambda (elt) (car elt)) alist ", ")
 		  "? ("
 		  (mapconcat
-		   (function
-		    (lambda (elt) (char-to-string (cdr elt)))) alist "/")
+		   (lambda (elt) (char-to-string (cdr elt))) alist "/")
 		  ") "))
 	 (p prompt)
 	 (event
@@ -677,7 +672,7 @@
       (let* ((elem    (car alist))
 	     (infokey (car elem))
 	     (infoval (sc-mail-field infokey))
-	     (mlist   (car (cdr elem))))
+	     (mlist   (cadr elem)))
 	(while mlist
 	  (let* ((ml-elem (car mlist))
 		 (regexp  (car ml-elem))
@@ -688,10 +683,8 @@
 		      mlist nil
 		      alist nil)
 	      ;; else we didn't find a match
-	      (setq mlist (cdr mlist))
-	      )))			;end of mlist loop
-	(setq alist (cdr alist))
-	))				;end of alist loop
+	      (setq mlist (cdr mlist))))) ;end of mlist loop
+	(setq alist (cdr alist))))	  ;end of alist loop
     rtnvalue))
 
 
@@ -802,8 +795,7 @@
      ;; we never get far enough to interpret a frame if s-n-m-h == 'none
      ((eq sc-nuke-mail-headers 'none))
      (t (error "Invalid value for sc-nuke-mail-headers: %s"
-	       sc-nuke-mail-headers))
-     )					; end-cond
+	       sc-nuke-mail-headers)))	; end-cond
     (append
      (and entry-func
 	  (regi-mapcar sc-nuke-mail-header-list entry-func nil t))
@@ -812,8 +804,7 @@
 	  '(("^[ \t]+" (sc-mail-nuke-continuation-line))))
      '((begin     (setq sc-mail-last-header-zapped-p nil)))
      '((end       (sc-mail-cleanup-blank-lines)))
-     (and every-func (list (list 'every every-func)))
-     )))
+     (and every-func (list (list 'every every-func))))))
 
 ;; mail processing and zapping. this is the top level entry defun to
 ;; all header processing.
@@ -834,8 +825,7 @@
 	  (setq sc-mail-info info
 		sc-attributions attribs))
       (regi-interpret (sc-mail-build-nuke-frame)
-		      sc-mail-headers-start sc-mail-headers-end)
-      )))
+		      sc-mail-headers-start sc-mail-headers-end))))
 
 
 ;; let the user change mail field information
@@ -877,8 +867,7 @@
 			  (concat key ": ") (cdr keyval)
 			  'sc-mail-field-modification-history))))
        ((eq action ?a)
-	(push (cons key (read-string (concat key ": "))) sc-mail-info))
-       ))))
+	(push (cons key (read-string (concat key ": "))) sc-mail-info))))))
 
 
 ;; ======================================================================
@@ -908,8 +897,7 @@
 			      from 0))
 	(mend (match-end 0)))
     (and mstart
-	 (substring from (1+ mstart) (- mend (if (= mend eos) 0 1)))
-	 )))
+	 (substring from (1+ mstart) (- mend (if (= mend eos) 0 1))))))
 
 (defun sc-attribs-<>-addresses (from)
   "Extract the author's email terminus from email address FROM.
@@ -930,8 +918,7 @@
 	    address))
       (if (string-match "[-[:alnum:]!@%._]+" from 0)
 	  (match-string 0 from)
-	"")
-      )))
+	""))))
 
 (defun sc-attribs-emailname (from)
   "Get the email terminus name from FROM."
@@ -951,8 +938,7 @@
        (let ((sos (+ start extend))
 	     (eos (- end extend)))
 	 (substring string sos
-		    (or (string-match sc-titlecue-regexp string sos) eos)
-		    ))))
+		    (or (string-match sc-titlecue-regexp string sos) eos)))))
 
 (defun sc-attribs-extract-namestring (from)
   "Extract the name string from FROM.
@@ -997,16 +983,14 @@
          => (\"John\" \"Xavier\" \"Doe\")"
   (if (string-match "\\([ \t]*\\)\\([^ \t._]+\\)\\([ \t]*\\)" namestring)
       (cons (match-string 2 namestring)
-	    (sc-attribs-chop-namestring (substring namestring (match-end 3)))
-	    )))
+	    (sc-attribs-chop-namestring (substring namestring (match-end 3))))))
 
 (defun sc-attribs-strip-initials (namelist)
   "Extract the author's initials from the NAMELIST."
   (mapconcat
-   (function
-    (lambda (name)
-      (if (< 0 (length name))
-	  (substring name 0 1))))
+   (lambda (name)
+     (if (< 0 (length name))
+	 (substring name 0 1)))
    namelist ""))
 
 (defun sc-guess-attribution (&optional string)
@@ -1034,33 +1018,28 @@
 	(position -1)
 	keepers filtered-list)
     (mapc
-     (function
-      (lambda (name)
-	(setq position (1+ position))
-	(let ((keep-p t))
-	  (mapc
-	   (function
-	    (lambda (filter)
-	      (let ((regexp (car filter))
-		    (pos (cdr filter)))
-		(if (and (string-match regexp name)
-			 (or (and (numberp pos)
-				  (= pos position))
-			     (and (eq pos 'last)
-				  (= position (1- elements)))
-			     (eq pos 'any)))
-		    (setq keep-p nil))
-		)))
-	   sc-name-filter-alist)
-	  (if keep-p
-	      (setq keepers (cons position keepers)))
-	  )))
+     (lambda (name)
+       (setq position (1+ position))
+       (let ((keep-p t))
+	 (mapc
+	  (function
+	   (lambda (filter)
+	     (let ((regexp (car filter))
+		   (pos (cdr filter)))
+	       (if (and (string-match regexp name)
+			(or (and (numberp pos)
+				 (= pos position))
+			    (and (eq pos 'last)
+				 (= position (1- elements)))
+			    (eq pos 'any)))
+		   (setq keep-p nil)))))
+	  sc-name-filter-alist)
+	 (if keep-p
+	     (setq keepers (cons position keepers)))))
      namelist)
     (mapc
-     (function
-      (lambda (position)
-	(setq filtered-list (cons (nth position namelist) filtered-list))
-	))
+     (lambda (position)
+       (setq filtered-list (cons (nth position namelist) filtered-list)))
      keepers)
     filtered-list))
 
@@ -1086,14 +1065,13 @@
 	(setq
 	 ;; put middle names and build sc-author entry
 	 middlenames (mapconcat
-		      (function
-		       (lambda (midname)
-			 (let ((key-attribs (format "middlename-%d" n))
-			       (key-mail    (format "sc-middlename-%d" n)))
-			   (push (cons key-attribs midname) sc-attributions)
-			   (push (cons key-mail midname) sc-mail-info)
-			   (setq n (1+ n))
-			   midname)))
+		      (lambda (midname)
+			(let ((key-attribs (format "middlename-%d" n))
+			      (key-mail    (format "sc-middlename-%d" n)))
+			  (push (cons key-attribs midname) sc-attributions)
+			  (push (cons key-mail midname) sc-mail-info)
+			  (setq n (1+ n))
+			  midname))
 		      midnames " ")
 
 	 author (concat firstname " " middlenames (and midnames " ") lastname)
@@ -1121,10 +1099,8 @@
 						  namestring))
 			(cons "sc-sender-address" (sc-get-address
 						   (sc-mail-field "sender")
-						   namestring))
-			)
-		       sc-mail-info)
-	 ))
+						   namestring)))
+		       sc-mail-info)))
     ;; from string is empty
     (push (cons "sc-author" sc-default-author-name) sc-mail-info)))
 
@@ -1185,13 +1161,11 @@
                 (setq attribution nil
                       attriblist (cdr attriblist))))
 	     (t (error "%s did not evaluate to a string or list!"
-		       "sc-attrib-selection-list"))
-	     )))
+		       "sc-attrib-selection-list")))))
 	 ((setq attribution (cdr (assoc preferred sc-attributions)))
 	  (setq attriblist nil))
 	 (t
-	  (setq attriblist (cdr attriblist)))
-	 )))
+	  (setq attriblist (cdr attriblist))))))
 
     ;; if preference was not found, we may use a secondary method to
     ;; find a valid attribution
@@ -1226,8 +1200,7 @@
 
     ;; query for confirmation
     (if query-p
-	(let* ((query-alist (mapcar (function (lambda (entry)
-						(list (cdr entry))))
+	(let* ((query-alist (mapcar (lambda (entry) (list (cdr entry)))
 				    sc-attributions))
 	       (minibuffer-local-completion-map
 		sc-minibuffer-local-completion-map)
@@ -1249,8 +1222,7 @@
 			   "Complete attribution name: "
 			   query-alist nil nil
 			   (cons initial 0)
-			   'sc-attribution-confirmation-history)
-			  ))
+			   'sc-attribution-confirmation-history)))
 		  nil)))
 	  (if sc-attrib-or-cite
 	      ;; since the citation was chosen, we have to guess at
@@ -1260,8 +1232,7 @@
 				    citation))
 
 	    (setq citation (sc-make-citation choice)
-		  attribution choice))
-	  ))
+		  attribution choice))))
 
     ;; its possible that the user wants to downcase the citation and
     ;; attribution
@@ -1286,8 +1257,7 @@
 	   (lastchoice (assoc lkey sc-attributions)))
       (if lastchoice
 	  (setcdr lastchoice attribution)
-	(push (cons lkey attribution) sc-attributions)))
-    ))
+	(push (cons lkey attribution) sc-attributions)))))
 
 
 ;; ======================================================================
@@ -1348,8 +1318,7 @@
 	  (if (not (string= fill-prefix ""))
 	      (fill-region sc-fill-begin (line-beginning-position)))
 	  (setq sc-fill-line-prefix prefix
-		sc-fill-begin (line-beginning-position))))
-    )
+		sc-fill-begin (line-beginning-position)))))
   nil)
 
 (defun sc-cite-coerce-cited-line ()
@@ -1598,8 +1567,7 @@
 			(sc-mail-field "subject") "\n")
 		(sc-hdr (concat tag "(see ")
 			(sc-mail-field "references")
-			" for more details)\n")
-		))))
+			" for more details)\n")))))
 
 
 ;; ======================================================================
@@ -1635,10 +1603,8 @@
       (void-function
        (progn (message
 	       "Symbol's function definition is void: %s (Header %d)"
-	       (car (cdr err)) sc-eref-style)
-	      (beep)
-	      ))
-      )))
+	       (cadr err) sc-eref-style)
+	      (beep))))))
 
 (defun sc-electric-mode (&optional arg)
   "
@@ -1671,13 +1637,11 @@
 	  (use-local-map sc-electric-mode-map)
 	  (sc-eref-show sc-eref-style)
 	  (run-mode-hooks 'sc-electric-mode-hook)
-	  (recursive-edit)
-	  )))
+	  (recursive-edit))))
 
     (and sc-eref-style
 	 (sc-eref-insert-selected))
-    (kill-buffer sc-electric-bufname)
-    ))
+    (kill-buffer sc-electric-bufname)))
 
 ;; functions for electric reference mode
 (defun sc-eref-show (index)
@@ -1694,8 +1658,7 @@
 	   ((>= index last)
 	    (if sc-electric-circular-p
 		0
-	      (progn (error msg "follow") (1- last))))
-	   ))
+	      (progn (error msg "follow") (1- last))))))
     (save-excursion
      (set-buffer sc-electric-bufname)
      (let ((buffer-read-only nil))
@@ -1711,9 +1674,8 @@
 		 ;; we have to enlarge the window
 		 (enlarge-window (- hdrlines winlines))
 	       ;; we have to shrink the window
-	       (shrink-window (- winlines (max hdrlines window-min-height)))
-	       )))
-       ))))
+	       (shrink-window (- winlines (max hdrlines
+					       window-min-height))))))))))
 
 (defun sc-eref-next ()
   "Display next reference in other buffer."
@@ -1739,8 +1701,7 @@
   (if (sc-valid-index-p refnum)
       (sc-eref-show refnum)
     (error "Invalid reference: %d. (Range: [%d .. %d])"
-	   refnum 0 (1- (length sc-rewrite-header-list)))
-    ))
+	   refnum 0 (1- (length sc-rewrite-header-list)))))
 
 (defun sc-eref-jump ()
   "Set reference header to preferred header."
@@ -1776,8 +1737,7 @@
 			  0)))
       (if sc-electric-references-p
 	  (sc-electric-mode preference)
-	(sc-eref-insert-selected t)
-	))))
+	(sc-eref-insert-selected t)))))
 
 
 ;; ======================================================================
@@ -1960,8 +1920,7 @@
 
     ;; finally, free the point-marker
     (set-marker point nil)
-    (set-marker mark nil)
-    )
+    (set-marker mark nil))
   (run-hooks 'sc-post-hook))