Browse Source

Use assq instead of assoc with quoted symbols

* lisp/ob-core.el (org-babel-merge-params):
* lisp/org-agenda.el (org-agenda-prepare-window):
(org-agenda-to-appt):
* lisp/org-capture.el (org-capture-finalize):
* lisp/org.el (org-find-invisible-foreground):
(org-open-file):
(org-todo-trigger-tag-changes):
(org-back-over-empty-lines):
* lisp/ox-odt.el (org-odt-get-table-cell-styles):
Use assq instead of assoc with quoted symbols.
Aaron Ecay 8 years ago
parent
commit
48e7f17bc6
5 changed files with 22 additions and 22 deletions
  1. 2 2
      lisp/ob-core.el
  2. 6 6
      lisp/org-agenda.el
  3. 1 1
      lisp/org-capture.el
  4. 5 5
      lisp/org.el
  5. 8 8
      lisp/ox-odt.el

+ 2 - 2
lisp/ob-core.el

@@ -2491,10 +2491,10 @@ This takes into account some special considerations for certain
 parameters when merging lists."
   (let* ((results-exclusive-groups
 	  (mapcar (lambda (group) (mapcar #'symbol-name group))
-		  (cdr (assoc 'results org-babel-common-header-args-w-values))))
+		  (cdr (assq 'results org-babel-common-header-args-w-values))))
 	 (exports-exclusive-groups
 	  (mapcar (lambda (group) (mapcar #'symbol-name group))
-		  (cdr (assoc 'exports org-babel-common-header-args-w-values))))
+		  (cdr (assq 'exports org-babel-common-header-args-w-values))))
 	 (merge
 	  (lambda (exclusive-groups &rest result-params)
 	    ;; Maintain exclusivity of mutually exclusive parameters,

+ 6 - 6
lisp/org-agenda.el

@@ -3625,10 +3625,10 @@ FILTER-ALIST is an alist of filters we need to apply when
      ((equal org-agenda-window-setup 'reorganize-frame)
       (delete-other-windows)
       (org-switch-to-buffer-other-window abuf)))
-    (setq org-agenda-tag-filter (cdr (assoc 'tag filter-alist)))
-    (setq org-agenda-category-filter (cdr (assoc 'cat filter-alist)))
-    (setq org-agenda-effort-filter (cdr (assoc 'effort filter-alist)))
-    (setq org-agenda-regexp-filter (cdr (assoc 're filter-alist)))
+    (setq org-agenda-tag-filter (cdr (assq 'tag filter-alist)))
+    (setq org-agenda-category-filter (cdr (assq 'cat filter-alist)))
+    (setq org-agenda-effort-filter (cdr (assq 'effort filter-alist)))
+    (setq org-agenda-regexp-filter (cdr (assq 're filter-alist)))
     ;; Additional test in case agenda is invoked from within agenda
     ;; buffer via elisp link.
     (unless (equal (current-buffer) abuf)
@@ -10123,8 +10123,8 @@ to override `appt-message-warning-time'."
                       (and (stringp filter) (string-match filter evt))
                       (and (functionp filter) (funcall filter x))
                       (and (listp filter)
-                           (let ((cat-filter (cadr (assoc 'category filter)))
-                                 (evt-filter (cadr (assoc 'headline filter))))
+                           (let ((cat-filter (cadr (assq 'category filter)))
+                                 (evt-filter (cadr (assq 'headline filter))))
                              (or (and (stringp cat-filter)
                                       (string-match cat-filter cat))
                                  (and (stringp evt-filter)

+ 1 - 1
lisp/org-capture.el

@@ -711,7 +711,7 @@ captured item after finalizing."
 	      (m2 (org-capture-get :end-marker 'local)))
 	  (if (and m1 m2 (= m1 beg) (= m2 end))
 	      (progn
-		(setq m2 (if (cdr (assoc 'heading org-blank-before-new-entry))
+		(setq m2 (if (cdr (assq 'heading org-blank-before-new-entry))
 			     m2 (1+ m2))
 		      m2 (if (< (point-max) m2) (point-max) m2))
 		(setq abort-note 'clean)

+ 5 - 5
lisp/org.el

@@ -5665,7 +5665,7 @@ The following commands are available:
 		      (mapcar
 		       (lambda (alist)
 			 (when (boundp alist)
-			   (cdr (assoc 'background-color (symbol-value alist)))))
+			   (cdr (assq 'background-color (symbol-value alist)))))
 		       '(default-frame-alist initial-frame-alist window-system-default-frame-alist))
 		      (list (face-foreground 'org-hide))))))
     (car (remove nil candidates))))
@@ -11434,7 +11434,7 @@ If the file does not exist, an error is thrown."
 		    (cdr (assoc ext apps))
 		    (cdr (assq t apps))))))
     (when (eq cmd 'system)
-      (setq cmd (cdr (assoc 'system apps))))
+      (setq cmd (cdr (assq 'system apps))))
     (when (eq cmd 'default)
       (setq cmd (cdr (assoc t apps))))
     (when (eq cmd 'mailcap)
@@ -13060,9 +13060,9 @@ This hook runs even if there is no statistics cookie present, in which case
     (when (and (stringp state) (> (length state) 0))
       (setq changes (append changes (cdr (assoc state l)))))
     (when (member state org-not-done-keywords)
-      (setq changes (append changes (cdr (assoc 'todo l)))))
+      (setq changes (append changes (cdr (assq 'todo l)))))
     (when (member state org-done-keywords)
-      (setq changes (append changes (cdr (assoc 'done l)))))
+      (setq changes (append changes (cdr (assq 'done l)))))
     (dolist (c changes)
       (org-toggle-tag (car c) (if (cdr c) 'on 'off)))))
 
@@ -22535,7 +22535,7 @@ that may remove elements by altering the list structure."
   "Move backwards over whitespace, to the beginning of the first empty line.
 Returns the number of empty lines passed."
   (let ((pos (point)))
-    (if (cdr (assoc 'heading org-blank-before-new-entry))
+    (if (cdr (assq 'heading org-blank-before-new-entry))
 	(skip-chars-backward " \t\n\r")
       (unless (eobp)
 	(forward-line -1)))

+ 8 - 8
lisp/ox-odt.el

@@ -3256,23 +3256,23 @@ styles congruent with the ODF-1.2 specification."
 	     (cell-style-selectors (nth 2 style-spec))
 	     (cell-type
 	      (cond
-	       ((and (cdr (assoc 'use-first-column-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-first-column-styles cell-style-selectors))
 		     (= c 0)) "FirstColumn")
-	       ((and (cdr (assoc 'use-last-column-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-last-column-styles cell-style-selectors))
 		     (= (1+ c) (cdr table-dimensions)))
 		"LastColumn")
-	       ((and (cdr (assoc 'use-first-row-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-first-row-styles cell-style-selectors))
 		     (= r 0)) "FirstRow")
-	       ((and (cdr (assoc 'use-last-row-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-last-row-styles cell-style-selectors))
 		     (= (1+ r) (car table-dimensions)))
 		"LastRow")
-	       ((and (cdr (assoc 'use-banding-rows-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-banding-rows-styles cell-style-selectors))
 		     (= (% r 2) 1)) "EvenRow")
-	       ((and (cdr (assoc 'use-banding-rows-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-banding-rows-styles cell-style-selectors))
 		     (= (% r 2) 0)) "OddRow")
-	       ((and (cdr (assoc 'use-banding-columns-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-banding-columns-styles cell-style-selectors))
 		     (= (% c 2) 1)) "EvenColumn")
-	       ((and (cdr (assoc 'use-banding-columns-styles cell-style-selectors))
+	       ((and (cdr (assq 'use-banding-columns-styles cell-style-selectors))
 		     (= (% c 2) 0)) "OddColumn")
 	       (t ""))))
 	(concat template-name cell-type)))))