]> git.eshelyaron.com Git - emacs.git/commitdiff
change calc to use derived-mode-p
authorTom Tromey <tom@tromey.com>
Sat, 18 Mar 2017 22:00:13 +0000 (23:00 +0100)
committerTom Tromey <tom@tromey.com>
Wed, 5 Apr 2017 21:53:38 +0000 (15:53 -0600)
* lisp/calc/calc-embed.el (calc-embedded-find-modes)
(calc-embedded-make-info): Use derived-mode-p.

lisp/calc/calc-embed.el

index bb37d7f9c981774717eeb8579197b1eb2db1af66..bd5601b72929edd5f394368b93d1e92a3bcf02b8 100644 (file)
@@ -804,7 +804,7 @@ The command \\[yank] can retrieve it from there."
       (backward-char 6))
     (goto-char save-pt)
     (unless (assq 'the-language modes)
-      (let ((lang (assoc major-mode calc-language-alist)))
+      (let ((lang (cl-assoc-if #'derived-mode-p calc-language-alist)))
         (if lang
             (setq modes (cons (cons 'the-language (cdr lang))
                               modes)))))
@@ -829,13 +829,19 @@ The command \\[yank] can retrieve it from there."
          (setq found (list (current-buffer))
                calc-embedded-active (cons found calc-embedded-active)
                calc-embedded-firsttime-buf t)
-         (let ((newann (assoc major-mode calc-embedded-announce-formula-alist))
-               (newform (assoc major-mode calc-embedded-open-close-formula-alist))
-               (newword (assoc major-mode calc-embedded-word-regexp-alist))
-               (newplain (assoc major-mode calc-embedded-open-close-plain-alist))
+         (let ((newann (cl-assoc-if #'derived-mode-p
+                                    calc-embedded-announce-formula-alist))
+               (newform (cl-assoc-if #'derived-mode-p
+                                     calc-embedded-open-close-formula-alist))
+               (newword (cl-assoc-if #'derived-mode-p
+                                     calc-embedded-word-regexp-alist))
+               (newplain (cl-assoc-if #'derived-mode-p
+                                      calc-embedded-open-close-plain-alist))
                (newnewform
-                (assoc major-mode calc-embedded-open-close-new-formula-alist))
-               (newmode (assoc major-mode calc-embedded-open-close-mode-alist)))
+                (cl-assoc-if #'derived-mode-p
+                             calc-embedded-open-close-new-formula-alist))
+               (newmode (cl-assoc-if #'derived-mode-p
+                                     calc-embedded-open-close-mode-alist)))
            (when newann
              (make-local-variable 'calc-embedded-announce-formula)
              (setq calc-embedded-announce-formula (cdr newann)))