diff options
| author | Glenn Morris | 2017-12-20 21:15:43 -0500 |
|---|---|---|
| committer | Glenn Morris | 2017-12-20 21:15:43 -0500 |
| commit | b1cf262a79463f28164ea1c2ffee3c657ce02ea4 (patch) | |
| tree | 4a428c5e0c026c1bb30e5972e78b145335b4b747 /lisp/progmodes | |
| parent | a415a97461cb10d2c6710871f90f57bd1ca34ec2 (diff) | |
| parent | b3f4a3a5aee93fa2f7ad2597383befbf7b242209 (diff) | |
| download | emacs-b1cf262a79463f28164ea1c2ffee3c657ce02ea4.tar.gz emacs-b1cf262a79463f28164ea1c2ffee3c657ce02ea4.zip | |
Merge from origin/emacs-26
b3f4a3a (origin/emacs-26) Special-case %DUMBFW for GnuTLS between 3.2...
c2ae057 Work around GnuTLS version issues with %DUMBFW (tiny change)
2f9d9ef ; Remove the mention of "plain C code" in the docstring as well
aca827b Merge branch 'widen-less' into emacs-26
87548f5 ; Rephrase NEWS entry a bit
da0d773 (emacs-26) ; * lisp/erc/erc.el: Update URL.
3a60515 * lisp/erc/erc.el (erc-shorten-server-name): Silence compiler...
471b6c1 ; Replace non-ascii quote characters in doc strings etc
7af7f5e Fix some more aliases to user options
79fb4b5 Fix some flymake aliases
b9fbc03 (origin/widen-less) Widen in indent-for-tab-command in the no...
446faf3 Replace the mention of c-indent-defun with js-indent-line
7e9eef0 Consolidate 'widen' calls
# Conflicts:
# etc/NEWS
# lisp/progmodes/flymake-proc.el
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/flymake-proc.el | 141 | ||||
| -rw-r--r-- | lisp/progmodes/flymake.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/prog-mode.el | 49 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 72 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 1 |
5 files changed, 106 insertions, 163 deletions
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index e207de5da6c..b11ae09bed2 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el | |||
| @@ -45,11 +45,17 @@ | |||
| 45 | 45 | ||
| 46 | (require 'flymake) | 46 | (require 'flymake) |
| 47 | 47 | ||
| 48 | (define-obsolete-variable-alias 'flymake-compilation-prevents-syntax-check | ||
| 49 | 'flymake-proc-compilation-prevents-syntax-check "26.1") | ||
| 50 | |||
| 48 | (defcustom flymake-proc-compilation-prevents-syntax-check t | 51 | (defcustom flymake-proc-compilation-prevents-syntax-check t |
| 49 | "If non-nil, don't start syntax check if compilation is running." | 52 | "If non-nil, don't start syntax check if compilation is running." |
| 50 | :group 'flymake | 53 | :group 'flymake |
| 51 | :type 'boolean) | 54 | :type 'boolean) |
| 52 | 55 | ||
| 56 | (define-obsolete-variable-alias 'flymake-xml-program | ||
| 57 | 'flymake-proc-xml-program "26.1") | ||
| 58 | |||
| 53 | (defcustom flymake-proc-xml-program | 59 | (defcustom flymake-proc-xml-program |
| 54 | (if (executable-find "xmlstarlet") "xmlstarlet" "xml") | 60 | (if (executable-find "xmlstarlet") "xmlstarlet" "xml") |
| 55 | "Program to use for XML validation." | 61 | "Program to use for XML validation." |
| @@ -57,11 +63,17 @@ | |||
| 57 | :group 'flymake | 63 | :group 'flymake |
| 58 | :version "24.4") | 64 | :version "24.4") |
| 59 | 65 | ||
| 66 | (define-obsolete-variable-alias 'flymake-master-file-dirs | ||
| 67 | 'flymake-proc-master-file-dirs "26.1") | ||
| 68 | |||
| 60 | (defcustom flymake-proc-master-file-dirs '("." "./src" "./UnitTest") | 69 | (defcustom flymake-proc-master-file-dirs '("." "./src" "./UnitTest") |
| 61 | "Dirs where to look for master files." | 70 | "Dirs where to look for master files." |
| 62 | :group 'flymake | 71 | :group 'flymake |
| 63 | :type '(repeat (string))) | 72 | :type '(repeat (string))) |
| 64 | 73 | ||
| 74 | (define-obsolete-variable-alias 'flymake-master-file-count-limit | ||
| 75 | 'flymake-proc-master-file-count-limit "26.1") | ||
| 76 | |||
| 65 | (defcustom flymake-proc-master-file-count-limit 32 | 77 | (defcustom flymake-proc-master-file-count-limit 32 |
| 66 | "Max number of master files to check." | 78 | "Max number of master files to check." |
| 67 | :group 'flymake | 79 | :group 'flymake |
| @@ -74,6 +86,9 @@ Overrides `flymake-proc-allowed-file-name-masks'." | |||
| 74 | :type '(repeat (regexp)) | 86 | :type '(repeat (regexp)) |
| 75 | :version "27.1") | 87 | :version "27.1") |
| 76 | 88 | ||
| 89 | (define-obsolete-variable-alias 'flymake-allowed-file-name-masks | ||
| 90 | 'flymake-proc-allowed-file-name-masks "26.1") | ||
| 91 | |||
| 77 | (defcustom flymake-proc-allowed-file-name-masks | 92 | (defcustom flymake-proc-allowed-file-name-masks |
| 78 | '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" | 93 | '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" |
| 79 | flymake-proc-simple-make-init | 94 | flymake-proc-simple-make-init |
| @@ -1133,76 +1148,62 @@ Use CREATE-TEMP-F for creating temp copy." | |||
| 1133 | 1148 | ||
| 1134 | ;;;; | 1149 | ;;;; |
| 1135 | 1150 | ||
| 1136 | (progn | 1151 | (define-obsolete-variable-alias 'flymake-check-file-limit |
| 1137 | (define-obsolete-variable-alias 'flymake-compilation-prevents-syntax-check | 1152 | 'flymake-proc-check-file-limit "26.1") |
| 1138 | 'flymake-proc-compilation-prevents-syntax-check "26.1") | 1153 | (define-obsolete-function-alias 'flymake-reformat-err-line-patterns-from-compile-el |
| 1139 | (define-obsolete-variable-alias 'flymake-xml-program | 1154 | 'flymake-proc-reformat-err-line-patterns-from-compile-el "26.1") |
| 1140 | 'flymake-proc-xml-program "26.1") | 1155 | (define-obsolete-variable-alias 'flymake-err-line-patterns |
| 1141 | (define-obsolete-variable-alias 'flymake-master-file-dirs | 1156 | 'flymake-proc-err-line-patterns "26.1") |
| 1142 | 'flymake-proc-master-file-dirs "26.1") | 1157 | (define-obsolete-function-alias 'flymake-parse-line |
| 1143 | (define-obsolete-variable-alias 'flymake-master-file-count-limit | 1158 | 'flymake-proc-parse-line "26.1") |
| 1144 | 'flymake-proc-master-file-count-limit "26.1" | 1159 | (define-obsolete-function-alias 'flymake-get-include-dirs |
| 1145 | "Max number of master files to check.") | 1160 | 'flymake-proc-get-include-dirs "26.1") |
| 1146 | (define-obsolete-variable-alias 'flymake-allowed-file-name-masks | 1161 | (define-obsolete-function-alias 'flymake-stop-all-syntax-checks |
| 1147 | 'flymake-proc-allowed-file-name-masks "26.1") | 1162 | 'flymake-proc-stop-all-syntax-checks "26.1") |
| 1148 | (define-obsolete-variable-alias 'flymake-check-file-limit | 1163 | (define-obsolete-function-alias 'flymake-compile |
| 1149 | 'flymake-proc-check-file-limit "26.1") | 1164 | 'flymake-proc-compile "26.1") |
| 1150 | (define-obsolete-function-alias 'flymake-reformat-err-line-patterns-from-compile-el | 1165 | (define-obsolete-function-alias 'flymake-create-temp-inplace |
| 1151 | 'flymake-proc-reformat-err-line-patterns-from-compile-el "26.1") | 1166 | 'flymake-proc-create-temp-inplace "26.1") |
| 1152 | (define-obsolete-variable-alias 'flymake-err-line-patterns | 1167 | (define-obsolete-function-alias 'flymake-create-temp-with-folder-structure |
| 1153 | 'flymake-proc-err-line-patterns "26.1") | 1168 | 'flymake-proc-create-temp-with-folder-structure "26.1") |
| 1154 | (define-obsolete-function-alias 'flymake-parse-line | 1169 | (define-obsolete-function-alias 'flymake-init-create-temp-buffer-copy |
| 1155 | 'flymake-proc-parse-line "26.1") | 1170 | 'flymake-proc-init-create-temp-buffer-copy "26.1") |
| 1156 | (define-obsolete-function-alias 'flymake-get-include-dirs | 1171 | (define-obsolete-function-alias 'flymake-simple-cleanup |
| 1157 | 'flymake-proc-get-include-dirs "26.1") | 1172 | 'flymake-proc-simple-cleanup "26.1") |
| 1158 | (define-obsolete-function-alias 'flymake-stop-all-syntax-checks | 1173 | (define-obsolete-function-alias 'flymake-get-real-file-name |
| 1159 | 'flymake-proc-stop-all-syntax-checks "26.1") | 1174 | 'flymake-proc-get-real-file-name "26.1") |
| 1160 | (define-obsolete-function-alias 'flymake-compile | 1175 | (define-obsolete-function-alias 'flymake-master-cleanup |
| 1161 | 'flymake-proc-compile "26.1") | 1176 | 'flymake-proc-master-cleanup "26.1") |
| 1162 | (define-obsolete-function-alias 'flymake-create-temp-inplace | 1177 | (define-obsolete-function-alias 'flymake-get-make-cmdline |
| 1163 | 'flymake-proc-create-temp-inplace "26.1") | 1178 | 'flymake-proc-get-make-cmdline "26.1") |
| 1164 | (define-obsolete-function-alias 'flymake-create-temp-with-folder-structure | 1179 | (define-obsolete-function-alias 'flymake-get-ant-cmdline |
| 1165 | 'flymake-proc-create-temp-with-folder-structure "26.1") | 1180 | 'flymake-proc-get-ant-cmdline "26.1") |
| 1166 | (define-obsolete-function-alias 'flymake-init-create-temp-buffer-copy | 1181 | (define-obsolete-function-alias 'flymake-simple-make-init-impl |
| 1167 | 'flymake-proc-init-create-temp-buffer-copy "26.1") | 1182 | 'flymake-proc-simple-make-init-impl "26.1") |
| 1168 | (define-obsolete-function-alias 'flymake-simple-cleanup | 1183 | (define-obsolete-function-alias 'flymake-simple-make-init |
| 1169 | 'flymake-proc-simple-cleanup "26.1") | 1184 | 'flymake-proc-simple-make-init "26.1") |
| 1170 | (define-obsolete-function-alias 'flymake-get-real-file-name | 1185 | (define-obsolete-function-alias 'flymake-master-make-init |
| 1171 | 'flymake-proc-get-real-file-name "26.1") | 1186 | 'flymake-proc-master-make-init "26.1") |
| 1172 | (define-obsolete-function-alias 'flymake-master-cleanup | 1187 | (define-obsolete-function-alias 'flymake-find-make-buildfile |
| 1173 | 'flymake-proc-master-cleanup "26.1") | 1188 | 'flymake-proc--find-make-buildfile "26.1") |
| 1174 | (define-obsolete-function-alias 'flymake-get-make-cmdline | 1189 | (define-obsolete-function-alias 'flymake-master-make-header-init |
| 1175 | 'flymake-proc-get-make-cmdline "26.1") | 1190 | 'flymake-proc-master-make-header-init "26.1") |
| 1176 | (define-obsolete-function-alias 'flymake-get-ant-cmdline | 1191 | (define-obsolete-function-alias 'flymake-simple-make-java-init |
| 1177 | 'flymake-proc-get-ant-cmdline "26.1") | 1192 | 'flymake-proc-simple-make-java-init "26.1") |
| 1178 | (define-obsolete-function-alias 'flymake-simple-make-init-impl | 1193 | (define-obsolete-function-alias 'flymake-simple-ant-java-init |
| 1179 | 'flymake-proc-simple-make-init-impl "26.1") | 1194 | 'flymake-proc-simple-ant-java-init "26.1") |
| 1180 | (define-obsolete-function-alias 'flymake-simple-make-init | 1195 | (define-obsolete-function-alias 'flymake-simple-java-cleanup |
| 1181 | 'flymake-proc-simple-make-init "26.1") | 1196 | 'flymake-proc-simple-java-cleanup "26.1") |
| 1182 | (define-obsolete-function-alias 'flymake-master-make-init | 1197 | (define-obsolete-function-alias 'flymake-perl-init |
| 1183 | 'flymake-proc-master-make-init "26.1") | 1198 | 'flymake-proc-perl-init "26.1") |
| 1184 | (define-obsolete-function-alias 'flymake-find-make-buildfile | 1199 | (define-obsolete-function-alias 'flymake-php-init |
| 1185 | 'flymake-proc--find-make-buildfile "26.1") | 1200 | 'flymake-proc-php-init "26.1") |
| 1186 | (define-obsolete-function-alias 'flymake-master-make-header-init | 1201 | (define-obsolete-function-alias 'flymake-simple-tex-init |
| 1187 | 'flymake-proc-master-make-header-init "26.1") | 1202 | 'flymake-proc-simple-tex-init "26.1") |
| 1188 | (define-obsolete-function-alias 'flymake-simple-make-java-init | 1203 | (define-obsolete-function-alias 'flymake-master-tex-init |
| 1189 | 'flymake-proc-simple-make-java-init "26.1") | 1204 | 'flymake-proc-master-tex-init "26.1") |
| 1190 | (define-obsolete-function-alias 'flymake-simple-ant-java-init | 1205 | (define-obsolete-function-alias 'flymake-xml-init |
| 1191 | 'flymake-proc-simple-ant-java-init "26.1") | 1206 | 'flymake-proc-xml-init "26.1") |
| 1192 | (define-obsolete-function-alias 'flymake-simple-java-cleanup | ||
| 1193 | 'flymake-proc-simple-java-cleanup "26.1") | ||
| 1194 | (define-obsolete-function-alias 'flymake-perl-init | ||
| 1195 | 'flymake-proc-perl-init "26.1") | ||
| 1196 | (define-obsolete-function-alias 'flymake-php-init | ||
| 1197 | 'flymake-proc-php-init "26.1") | ||
| 1198 | (define-obsolete-function-alias 'flymake-simple-tex-init | ||
| 1199 | 'flymake-proc-simple-tex-init "26.1") | ||
| 1200 | (define-obsolete-function-alias 'flymake-master-tex-init | ||
| 1201 | 'flymake-proc-master-tex-init "26.1") | ||
| 1202 | (define-obsolete-function-alias 'flymake-xml-init | ||
| 1203 | 'flymake-proc-xml-init "26.1")) | ||
| 1204 | |||
| 1205 | |||
| 1206 | 1207 | ||
| 1207 | (provide 'flymake-proc) | 1208 | (provide 'flymake-proc) |
| 1208 | ;;; flymake-proc.el ends here | 1209 | ;;; flymake-proc.el ends here |
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index f23af82d354..608074281f9 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -124,15 +124,15 @@ If nil, never start checking buffer automatically like this." | |||
| 124 | (make-obsolete-variable 'flymake-gui-warnings-enabled | 124 | (make-obsolete-variable 'flymake-gui-warnings-enabled |
| 125 | "it no longer has any effect." "26.1") | 125 | "it no longer has any effect." "26.1") |
| 126 | 126 | ||
| 127 | (define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file | ||
| 128 | 'flymake-start-on-flymake-mode "26.1") | ||
| 129 | |||
| 127 | (defcustom flymake-start-on-flymake-mode t | 130 | (defcustom flymake-start-on-flymake-mode t |
| 128 | "Start syntax check when `flymake-mode' is enabled. | 131 | "Start syntax check when `flymake-mode' is enabled. |
| 129 | Specifically, start it when the buffer is actually displayed." | 132 | Specifically, start it when the buffer is actually displayed." |
| 130 | :version "26.1" | 133 | :version "26.1" |
| 131 | :type 'boolean) | 134 | :type 'boolean) |
| 132 | 135 | ||
| 133 | (define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file | ||
| 134 | 'flymake-start-on-flymake-mode "26.1") | ||
| 135 | |||
| 136 | (defcustom flymake-log-level -1 | 136 | (defcustom flymake-log-level -1 |
| 137 | "Obsolete and ignored variable." | 137 | "Obsolete and ignored variable." |
| 138 | :type 'integer) | 138 | :type 'integer) |
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index f727e458b2b..f46e6da73da 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el | |||
| @@ -53,8 +53,8 @@ | |||
| 53 | "When non-nil, provides context for indenting embedded code chunks. | 53 | "When non-nil, provides context for indenting embedded code chunks. |
| 54 | 54 | ||
| 55 | There are languages where part of the code is actually written in | 55 | There are languages where part of the code is actually written in |
| 56 | a sub language, e.g., a Yacc/Bison or ANTLR grammar also consists | 56 | a sub language, e.g., a Yacc/Bison or ANTLR grammar can also include |
| 57 | of plain C code. This variable enables the major mode of the | 57 | JS or Python code. This variable enables the primary mode of the |
| 58 | main language to use the indentation engine of the sub-mode for | 58 | main language to use the indentation engine of the sub-mode for |
| 59 | lines in code chunks written in the sub-mode's language. | 59 | lines in code chunks written in the sub-mode's language. |
| 60 | 60 | ||
| @@ -64,37 +64,13 @@ mode, it should bind this variable to non-nil around the call. | |||
| 64 | 64 | ||
| 65 | The non-nil value should be a list of the form: | 65 | The non-nil value should be a list of the form: |
| 66 | 66 | ||
| 67 | (FIRST-COLUMN (START . END) PREVIOUS-CHUNKS) | 67 | (FIRST-COLUMN . REST) |
| 68 | 68 | ||
| 69 | FIRST-COLUMN is the column the indentation engine of the sub-mode | 69 | FIRST-COLUMN is the column the indentation engine of the sub-mode |
| 70 | should use for top-level language constructs inside the code | 70 | should use for top-level language constructs inside the code |
| 71 | chunk (instead of 0). | 71 | chunk (instead of 0). |
| 72 | 72 | ||
| 73 | START and END specify the region of the code chunk. END can be | 73 | REST is currently unused.") |
| 74 | nil, which stands for the value of `point-max'. The function | ||
| 75 | `prog-widen' uses this to restore restrictions imposed by the | ||
| 76 | sub-mode's indentation engine. | ||
| 77 | |||
| 78 | PREVIOUS-CHUNKS, if non-nil, provides the indentation engine of | ||
| 79 | the sub-mode with the virtual context of the code chunk. Valid | ||
| 80 | values are: | ||
| 81 | |||
| 82 | - A string containing text which the indentation engine can | ||
| 83 | consider as standing in front of the code chunk. To cache the | ||
| 84 | string's calculated syntactic information for repeated calls | ||
| 85 | with the same string, the sub-mode can add text-properties to | ||
| 86 | the string. | ||
| 87 | |||
| 88 | A typical use case is for grammars with code chunks which are | ||
| 89 | to be indented like function bodies -- the string would contain | ||
| 90 | the corresponding function preamble. | ||
| 91 | |||
| 92 | - A function, to be called with the start position of the current | ||
| 93 | chunk. It should return either the region of the previous chunk | ||
| 94 | as (PREV-START . PREV-END), or nil if there is no previous chunk. | ||
| 95 | |||
| 96 | A typical use case are literate programming sources -- the | ||
| 97 | function would successively return the previous code chunks.") | ||
| 98 | 74 | ||
| 99 | (defun prog-indent-sexp (&optional defun) | 75 | (defun prog-indent-sexp (&optional defun) |
| 100 | "Indent the expression after point. | 76 | "Indent the expression after point. |
| @@ -113,23 +89,6 @@ instead." | |||
| 113 | "Return the indentation column normally used for top-level constructs." | 89 | "Return the indentation column normally used for top-level constructs." |
| 114 | (or (car prog-indentation-context) 0)) | 90 | (or (car prog-indentation-context) 0)) |
| 115 | 91 | ||
| 116 | (defun prog-widen () | ||
| 117 | "Remove restrictions (narrowing) from current code chunk or buffer. | ||
| 118 | This function should be used instead of `widen' in any function used | ||
| 119 | by the indentation engine to make it respect the value of | ||
| 120 | `prog-indentation-context'. | ||
| 121 | |||
| 122 | This function (like `widen') is useful inside a | ||
| 123 | `save-restriction' to make the indentation correctly work when | ||
| 124 | narrowing is in effect." | ||
| 125 | (let ((chunk (cadr prog-indentation-context))) | ||
| 126 | (if chunk | ||
| 127 | ;; No call to `widen' is necessary here, as narrow-to-region | ||
| 128 | ;; changes (not just narrows) the existing restrictions | ||
| 129 | (narrow-to-region (car chunk) (or (cdr chunk) (point-max))) | ||
| 130 | (widen)))) | ||
| 131 | |||
| 132 | |||
| 133 | (defvar-local prettify-symbols-alist nil | 92 | (defvar-local prettify-symbols-alist nil |
| 134 | "Alist of symbol prettifications. | 93 | "Alist of symbol prettifications. |
| 135 | Each element looks like (SYMBOL . CHARACTER), where the symbol | 94 | Each element looks like (SYMBOL . CHARACTER), where the symbol |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 035d93f7b99..a72a55d2d9a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -287,10 +287,6 @@ | |||
| 287 | ;;; 24.x Compat | 287 | ;;; 24.x Compat |
| 288 | 288 | ||
| 289 | 289 | ||
| 290 | (unless (fboundp 'prog-widen) | ||
| 291 | (defun prog-widen () | ||
| 292 | (widen))) | ||
| 293 | |||
| 294 | (unless (fboundp 'prog-first-column) | 290 | (unless (fboundp 'prog-first-column) |
| 295 | (defun prog-first-column () | 291 | (defun prog-first-column () |
| 296 | 0)) | 292 | 0)) |
| @@ -725,12 +721,18 @@ It makes underscores and dots word constituent chars.") | |||
| 725 | 721 | ||
| 726 | ;;; Indentation | 722 | ;;; Indentation |
| 727 | 723 | ||
| 724 | (define-obsolete-variable-alias | ||
| 725 | 'python-indent 'python-indent-offset "24.3") | ||
| 726 | |||
| 728 | (defcustom python-indent-offset 4 | 727 | (defcustom python-indent-offset 4 |
| 729 | "Default indentation offset for Python." | 728 | "Default indentation offset for Python." |
| 730 | :group 'python | 729 | :group 'python |
| 731 | :type 'integer | 730 | :type 'integer |
| 732 | :safe 'integerp) | 731 | :safe 'integerp) |
| 733 | 732 | ||
| 733 | (define-obsolete-variable-alias | ||
| 734 | 'python-guess-indent 'python-indent-guess-indent-offset "24.3") | ||
| 735 | |||
| 734 | (defcustom python-indent-guess-indent-offset t | 736 | (defcustom python-indent-guess-indent-offset t |
| 735 | "Non-nil tells Python mode to guess `python-indent-offset' value." | 737 | "Non-nil tells Python mode to guess `python-indent-offset' value." |
| 736 | :type 'boolean | 738 | :type 'boolean |
| @@ -750,12 +752,6 @@ It makes underscores and dots word constituent chars.") | |||
| 750 | :type '(repeat symbol) | 752 | :type '(repeat symbol) |
| 751 | :group 'python) | 753 | :group 'python) |
| 752 | 754 | ||
| 753 | (define-obsolete-variable-alias | ||
| 754 | 'python-indent 'python-indent-offset "24.3") | ||
| 755 | |||
| 756 | (define-obsolete-variable-alias | ||
| 757 | 'python-guess-indent 'python-indent-guess-indent-offset "24.3") | ||
| 758 | |||
| 759 | (defvar python-indent-current-level 0 | 755 | (defvar python-indent-current-level 0 |
| 760 | "Deprecated var available for compatibility.") | 756 | "Deprecated var available for compatibility.") |
| 761 | 757 | ||
| @@ -785,7 +781,7 @@ work on `python-indent-calculate-indentation' instead." | |||
| 785 | (interactive) | 781 | (interactive) |
| 786 | (save-excursion | 782 | (save-excursion |
| 787 | (save-restriction | 783 | (save-restriction |
| 788 | (prog-widen) | 784 | (widen) |
| 789 | (goto-char (point-min)) | 785 | (goto-char (point-min)) |
| 790 | (let ((block-end)) | 786 | (let ((block-end)) |
| 791 | (while (and (not block-end) | 787 | (while (and (not block-end) |
| @@ -883,8 +879,6 @@ keyword | |||
| 883 | :at-dedenter-block-start | 879 | :at-dedenter-block-start |
| 884 | - Point is on a line starting a dedenter block. | 880 | - Point is on a line starting a dedenter block. |
| 885 | - START is the position where the dedenter block starts." | 881 | - START is the position where the dedenter block starts." |
| 886 | (save-restriction | ||
| 887 | (prog-widen) | ||
| 888 | (let ((ppss (save-excursion | 882 | (let ((ppss (save-excursion |
| 889 | (beginning-of-line) | 883 | (beginning-of-line) |
| 890 | (syntax-ppss)))) | 884 | (syntax-ppss)))) |
| @@ -1022,7 +1016,7 @@ keyword | |||
| 1022 | (looking-at (python-rx block-ender))) | 1016 | (looking-at (python-rx block-ender))) |
| 1023 | :after-block-end) | 1017 | :after-block-end) |
| 1024 | (t :after-line)) | 1018 | (t :after-line)) |
| 1025 | (point))))))))) | 1019 | (point)))))))) |
| 1026 | 1020 | ||
| 1027 | (defun python-indent--calculate-indentation () | 1021 | (defun python-indent--calculate-indentation () |
| 1028 | "Internal implementation of `python-indent-calculate-indentation'. | 1022 | "Internal implementation of `python-indent-calculate-indentation'. |
| @@ -1030,8 +1024,6 @@ May return an integer for the maximum possible indentation at | |||
| 1030 | current context or a list of integers. The latter case is only | 1024 | current context or a list of integers. The latter case is only |
| 1031 | happening for :at-dedenter-block-start context since the | 1025 | happening for :at-dedenter-block-start context since the |
| 1032 | possibilities can be narrowed to specific indentation points." | 1026 | possibilities can be narrowed to specific indentation points." |
| 1033 | (save-restriction | ||
| 1034 | (prog-widen) | ||
| 1035 | (save-excursion | 1027 | (save-excursion |
| 1036 | (pcase (python-indent-context) | 1028 | (pcase (python-indent-context) |
| 1037 | (`(:no-indent . ,_) (prog-first-column)) ; usually 0 | 1029 | (`(:no-indent . ,_) (prog-first-column)) ; usually 0 |
| @@ -1081,7 +1073,7 @@ possibilities can be narrowed to specific indentation points." | |||
| 1081 | (`(,(or :inside-paren-newline-start-from-block) . ,start) | 1073 | (`(,(or :inside-paren-newline-start-from-block) . ,start) |
| 1082 | ;; Add two indentation levels to make the suite stand out. | 1074 | ;; Add two indentation levels to make the suite stand out. |
| 1083 | (goto-char start) | 1075 | (goto-char start) |
| 1084 | (+ (current-indentation) (* python-indent-offset 2))))))) | 1076 | (+ (current-indentation) (* python-indent-offset 2)))))) |
| 1085 | 1077 | ||
| 1086 | (defun python-indent--calculate-levels (indentation) | 1078 | (defun python-indent--calculate-levels (indentation) |
| 1087 | "Calculate levels list given INDENTATION. | 1079 | "Calculate levels list given INDENTATION. |
| @@ -2042,6 +2034,9 @@ executed through tramp connections." | |||
| 2042 | :type '(repeat string) | 2034 | :type '(repeat string) |
| 2043 | :group 'python) | 2035 | :group 'python) |
| 2044 | 2036 | ||
| 2037 | (define-obsolete-variable-alias | ||
| 2038 | 'python-shell-virtualenv-path 'python-shell-virtualenv-root "25.1") | ||
| 2039 | |||
| 2045 | (defcustom python-shell-virtualenv-root nil | 2040 | (defcustom python-shell-virtualenv-root nil |
| 2046 | "Path to virtualenv root. | 2041 | "Path to virtualenv root. |
| 2047 | This variable, when set to a string, makes the environment to be | 2042 | This variable, when set to a string, makes the environment to be |
| @@ -2050,9 +2045,6 @@ virtualenv." | |||
| 2050 | :type '(choice (const nil) string) | 2045 | :type '(choice (const nil) string) |
| 2051 | :group 'python) | 2046 | :group 'python) |
| 2052 | 2047 | ||
| 2053 | (define-obsolete-variable-alias | ||
| 2054 | 'python-shell-virtualenv-path 'python-shell-virtualenv-root "25.1") | ||
| 2055 | |||
| 2056 | (defcustom python-shell-setup-codes nil | 2048 | (defcustom python-shell-setup-codes nil |
| 2057 | "List of code run by `python-shell-send-setup-codes'." | 2049 | "List of code run by `python-shell-send-setup-codes'." |
| 2058 | :type '(repeat symbol) | 2050 | :type '(repeat symbol) |
| @@ -3289,14 +3281,6 @@ def __PYTHON_EL_get_completions(text): | |||
| 3289 | :type 'string | 3281 | :type 'string |
| 3290 | :group 'python) | 3282 | :group 'python) |
| 3291 | 3283 | ||
| 3292 | (defcustom python-shell-completion-string-code | ||
| 3293 | "';'.join(__PYTHON_EL_get_completions('''%s'''))" | ||
| 3294 | "Python code used to get a string of completions separated by semicolons. | ||
| 3295 | The string passed to the function is the current python name or | ||
| 3296 | the full statement in the case of imports." | ||
| 3297 | :type 'string | ||
| 3298 | :group 'python) | ||
| 3299 | |||
| 3300 | (define-obsolete-variable-alias | 3284 | (define-obsolete-variable-alias |
| 3301 | 'python-shell-completion-module-string-code | 3285 | 'python-shell-completion-module-string-code |
| 3302 | 'python-shell-completion-string-code | 3286 | 'python-shell-completion-string-code |
| @@ -3309,6 +3293,14 @@ the full statement in the case of imports." | |||
| 3309 | "25.1" | 3293 | "25.1" |
| 3310 | "Completion string code must work for (i)pdb.") | 3294 | "Completion string code must work for (i)pdb.") |
| 3311 | 3295 | ||
| 3296 | (defcustom python-shell-completion-string-code | ||
| 3297 | "';'.join(__PYTHON_EL_get_completions('''%s'''))" | ||
| 3298 | "Python code used to get a string of completions separated by semicolons. | ||
| 3299 | The string passed to the function is the current python name or | ||
| 3300 | the full statement in the case of imports." | ||
| 3301 | :type 'string | ||
| 3302 | :group 'python) | ||
| 3303 | |||
| 3312 | (defcustom python-shell-completion-native-disabled-interpreters | 3304 | (defcustom python-shell-completion-native-disabled-interpreters |
| 3313 | ;; PyPy's readline cannot handle some escape sequences yet. Native | 3305 | ;; PyPy's readline cannot handle some escape sequences yet. Native |
| 3314 | ;; completion was found to be non-functional for IPython (see | 3306 | ;; completion was found to be non-functional for IPython (see |
| @@ -4040,6 +4032,9 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'." | |||
| 4040 | 4032 | ||
| 4041 | ;;; Skeletons | 4033 | ;;; Skeletons |
| 4042 | 4034 | ||
| 4035 | (define-obsolete-variable-alias | ||
| 4036 | 'python-use-skeletons 'python-skeleton-autoinsert "24.3") | ||
| 4037 | |||
| 4043 | (defcustom python-skeleton-autoinsert nil | 4038 | (defcustom python-skeleton-autoinsert nil |
| 4044 | "Non-nil means template skeletons will be automagically inserted. | 4039 | "Non-nil means template skeletons will be automagically inserted. |
| 4045 | This happens when pressing \"if<SPACE>\", for example, to prompt for | 4040 | This happens when pressing \"if<SPACE>\", for example, to prompt for |
| @@ -4048,9 +4043,6 @@ the if condition." | |||
| 4048 | :group 'python | 4043 | :group 'python |
| 4049 | :safe 'booleanp) | 4044 | :safe 'booleanp) |
| 4050 | 4045 | ||
| 4051 | (define-obsolete-variable-alias | ||
| 4052 | 'python-use-skeletons 'python-skeleton-autoinsert "24.3") | ||
| 4053 | |||
| 4054 | (defvar python-skeleton-available '() | 4046 | (defvar python-skeleton-available '() |
| 4055 | "Internal list of available skeletons.") | 4047 | "Internal list of available skeletons.") |
| 4056 | 4048 | ||
| @@ -4593,7 +4585,7 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun. | |||
| 4593 | This function can be used as the value of `add-log-current-defun-function' | 4585 | This function can be used as the value of `add-log-current-defun-function' |
| 4594 | since it returns nil if point is not inside a defun." | 4586 | since it returns nil if point is not inside a defun." |
| 4595 | (save-restriction | 4587 | (save-restriction |
| 4596 | (prog-widen) | 4588 | (widen) |
| 4597 | (save-excursion | 4589 | (save-excursion |
| 4598 | (end-of-line 1) | 4590 | (end-of-line 1) |
| 4599 | (let ((names) | 4591 | (let ((names) |
| @@ -4791,12 +4783,10 @@ likely an invalid python file." | |||
| 4791 | "Message the first line of the block the current statement closes." | 4783 | "Message the first line of the block the current statement closes." |
| 4792 | (let ((point (python-info-dedenter-opening-block-position))) | 4784 | (let ((point (python-info-dedenter-opening-block-position))) |
| 4793 | (when point | 4785 | (when point |
| 4794 | (save-restriction | ||
| 4795 | (prog-widen) | ||
| 4796 | (message "Closes %s" (save-excursion | 4786 | (message "Closes %s" (save-excursion |
| 4797 | (goto-char point) | 4787 | (goto-char point) |
| 4798 | (buffer-substring | 4788 | (buffer-substring |
| 4799 | (point) (line-end-position)))))))) | 4789 | (point) (line-end-position))))))) |
| 4800 | 4790 | ||
| 4801 | (defun python-info-dedenter-statement-p () | 4791 | (defun python-info-dedenter-statement-p () |
| 4802 | "Return point if current statement is a dedenter. | 4792 | "Return point if current statement is a dedenter. |
| @@ -4812,8 +4802,6 @@ statement." | |||
| 4812 | "Return non-nil if current line ends with backslash. | 4802 | "Return non-nil if current line ends with backslash. |
| 4813 | With optional argument LINE-NUMBER, check that line instead." | 4803 | With optional argument LINE-NUMBER, check that line instead." |
| 4814 | (save-excursion | 4804 | (save-excursion |
| 4815 | (save-restriction | ||
| 4816 | (prog-widen) | ||
| 4817 | (when line-number | 4805 | (when line-number |
| 4818 | (python-util-goto-line line-number)) | 4806 | (python-util-goto-line line-number)) |
| 4819 | (while (and (not (eobp)) | 4807 | (while (and (not (eobp)) |
| @@ -4822,14 +4810,12 @@ With optional argument LINE-NUMBER, check that line instead." | |||
| 4822 | (not (equal (char-before (point)) ?\\))) | 4810 | (not (equal (char-before (point)) ?\\))) |
| 4823 | (forward-line 1)) | 4811 | (forward-line 1)) |
| 4824 | (when (equal (char-before) ?\\) | 4812 | (when (equal (char-before) ?\\) |
| 4825 | (point-marker))))) | 4813 | (point-marker)))) |
| 4826 | 4814 | ||
| 4827 | (defun python-info-beginning-of-backslash (&optional line-number) | 4815 | (defun python-info-beginning-of-backslash (&optional line-number) |
| 4828 | "Return the point where the backslashed line starts. | 4816 | "Return the point where the backslashed line starts. |
| 4829 | Optional argument LINE-NUMBER forces the line number to check against." | 4817 | Optional argument LINE-NUMBER forces the line number to check against." |
| 4830 | (save-excursion | 4818 | (save-excursion |
| 4831 | (save-restriction | ||
| 4832 | (prog-widen) | ||
| 4833 | (when line-number | 4819 | (when line-number |
| 4834 | (python-util-goto-line line-number)) | 4820 | (python-util-goto-line line-number)) |
| 4835 | (when (python-info-line-ends-backslash-p) | 4821 | (when (python-info-line-ends-backslash-p) |
| @@ -4838,15 +4824,13 @@ Optional argument LINE-NUMBER forces the line number to check against." | |||
| 4838 | (python-syntax-context 'paren)) | 4824 | (python-syntax-context 'paren)) |
| 4839 | (forward-line -1)) | 4825 | (forward-line -1)) |
| 4840 | (back-to-indentation) | 4826 | (back-to-indentation) |
| 4841 | (point-marker))))) | 4827 | (point-marker)))) |
| 4842 | 4828 | ||
| 4843 | (defun python-info-continuation-line-p () | 4829 | (defun python-info-continuation-line-p () |
| 4844 | "Check if current line is continuation of another. | 4830 | "Check if current line is continuation of another. |
| 4845 | When current line is continuation of another return the point | 4831 | When current line is continuation of another return the point |
| 4846 | where the continued line ends." | 4832 | where the continued line ends." |
| 4847 | (save-excursion | 4833 | (save-excursion |
| 4848 | (save-restriction | ||
| 4849 | (prog-widen) | ||
| 4850 | (let* ((context-type (progn | 4834 | (let* ((context-type (progn |
| 4851 | (back-to-indentation) | 4835 | (back-to-indentation) |
| 4852 | (python-syntax-context-type))) | 4836 | (python-syntax-context-type))) |
| @@ -4872,7 +4856,7 @@ where the continued line ends." | |||
| 4872 | (python-util-forward-comment -1) | 4856 | (python-util-forward-comment -1) |
| 4873 | (when (and (equal (1- line-start) (line-number-at-pos)) | 4857 | (when (and (equal (1- line-start) (line-number-at-pos)) |
| 4874 | (python-info-line-ends-backslash-p)) | 4858 | (python-info-line-ends-backslash-p)) |
| 4875 | (point-marker)))))))) | 4859 | (point-marker))))))) |
| 4876 | 4860 | ||
| 4877 | (defun python-info-block-continuation-line-p () | 4861 | (defun python-info-block-continuation-line-p () |
| 4878 | "Return non-nil if current line is a continuation of a block." | 4862 | "Return non-nil if current line is a continuation of a block." |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 1c7df7e35a2..cc5cbbc6bed 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -1364,7 +1364,6 @@ delimiter." | |||
| 1364 | "\\)\\>"))) | 1364 | "\\)\\>"))) |
| 1365 | (eq (ruby-deep-indent-paren-p t) 'space) | 1365 | (eq (ruby-deep-indent-paren-p t) 'space) |
| 1366 | (not (bobp))) | 1366 | (not (bobp))) |
| 1367 | (widen) | ||
| 1368 | (goto-char (or begin parse-start)) | 1367 | (goto-char (or begin parse-start)) |
| 1369 | (skip-syntax-forward " ") | 1368 | (skip-syntax-forward " ") |
| 1370 | (current-column)) | 1369 | (current-column)) |