aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRobin Templeton <[email protected]>2014-06-22 00:41:34 -0400
committerRobin Templeton <[email protected]>2015-04-20 00:29:01 -0400
commit9217219924ae5245a84e2690121fbb461119243c (patch)
tree0ca8964e778d3fbd0472745fec478dead2683262 /lisp
parent92dca4df0956bc153431f79dbfdd0235c1f9fded (diff)
rm early use of pcase
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el38
1 files changed, 19 insertions, 19 deletions
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.