diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-01-30 23:37:19 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-01-30 23:37:19 +0900 |
commit | 50c76b844bc79309b4f5d9e28a2386b9a6f735b7 (patch) | |
tree | 29f8273d8afccae1f16b723c36548cee150cb0bc /lisp/progmodes | |
parent | 563a0d94c379292bd88e83f18560ed21c497cea9 (diff) | |
parent | 96f20120c97a0a329fff81a0cc3747082a8a2c55 (diff) | |
download | emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.tar.gz emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.tar.bz2 emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/asm-mode.el | 3 | ||||
-rw-r--r-- | lisp/progmodes/bat-mode.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/compile.el | 7 | ||||
-rw-r--r-- | lisp/progmodes/flymake.el | 16 | ||||
-rw-r--r-- | lisp/progmodes/perl-mode.el | 7 | ||||
-rw-r--r-- | lisp/progmodes/project.el | 10 | ||||
-rw-r--r-- | lisp/progmodes/sh-script.el | 16 | ||||
-rw-r--r-- | lisp/progmodes/xref.el | 12 |
8 files changed, 45 insertions, 28 deletions
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el index 62ff783fbac..99b2ec6d87e 100644 --- a/lisp/progmodes/asm-mode.el +++ b/lisp/progmodes/asm-mode.el @@ -141,8 +141,7 @@ Special commands: (setq-local comment-add 1) (setq-local comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*") (setq-local comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)") - (setq-local comment-end "") - (setq fill-prefix "\t")) + (setq-local comment-end "")) (defun asm-indent-line () "Auto-indent the current line." diff --git a/lisp/progmodes/bat-mode.el b/lisp/progmodes/bat-mode.el index 44295c3f679..7ba8a69775e 100644 --- a/lisp/progmodes/bat-mode.el +++ b/lisp/progmodes/bat-mode.el @@ -1,4 +1,4 @@ -;;; bat-mode.el --- Major mode for editing DOS/Windows scripts +;;; bat-mode.el --- Major mode for editing DOS/Windows scripts -*- lexical-binding: t -*- ;; Copyright (C) 2003, 2008-2021 Free Software Foundation, Inc. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 94e4f3c6fa7..2c1e6ff52ec 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -3041,7 +3041,12 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if given." ;; Get the specified directory from FILE. (spec-directory (if (cdr file) - (file-truename (concat comint-file-name-prefix (cdr file)))))) + ;; This function is active in `compilation-filter'. + ;; There could be problems to call `file-truename' + ;; for remote compilation processes. + (if (file-remote-p default-directory) + (concat comint-file-name-prefix (cdr file)) + (file-truename (concat comint-file-name-prefix (cdr file))))))) ;; Check for a comint-file-name-prefix and prepend it if appropriate. ;; (This is very useful for compilation-minor-mode in an rlogin-mode diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 460af718aad..5d96c62b418 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -352,12 +352,20 @@ diagnostics at BEG." (flymake--diag-accessor flymake-diagnostic-data flymake--diag-data backend) (defun flymake-diagnostic-beg (diag) - "Get Flymake diagnostic DIAG's start position." - (overlay-start (flymake--diag-overlay diag))) + "Get Flymake diagnostic DIAG's start position. +This position only be queried after DIAG has been reported to Flymake." + (let ((overlay (flymake--diag-overlay diag))) + (unless overlay + (error "DIAG %s not reported to Flymake yet" diag)) + (overlay-start overlay))) (defun flymake-diagnostic-end (diag) - "Get Flymake diagnostic DIAG's end position." - (overlay-end (flymake--diag-overlay diag))) + "Get Flymake diagnostic DIAG's end position. +This position only be queried after DIAG has been reported to Flymake." + (let ((overlay (flymake--diag-overlay diag))) + (unless overlay + (error "DIAG %s not reported to Flymake yet" diag)) + (overlay-end overlay))) (cl-defun flymake--overlays (&key beg end filter compare key) "Get flymake-related overlays. diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index d047dd543c2..0120e4a7cd1 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -143,7 +143,7 @@ '(;; Functions (nil "^[ \t]*sub\\s-+\\([-[:alnum:]+_:]+\\)" 1) ;;Variables - ("Variables" "^[ \t]*\\(?:anon\\|argument\\|has\\|local\\|my\\|our\\|state\\|supersede\\)\\s-+\\([$@%][-[:alnum:]+_:]+\\)\\s-*=" 1) + ("Variables" "^[ \t]*\\(?:has\\|local\\|my\\|our\\|state\\)\\s-+\\([$@%][-[:alnum:]+_:]+\\)\\s-*=" 1) ("Packages" "^[ \t]*package\\s-+\\([-[:alnum:]+_:]+\\);" 1) ("Doc sections" "^=head[0-9][ \t]+\\(.*\\)" 1)) "Imenu generic expression for Perl mode. See `imenu-generic-expression'.") @@ -188,9 +188,8 @@ "\\>") ;; ;; Fontify declarators and prefixes as types. - ("\\<\\(anon\\|argument\\|has\\|local\\|my\\|our\\|state\\|supersede\\)\\>" . font-lock-type-face) ; declarators - ("\\<\\(let\\|temp\\)\\>" . font-lock-type-face) ; prefixes - ;; + ("\\<\\(has\\|local\\|my\\|our\\|state\\)\\>" . font-lock-type-face) ; declarators + ;; ;; Fontify function, variable and file name references. ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face) ;; Additionally fontify non-scalar variables. `perl-non-scalar-variable' diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 18124227d1b..fc5e30111e5 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,8 +1,8 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. -;; Version: 0.5.3 -;; Package-Requires: ((emacs "26.3") (xref "1.0.2")) +;; Version: 0.5.4 +;; Package-Requires: ((emacs "26.1") (xref "1.0.2")) ;; This is a GNU ELPA :core package. Avoid using functionality that ;; not compatible with the version of Emacs recorded above. @@ -928,16 +928,16 @@ if one already exists." ;;;###autoload (defun project-async-shell-command () "Run `async-shell-command' in the current project's root directory." - (interactive) (declare (interactive-only async-shell-command)) + (interactive) (let ((default-directory (project-root (project-current t)))) (call-interactively #'async-shell-command))) ;;;###autoload (defun project-shell-command () "Run `shell-command' in the current project's root directory." - (interactive) (declare (interactive-only shell-command)) + (interactive) (let ((default-directory (project-root (project-current t)))) (call-interactively #'shell-command))) @@ -974,8 +974,8 @@ loop using the command \\[fileloop-continue]." ;;;###autoload (defun project-compile () "Run `compile' in the project root." - (interactive) (declare (interactive-only compile)) + (interactive) (let ((default-directory (project-root (project-current t)))) (call-interactively #'compile))) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index d3692d47205..fd689527676 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1957,12 +1957,18 @@ May return nil if the line should not be treated as continued." ('(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt) (sh-var-value 'sh-indent-for-case-label))) (`(:before . ,(or "(" "{" "[" "while" "if" "for" "case")) - (if (not (smie-rule-prev-p "&&" "||" "|")) - (when (smie-rule-hanging-p) - (smie-rule-parent)) + (cond + ((and (equal token "{") (smie-rule-parent-p "for")) + (let ((data (smie-backward-sexp "in"))) + (when (equal (nth 2 data) "for") + `(column . ,(smie-indent-virtual))))) + ((not (smie-rule-prev-p "&&" "||" "|")) + (when (smie-rule-hanging-p) + (smie-rule-parent))) + (t (unless (smie-rule-bolp) (while (equal "|" (nth 2 (smie-backward-sexp 'halfexp)))) - `(column . ,(smie-indent-virtual))))) + `(column . ,(smie-indent-virtual)))))) ;; FIXME: Maybe this handling of ;; should be made into ;; a smie-rule-terminator function that takes the substitute ";" as arg. (`(:before . ,(or ";;" ";&" ";;&")) @@ -2927,8 +2933,8 @@ option followed by a colon `:' if the option accepts an argument." (put 'sh-assignment 'delete-selection t) (defun sh-assignment (arg) "Remember preceding identifier for future completion and do self-insert." - (interactive "p") (declare (obsolete nil "27.1")) + (interactive "p") (self-insert-command arg) (sh--assignment-collect)) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index aecb30a0ad4..18fdd963fb1 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2014-2021 Free Software Foundation, Inc. ;; Version: 1.0.4 -;; Package-Requires: ((emacs "26.3")) +;; Package-Requires: ((emacs "26.1")) ;; This is a GNU ELPA :core package. Avoid functionality that is not ;; compatible with the version of Emacs recorded above. @@ -967,16 +967,16 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." (let ((inhibit-read-only t) (buffer-undo-list t)) (save-excursion - (erase-buffer) (condition-case err - (xref--insert-xrefs - (xref--analyze (funcall xref--fetcher))) + (let ((alist (xref--analyze (funcall xref--fetcher)))) + (erase-buffer) + (xref--insert-xrefs alist)) (user-error + (erase-buffer) (insert (propertize (error-message-string err) - 'face 'error)))) - (goto-char (point-min))))) + 'face 'error))))))) (defun xref-show-definitions-buffer (fetcher alist) "Show the definitions list in a regular window. |