diff options
| author | Noam Postavsky | 2017-08-30 19:31:48 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-09-25 19:39:19 -0400 |
| commit | a58d0c590a777be98e58cd8c92ee1381e07e9b2d (patch) | |
| tree | a4044cc9b64cd8932cd6afaa1ef7efc7aca900ed | |
| parent | 3a68dec32730eddfc066b3b9528f4bc63b5fa9f6 (diff) | |
| download | emacs-a58d0c590a777be98e58cd8c92ee1381e07e9b2d.tar.gz emacs-a58d0c590a777be98e58cd8c92ee1381e07e9b2d.zip | |
Fix loading of smie-config rules (Bug#24848)
* lisp/emacs-lisp/smie.el (smie-config--setter): Use `set-default'
instead of `setq-default'.
(smie-config): Use `custom-initialize-set' instead of
`custom-initialize-default' as the :initialize argument.
* lisp/progmodes/sh-script.el (sh-learn-buffer-indent): Mention that
we call `smie-config-guess' so that the user will have a chance to
find the correct docstring to consult. Remove hedging comments
regarding use of abnormal hooks.
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 87c4782e217..da1e12b1408 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el | |||
| @@ -1956,7 +1956,7 @@ E.g. provided via a file-local call to `smie-config-local'.") | |||
| 1956 | (defvar smie-config--modefuns nil) | 1956 | (defvar smie-config--modefuns nil) |
| 1957 | 1957 | ||
| 1958 | (defun smie-config--setter (var value) | 1958 | (defun smie-config--setter (var value) |
| 1959 | (setq-default var value) | 1959 | (set-default var value) |
| 1960 | (let ((old-modefuns smie-config--modefuns)) | 1960 | (let ((old-modefuns smie-config--modefuns)) |
| 1961 | (setq smie-config--modefuns nil) | 1961 | (setq smie-config--modefuns nil) |
| 1962 | (pcase-dolist (`(,mode . ,rules) value) | 1962 | (pcase-dolist (`(,mode . ,rules) value) |
| @@ -1982,7 +1982,7 @@ value with which to replace it." | |||
| 1982 | ;; FIXME improve value-type. | 1982 | ;; FIXME improve value-type. |
| 1983 | :type '(choice (const nil) | 1983 | :type '(choice (const nil) |
| 1984 | (alist :key-type symbol)) | 1984 | (alist :key-type symbol)) |
| 1985 | :initialize 'custom-initialize-default | 1985 | :initialize 'custom-initialize-set |
| 1986 | :set #'smie-config--setter) | 1986 | :set #'smie-config--setter) |
| 1987 | 1987 | ||
| 1988 | (defun smie-config-local (rules) | 1988 | (defun smie-config-local (rules) |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 0bda8bc275d..f2027e37345 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -3594,6 +3594,10 @@ so that `occur-next' and `occur-prev' will work." | |||
| 3594 | (defun sh-learn-buffer-indent (&optional arg) | 3594 | (defun sh-learn-buffer-indent (&optional arg) |
| 3595 | "Learn how to indent the buffer the way it currently is. | 3595 | "Learn how to indent the buffer the way it currently is. |
| 3596 | 3596 | ||
| 3597 | If `sh-use-smie' is non-nil, call `smie-config-guess'. | ||
| 3598 | Otherwise, run the sh-script specific indent learning command, as | ||
| 3599 | decribed below. | ||
| 3600 | |||
| 3597 | Output in buffer \"*indent*\" shows any lines which have conflicting | 3601 | Output in buffer \"*indent*\" shows any lines which have conflicting |
| 3598 | values of a variable, and the final value of all variables learned. | 3602 | values of a variable, and the final value of all variables learned. |
| 3599 | When called interactively, pop to this buffer automatically if | 3603 | When called interactively, pop to this buffer automatically if |
| @@ -3610,8 +3614,7 @@ to the value of variable `sh-learn-basic-offset'. | |||
| 3610 | 3614 | ||
| 3611 | Abnormal hook `sh-learned-buffer-hook' if non-nil is called when the | 3615 | Abnormal hook `sh-learned-buffer-hook' if non-nil is called when the |
| 3612 | function completes. The function is abnormal because it is called | 3616 | function completes. The function is abnormal because it is called |
| 3613 | with an alist of variables learned. This feature may be changed or | 3617 | with an alist of variables learned. |
| 3614 | removed in the future. | ||
| 3615 | 3618 | ||
| 3616 | This command can often take a long time to run." | 3619 | This command can often take a long time to run." |
| 3617 | (interactive "P") | 3620 | (interactive "P") |
| @@ -3809,7 +3812,6 @@ This command can often take a long time to run." | |||
| 3809 | " has" "s have") | 3812 | " has" "s have") |
| 3810 | (if (zerop num-diffs) | 3813 | (if (zerop num-diffs) |
| 3811 | "." ":")))))) | 3814 | "." ":")))))) |
| 3812 | ;; Are abnormal hooks considered bad form? | ||
| 3813 | (run-hook-with-args 'sh-learned-buffer-hook learned-var-list) | 3815 | (run-hook-with-args 'sh-learned-buffer-hook learned-var-list) |
| 3814 | (and (called-interactively-p 'any) | 3816 | (and (called-interactively-p 'any) |
| 3815 | (or sh-popup-occur-buffer (> num-diffs 0)) | 3817 | (or sh-popup-occur-buffer (> num-diffs 0)) |