aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/smie.el10
2 files changed, 13 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e75f2cc3190..a576c69fc07 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-03-04 Glenn Morris <rgm@gnu.org>
2
3 * emacs-lisp/smie.el (smie-config-guess): Doc fix.
4 Explicit error if no grammar.
5 (smie-config-save): Doc fix. Fix quote typo.
6
12014-03-04 Stefan Monnier <monnier@iro.umontreal.ca> 72014-03-04 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * progmodes/cc-mode.el (c-initialize-cc-mode): Only hook into 9 * progmodes/cc-mode.el (c-initialize-cc-mode): Only hook into
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 02a41cddfab..e65f873b874 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -2149,8 +2149,11 @@ position corresponding to each rule."
2149 rules)))) 2149 rules))))
2150 2150
2151(defun smie-config-guess () 2151(defun smie-config-guess ()
2152 "Try and figure out this buffer's indentation settings." 2152 "Try and figure out this buffer's indentation settings.
2153To save the result for future sessions, use `smie-config-save'."
2153 (interactive) 2154 (interactive)
2155 (if (eq smie-grammar 'unset)
2156 (user-error "This buffer does not seem to be using SMIE"))
2154 (let ((config (smie-config--guess (point-min) (point-max)))) 2157 (let ((config (smie-config--guess (point-min) (point-max))))
2155 (cond 2158 (cond
2156 ((null config) (message "Nothing to change")) 2159 ((null config) (message "Nothing to change"))
@@ -2168,7 +2171,8 @@ position corresponding to each rule."
2168 (message "Rules guessed: %S" config))))) 2171 (message "Rules guessed: %S" config)))))
2169 2172
2170(defun smie-config-save () 2173(defun smie-config-save ()
2171 "Save local rules for use with this major mode." 2174 "Save local rules for use with this major mode.
2175One way to generate local rules is the command `smie-config-guess'."
2172 (interactive) 2176 (interactive)
2173 (cond 2177 (cond
2174 ((null smie-config--buffer-local) 2178 ((null smie-config--buffer-local)
@@ -2190,7 +2194,7 @@ position corresponding to each rule."
2190 (setcdr existing config) 2194 (setcdr existing config)
2191 (push (cons major-mode config) smie-config)) 2195 (push (cons major-mode config) smie-config))
2192 (setq smie-config--mode-local config) 2196 (setq smie-config--mode-local config)
2193 (kill-local-variable smie-config--buffer-local) 2197 (kill-local-variable 'smie-config--buffer-local)
2194 (customize-mark-as-set 'smie-config))))) 2198 (customize-mark-as-set 'smie-config)))))
2195 2199
2196(provide 'smie) 2200(provide 'smie)