Parcourir la source

Fix a bug in `edit-server-choose-major-mode'.

Looks like commit a4e1dbe1 mistakenly dropped the fallback to
`edit-server-default-major-mode'.  Bring it back.  No need for the test
now, since `edit-server-default-major-mode' can't be nil (according to
its declaration).
Eli Barzilay il y a 9 ans
Parent
commit
a03b0c5d8d
1 fichiers modifiés avec 3 ajouts et 6 suppressions
  1. 3 6
      edit-server.el

+ 3 - 6
edit-server.el

@@ -507,12 +507,9 @@ frame. If a frame was created it returns `FRAME'."
   "Use `edit-server-url-major-mode-alist' to choose a major mode
 initialization function based on `edit-server-url', or fall back
 to `edit-server-default-major-mode'"
-  (let ((mode
-         (assoc-default
-          edit-server-url
-          edit-server-url-major-mode-alist 'string-match)))
-    (when mode
-      (funcall mode))))
+  (funcall (or (assoc-default edit-server-url
+                              edit-server-url-major-mode-alist 'string-match)
+               edit-server-default-major-mode)))
 
 (defun edit-server-find-or-create-edit-buffer (proc &optional existing)
   "Find and existing or create an new edit buffer, place content in it