From: Robin Templeton Date: Sun, 22 Jun 2014 04:41:34 +0000 (-0400) Subject: rm early use of pcase X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/9217219924ae5245a84e2690121fbb461119243c rm early use of pcase --- diff --git a/lisp/files.el b/lisp/files.el index d8dd054793..eb638731b7 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3448,25 +3448,25 @@ It is dangerous if either of these conditions are met: "Set local variable VAR with value VAL. If VAR is `mode', call `VAL-mode' as a function unless it's already the major mode." - (pcase var - (`mode - (let ((mode (intern (concat (downcase (symbol-name val)) - "-mode")))) - (unless (eq (indirect-function mode) - (indirect-function major-mode)) - (funcall mode)))) - (`eval - (pcase val - (`(add-hook ',hook . ,_) (hack-one-local-variable--obsolete hook))) - (save-excursion (eval val))) - (_ - (hack-one-local-variable--obsolete var) - ;; Make sure the string has no text properties. - ;; Some text properties can get evaluated in various ways, - ;; so it is risky to put them on with a local variable list. - (if (stringp val) - (set-text-properties 0 (length val) nil val)) - (set (make-local-variable var) val)))) + (cond + ((eq var 'mode) + (let ((mode (intern (concat (downcase (symbol-name val)) + "-mode")))) + (unless (eq (indirect-function mode) + (indirect-function major-mode)) + (funcall mode)))) + ((eq var 'eval) + (pcase val + (`(add-hook ',hook . ,_) (hack-one-local-variable--obsolete hook))) + (save-excursion (eval val))) + (t + (hack-one-local-variable--obsolete var) + ;; Make sure the string has no text properties. + ;; Some text properties can get evaluated in various ways, + ;; so it is risky to put them on with a local variable list. + (if (stringp val) + (set-text-properties 0 (length val) nil val)) + (set (make-local-variable var) val)))) ;;; Handling directory-local variables, aka project settings.