diff options
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 @@ (require 'flymake) +(define-obsolete-variable-alias 'flymake-compilation-prevents-syntax-check + 'flymake-proc-compilation-prevents-syntax-check "26.1") + (defcustom flymake-proc-compilation-prevents-syntax-check t "If non-nil, don't start syntax check if compilation is running." :group 'flymake :type 'boolean) +(define-obsolete-variable-alias 'flymake-xml-program + 'flymake-proc-xml-program "26.1") + (defcustom flymake-proc-xml-program (if (executable-find "xmlstarlet") "xmlstarlet" "xml") "Program to use for XML validation." @@ -57,11 +63,17 @@ :group 'flymake :version "24.4") +(define-obsolete-variable-alias 'flymake-master-file-dirs + 'flymake-proc-master-file-dirs "26.1") + (defcustom flymake-proc-master-file-dirs '("." "./src" "./UnitTest") "Dirs where to look for master files." :group 'flymake :type '(repeat (string))) +(define-obsolete-variable-alias 'flymake-master-file-count-limit + 'flymake-proc-master-file-count-limit "26.1") + (defcustom flymake-proc-master-file-count-limit 32 "Max number of master files to check." :group 'flymake @@ -74,6 +86,9 @@ Overrides `flymake-proc-allowed-file-name-masks'." :type '(repeat (regexp)) :version "27.1") +(define-obsolete-variable-alias 'flymake-allowed-file-name-masks + 'flymake-proc-allowed-file-name-masks "26.1") + (defcustom flymake-proc-allowed-file-name-masks '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-proc-simple-make-init @@ -1133,76 +1148,62 @@ Use CREATE-TEMP-F for creating temp copy." ;;;; -(progn - (define-obsolete-variable-alias 'flymake-compilation-prevents-syntax-check - 'flymake-proc-compilation-prevents-syntax-check "26.1") - (define-obsolete-variable-alias 'flymake-xml-program - 'flymake-proc-xml-program "26.1") - (define-obsolete-variable-alias 'flymake-master-file-dirs - 'flymake-proc-master-file-dirs "26.1") - (define-obsolete-variable-alias 'flymake-master-file-count-limit - 'flymake-proc-master-file-count-limit "26.1" - "Max number of master files to check.") - (define-obsolete-variable-alias 'flymake-allowed-file-name-masks - 'flymake-proc-allowed-file-name-masks "26.1") - (define-obsolete-variable-alias 'flymake-check-file-limit - 'flymake-proc-check-file-limit "26.1") - (define-obsolete-function-alias 'flymake-reformat-err-line-patterns-from-compile-el - 'flymake-proc-reformat-err-line-patterns-from-compile-el "26.1") - (define-obsolete-variable-alias 'flymake-err-line-patterns - 'flymake-proc-err-line-patterns "26.1") - (define-obsolete-function-alias 'flymake-parse-line - 'flymake-proc-parse-line "26.1") - (define-obsolete-function-alias 'flymake-get-include-dirs - 'flymake-proc-get-include-dirs "26.1") - (define-obsolete-function-alias 'flymake-stop-all-syntax-checks - 'flymake-proc-stop-all-syntax-checks "26.1") - (define-obsolete-function-alias 'flymake-compile - 'flymake-proc-compile "26.1") - (define-obsolete-function-alias 'flymake-create-temp-inplace - 'flymake-proc-create-temp-inplace "26.1") - (define-obsolete-function-alias 'flymake-create-temp-with-folder-structure - 'flymake-proc-create-temp-with-folder-structure "26.1") - (define-obsolete-function-alias 'flymake-init-create-temp-buffer-copy - 'flymake-proc-init-create-temp-buffer-copy "26.1") - (define-obsolete-function-alias 'flymake-simple-cleanup - 'flymake-proc-simple-cleanup "26.1") - (define-obsolete-function-alias 'flymake-get-real-file-name - 'flymake-proc-get-real-file-name "26.1") - (define-obsolete-function-alias 'flymake-master-cleanup - 'flymake-proc-master-cleanup "26.1") - (define-obsolete-function-alias 'flymake-get-make-cmdline - 'flymake-proc-get-make-cmdline "26.1") - (define-obsolete-function-alias 'flymake-get-ant-cmdline - 'flymake-proc-get-ant-cmdline "26.1") - (define-obsolete-function-alias 'flymake-simple-make-init-impl - 'flymake-proc-simple-make-init-impl "26.1") - (define-obsolete-function-alias 'flymake-simple-make-init - 'flymake-proc-simple-make-init "26.1") - (define-obsolete-function-alias 'flymake-master-make-init - 'flymake-proc-master-make-init "26.1") - (define-obsolete-function-alias 'flymake-find-make-buildfile - 'flymake-proc--find-make-buildfile "26.1") - (define-obsolete-function-alias 'flymake-master-make-header-init - 'flymake-proc-master-make-header-init "26.1") - (define-obsolete-function-alias 'flymake-simple-make-java-init - 'flymake-proc-simple-make-java-init "26.1") - (define-obsolete-function-alias 'flymake-simple-ant-java-init - 'flymake-proc-simple-ant-java-init "26.1") - (define-obsolete-function-alias 'flymake-simple-java-cleanup - 'flymake-proc-simple-java-cleanup "26.1") - (define-obsolete-function-alias 'flymake-perl-init - 'flymake-proc-perl-init "26.1") - (define-obsolete-function-alias 'flymake-php-init - 'flymake-proc-php-init "26.1") - (define-obsolete-function-alias 'flymake-simple-tex-init - 'flymake-proc-simple-tex-init "26.1") - (define-obsolete-function-alias 'flymake-master-tex-init - 'flymake-proc-master-tex-init "26.1") - (define-obsolete-function-alias 'flymake-xml-init - 'flymake-proc-xml-init "26.1")) - - +(define-obsolete-variable-alias 'flymake-check-file-limit + 'flymake-proc-check-file-limit "26.1") +(define-obsolete-function-alias 'flymake-reformat-err-line-patterns-from-compile-el + 'flymake-proc-reformat-err-line-patterns-from-compile-el "26.1") +(define-obsolete-variable-alias 'flymake-err-line-patterns + 'flymake-proc-err-line-patterns "26.1") +(define-obsolete-function-alias 'flymake-parse-line + 'flymake-proc-parse-line "26.1") +(define-obsolete-function-alias 'flymake-get-include-dirs + 'flymake-proc-get-include-dirs "26.1") +(define-obsolete-function-alias 'flymake-stop-all-syntax-checks + 'flymake-proc-stop-all-syntax-checks "26.1") +(define-obsolete-function-alias 'flymake-compile + 'flymake-proc-compile "26.1") +(define-obsolete-function-alias 'flymake-create-temp-inplace + 'flymake-proc-create-temp-inplace "26.1") +(define-obsolete-function-alias 'flymake-create-temp-with-folder-structure + 'flymake-proc-create-temp-with-folder-structure "26.1") +(define-obsolete-function-alias 'flymake-init-create-temp-buffer-copy + 'flymake-proc-init-create-temp-buffer-copy "26.1") +(define-obsolete-function-alias 'flymake-simple-cleanup + 'flymake-proc-simple-cleanup "26.1") +(define-obsolete-function-alias 'flymake-get-real-file-name + 'flymake-proc-get-real-file-name "26.1") +(define-obsolete-function-alias 'flymake-master-cleanup + 'flymake-proc-master-cleanup "26.1") +(define-obsolete-function-alias 'flymake-get-make-cmdline + 'flymake-proc-get-make-cmdline "26.1") +(define-obsolete-function-alias 'flymake-get-ant-cmdline + 'flymake-proc-get-ant-cmdline "26.1") +(define-obsolete-function-alias 'flymake-simple-make-init-impl + 'flymake-proc-simple-make-init-impl "26.1") +(define-obsolete-function-alias 'flymake-simple-make-init + 'flymake-proc-simple-make-init "26.1") +(define-obsolete-function-alias 'flymake-master-make-init + 'flymake-proc-master-make-init "26.1") +(define-obsolete-function-alias 'flymake-find-make-buildfile + 'flymake-proc--find-make-buildfile "26.1") +(define-obsolete-function-alias 'flymake-master-make-header-init + 'flymake-proc-master-make-header-init "26.1") +(define-obsolete-function-alias 'flymake-simple-make-java-init + 'flymake-proc-simple-make-java-init "26.1") +(define-obsolete-function-alias 'flymake-simple-ant-java-init + 'flymake-proc-simple-ant-java-init "26.1") +(define-obsolete-function-alias 'flymake-simple-java-cleanup + 'flymake-proc-simple-java-cleanup "26.1") +(define-obsolete-function-alias 'flymake-perl-init + 'flymake-proc-perl-init "26.1") +(define-obsolete-function-alias 'flymake-php-init + 'flymake-proc-php-init "26.1") +(define-obsolete-function-alias 'flymake-simple-tex-init + 'flymake-proc-simple-tex-init "26.1") +(define-obsolete-function-alias 'flymake-master-tex-init + 'flymake-proc-master-tex-init "26.1") +(define-obsolete-function-alias 'flymake-xml-init + 'flymake-proc-xml-init "26.1") (provide 'flymake-proc) ;;; 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." (make-obsolete-variable 'flymake-gui-warnings-enabled "it no longer has any effect." "26.1") +(define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file + 'flymake-start-on-flymake-mode "26.1") + (defcustom flymake-start-on-flymake-mode t "Start syntax check when `flymake-mode' is enabled. Specifically, start it when the buffer is actually displayed." :version "26.1" :type 'boolean) -(define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file - 'flymake-start-on-flymake-mode "26.1") - (defcustom flymake-log-level -1 "Obsolete and ignored variable." :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 @@ "When non-nil, provides context for indenting embedded code chunks. There are languages where part of the code is actually written in -a sub language, e.g., a Yacc/Bison or ANTLR grammar also consists -of plain C code. This variable enables the major mode of the +a sub language, e.g., a Yacc/Bison or ANTLR grammar can also include +JS or Python code. This variable enables the primary mode of the main language to use the indentation engine of the sub-mode for lines in code chunks written in the sub-mode's language. @@ -64,37 +64,13 @@ mode, it should bind this variable to non-nil around the call. The non-nil value should be a list of the form: - (FIRST-COLUMN (START . END) PREVIOUS-CHUNKS) + (FIRST-COLUMN . REST) FIRST-COLUMN is the column the indentation engine of the sub-mode should use for top-level language constructs inside the code chunk (instead of 0). -START and END specify the region of the code chunk. END can be -nil, which stands for the value of `point-max'. The function -`prog-widen' uses this to restore restrictions imposed by the -sub-mode's indentation engine. - -PREVIOUS-CHUNKS, if non-nil, provides the indentation engine of -the sub-mode with the virtual context of the code chunk. Valid -values are: - - - A string containing text which the indentation engine can - consider as standing in front of the code chunk. To cache the - string's calculated syntactic information for repeated calls - with the same string, the sub-mode can add text-properties to - the string. - - A typical use case is for grammars with code chunks which are - to be indented like function bodies -- the string would contain - the corresponding function preamble. - - - A function, to be called with the start position of the current - chunk. It should return either the region of the previous chunk - as (PREV-START . PREV-END), or nil if there is no previous chunk. - - A typical use case are literate programming sources -- the - function would successively return the previous code chunks.") +REST is currently unused.") (defun prog-indent-sexp (&optional defun) "Indent the expression after point. @@ -113,23 +89,6 @@ instead." "Return the indentation column normally used for top-level constructs." (or (car prog-indentation-context) 0)) -(defun prog-widen () - "Remove restrictions (narrowing) from current code chunk or buffer. -This function should be used instead of `widen' in any function used -by the indentation engine to make it respect the value of -`prog-indentation-context'. - -This function (like `widen') is useful inside a -`save-restriction' to make the indentation correctly work when -narrowing is in effect." - (let ((chunk (cadr prog-indentation-context))) - (if chunk - ;; No call to `widen' is necessary here, as narrow-to-region - ;; changes (not just narrows) the existing restrictions - (narrow-to-region (car chunk) (or (cdr chunk) (point-max))) - (widen)))) - - (defvar-local prettify-symbols-alist nil "Alist of symbol prettifications. 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 @@ ;;; 24.x Compat -(unless (fboundp 'prog-widen) - (defun prog-widen () - (widen))) - (unless (fboundp 'prog-first-column) (defun prog-first-column () 0)) @@ -725,12 +721,18 @@ It makes underscores and dots word constituent chars.") ;;; Indentation +(define-obsolete-variable-alias + 'python-indent 'python-indent-offset "24.3") + (defcustom python-indent-offset 4 "Default indentation offset for Python." :group 'python :type 'integer :safe 'integerp) +(define-obsolete-variable-alias + 'python-guess-indent 'python-indent-guess-indent-offset "24.3") + (defcustom python-indent-guess-indent-offset t "Non-nil tells Python mode to guess `python-indent-offset' value." :type 'boolean @@ -750,12 +752,6 @@ It makes underscores and dots word constituent chars.") :type '(repeat symbol) :group 'python) -(define-obsolete-variable-alias - 'python-indent 'python-indent-offset "24.3") - -(define-obsolete-variable-alias - 'python-guess-indent 'python-indent-guess-indent-offset "24.3") - (defvar python-indent-current-level 0 "Deprecated var available for compatibility.") @@ -785,7 +781,7 @@ work on `python-indent-calculate-indentation' instead." (interactive) (save-excursion (save-restriction - (prog-widen) + (widen) (goto-char (point-min)) (let ((block-end)) (while (and (not block-end) @@ -883,8 +879,6 @@ keyword :at-dedenter-block-start - Point is on a line starting a dedenter block. - START is the position where the dedenter block starts." - (save-restriction - (prog-widen) (let ((ppss (save-excursion (beginning-of-line) (syntax-ppss)))) @@ -1022,7 +1016,7 @@ keyword (looking-at (python-rx block-ender))) :after-block-end) (t :after-line)) - (point))))))))) + (point)))))))) (defun python-indent--calculate-indentation () "Internal implementation of `python-indent-calculate-indentation'. @@ -1030,8 +1024,6 @@ May return an integer for the maximum possible indentation at current context or a list of integers. The latter case is only happening for :at-dedenter-block-start context since the possibilities can be narrowed to specific indentation points." - (save-restriction - (prog-widen) (save-excursion (pcase (python-indent-context) (`(:no-indent . ,_) (prog-first-column)) ; usually 0 @@ -1081,7 +1073,7 @@ possibilities can be narrowed to specific indentation points." (`(,(or :inside-paren-newline-start-from-block) . ,start) ;; Add two indentation levels to make the suite stand out. (goto-char start) - (+ (current-indentation) (* python-indent-offset 2))))))) + (+ (current-indentation) (* python-indent-offset 2)))))) (defun python-indent--calculate-levels (indentation) "Calculate levels list given INDENTATION. @@ -2042,6 +2034,9 @@ executed through tramp connections." :type '(repeat string) :group 'python) +(define-obsolete-variable-alias + 'python-shell-virtualenv-path 'python-shell-virtualenv-root "25.1") + (defcustom python-shell-virtualenv-root nil "Path to virtualenv root. This variable, when set to a string, makes the environment to be @@ -2050,9 +2045,6 @@ virtualenv." :type '(choice (const nil) string) :group 'python) -(define-obsolete-variable-alias - 'python-shell-virtualenv-path 'python-shell-virtualenv-root "25.1") - (defcustom python-shell-setup-codes nil "List of code run by `python-shell-send-setup-codes'." :type '(repeat symbol) @@ -3289,14 +3281,6 @@ def __PYTHON_EL_get_completions(text): :type 'string :group 'python) -(defcustom python-shell-completion-string-code - "';'.join(__PYTHON_EL_get_completions('''%s'''))" - "Python code used to get a string of completions separated by semicolons. -The string passed to the function is the current python name or -the full statement in the case of imports." - :type 'string - :group 'python) - (define-obsolete-variable-alias 'python-shell-completion-module-string-code 'python-shell-completion-string-code @@ -3309,6 +3293,14 @@ the full statement in the case of imports." "25.1" "Completion string code must work for (i)pdb.") +(defcustom python-shell-completion-string-code + "';'.join(__PYTHON_EL_get_completions('''%s'''))" + "Python code used to get a string of completions separated by semicolons. +The string passed to the function is the current python name or +the full statement in the case of imports." + :type 'string + :group 'python) + (defcustom python-shell-completion-native-disabled-interpreters ;; PyPy's readline cannot handle some escape sequences yet. Native ;; completion was found to be non-functional for IPython (see @@ -4040,6 +4032,9 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'." ;;; Skeletons +(define-obsolete-variable-alias + 'python-use-skeletons 'python-skeleton-autoinsert "24.3") + (defcustom python-skeleton-autoinsert nil "Non-nil means template skeletons will be automagically inserted. This happens when pressing \"if<SPACE>\", for example, to prompt for @@ -4048,9 +4043,6 @@ the if condition." :group 'python :safe 'booleanp) -(define-obsolete-variable-alias - 'python-use-skeletons 'python-skeleton-autoinsert "24.3") - (defvar python-skeleton-available '() "Internal list of available skeletons.") @@ -4593,7 +4585,7 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun. This function can be used as the value of `add-log-current-defun-function' since it returns nil if point is not inside a defun." (save-restriction - (prog-widen) + (widen) (save-excursion (end-of-line 1) (let ((names) @@ -4791,12 +4783,10 @@ likely an invalid python file." "Message the first line of the block the current statement closes." (let ((point (python-info-dedenter-opening-block-position))) (when point - (save-restriction - (prog-widen) (message "Closes %s" (save-excursion (goto-char point) (buffer-substring - (point) (line-end-position)))))))) + (point) (line-end-position))))))) (defun python-info-dedenter-statement-p () "Return point if current statement is a dedenter. @@ -4812,8 +4802,6 @@ statement." "Return non-nil if current line ends with backslash. With optional argument LINE-NUMBER, check that line instead." (save-excursion - (save-restriction - (prog-widen) (when line-number (python-util-goto-line line-number)) (while (and (not (eobp)) @@ -4822,14 +4810,12 @@ With optional argument LINE-NUMBER, check that line instead." (not (equal (char-before (point)) ?\\))) (forward-line 1)) (when (equal (char-before) ?\\) - (point-marker))))) + (point-marker)))) (defun python-info-beginning-of-backslash (&optional line-number) "Return the point where the backslashed line starts. Optional argument LINE-NUMBER forces the line number to check against." (save-excursion - (save-restriction - (prog-widen) (when line-number (python-util-goto-line line-number)) (when (python-info-line-ends-backslash-p) @@ -4838,15 +4824,13 @@ Optional argument LINE-NUMBER forces the line number to check against." (python-syntax-context 'paren)) (forward-line -1)) (back-to-indentation) - (point-marker))))) + (point-marker)))) (defun python-info-continuation-line-p () "Check if current line is continuation of another. When current line is continuation of another return the point where the continued line ends." (save-excursion - (save-restriction - (prog-widen) (let* ((context-type (progn (back-to-indentation) (python-syntax-context-type))) @@ -4872,7 +4856,7 @@ where the continued line ends." (python-util-forward-comment -1) (when (and (equal (1- line-start) (line-number-at-pos)) (python-info-line-ends-backslash-p)) - (point-marker)))))))) + (point-marker))))))) (defun python-info-block-continuation-line-p () "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." "\\)\\>"))) (eq (ruby-deep-indent-paren-p t) 'space) (not (bobp))) - (widen) (goto-char (or begin parse-start)) (skip-syntax-forward " ") (current-column)) |