Skip to content

Commit

Permalink
Use URLs for bugs. (#397)
Browse files Browse the repository at this point in the history
This is more universal and obvious than relying on ‘bug-reference-mode’.
  • Loading branch information
phst authored Sep 19, 2023
1 parent e1ab5a8 commit df597ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
4 changes: 1 addition & 3 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((emacs-lisp-mode . ((mode . bug-reference-prog)
(bug-reference-url-format . "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s")))
(org-mode . ((org-adapt-indentation . nil)
((org-mode . ((org-adapt-indentation . nil)
(org-edit-src-content-indentation . 0)))
(nil . ((fill-column . 80))))
17 changes: 9 additions & 8 deletions bazel.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

;;; Code:

;; Work around Bug#44481.
;; Work around https://bugs.gnu.org/44481.
;; TODO(phst): Add this workaround to rules_elisp instead.
(eval-and-compile
(when (version< emacs-version "27.2")
Expand Down Expand Up @@ -222,7 +222,8 @@ of the symbols ‘build’, ‘bzl’, ‘workspace’, ‘module’, or
(let* ((default-directory directory)
(temporary-file-directory
(if (< emacs-major-version 28)
(file-name-unquote temporary-file-directory) ; Bug#48177
;; https://bugs.gnu.org/48177
(file-name-unquote temporary-file-directory)
temporary-file-directory))
(inhibit-read-only t)
(process-file-side-effects t)
Expand Down Expand Up @@ -2266,7 +2267,7 @@ completion to test targets. This is a helper function for
(cl-check-type package string)
(cl-check-type string string)
;; The cases below shouldn’t rebind the PACKAGE or ROOT parameters due to
;; Bug#53071.
;; https://bugs.gnu.org/53071.
(pcase string
;; The following patterns should cover all potential target patterns from
;; https://bazel.build/run/build#specifying-build-targets as well as their
Expand Down Expand Up @@ -2302,7 +2303,7 @@ completion to test targets. This is a helper function for
;; be completed to “//”.
(bazel--completion-table-with-prefix prefix '("//")))
((rx bos
;; Can’t use ‘(? … (let …))’ due to Bug#44532.
;; Can’t use ‘(? … (let …))’ due to https://bugs.gnu.org/44532.
(opt ?@ (let workspace (* (not (any ?: ?/))))) "//"
eos)
;; In the workspace root, offer “:” to start completing rules, as well as
Expand All @@ -2321,7 +2322,7 @@ completion to test targets. This is a helper function for
(when pattern
(bazel--completion-table-with-prefix prefix '("..."))))
((rx bos
;; Can’t use ‘(? … (let …))’ due to Bug#44532.
;; Can’t use ‘(? … (let …))’ due to https://bugs.gnu.org/44532.
(opt ?@ (let workspace (+ (not (any ?: ?/))))) "//"
(let pkg (+ (not (any ?:)))) ?/
eos)
Expand All @@ -2332,7 +2333,7 @@ completion to test targets. This is a helper function for
pattern)))
((rx bos
(let prefix
;; Can’t use ‘(? … (let …))’ due to Bug#44532.
;; Can’t use ‘(? … (let …))’ due to https://bugs.gnu.org/44532.
(opt ?@ (let workspace (* (not (any ?: ?/))))) "//"
(let pkg (* (not (any ?:))))
?:)
Expand All @@ -2344,7 +2345,7 @@ completion to test targets. This is a helper function for
(bazel--target-completion-table-2 root (or workspace "") pkg pattern
only-tests nil)))
((rx bos
;; Can’t use ‘(? … (let …))’ due to Bug#44532.
;; Can’t use ‘(? … (let …))’ due to https://bugs.gnu.org/44532.
(let prefix (opt ?@ (let workspace (* (not (any ?: ?/))))) "//")
(+ (not (any ?:)))
eos)
Expand Down Expand Up @@ -2783,7 +2784,7 @@ The returned completion table completes strings of the form

(defalias 'bazel--json-parse-buffer
(if (and (fboundp 'json-parse-buffer)
;; Work around Bug#48228.
;; Work around https://bugs.gnu.org/48228.
(or (not (eq system-type 'windows-nt))
(and (fboundp 'json-serialize)
(stringp (ignore-errors (json-serialize nil))))))
Expand Down
10 changes: 6 additions & 4 deletions test.el
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ gets killed early."
(marker-buffer
(xref-location-marker
(xref-item-location def))))))
;; Work around Bug#46219.
;; Work around https://bugs.gnu.org/46219.
(cl-callf file-name-unquote root)
(cl-callf file-name-unquote ref-file)
(push (list (substring-no-properties identifier)
Expand Down Expand Up @@ -416,7 +416,8 @@ gets killed early."
(when (< 4 (point) (- (point-max) 5)) (should in-string-p))
(should-not in-comment-p)
;; The syntactic start of a triple-quoted string could be on the first
;; (Emacs 27) or the last (Emacs 28) quote, cf. Bug#49518.
;; (Emacs 27) or the last (Emacs 28) quote,
;; cf. https://bugs.gnu.org/49518.
(should (eq (not in-string-p) (not string-start))))
(should (eq (face-at-point)
(and (< (point) (1- (point-max))) 'font-lock-string-face)))
Expand All @@ -441,11 +442,12 @@ gets killed early."

(ert-deftest bazel/project-files ()
"Test ‘project-files’ support for Bazel workspaces."
;; Try to work around Bug#48471 by picking GNU find on macOS.
;; Try to work around https://bugs.gnu.org/48471 by picking GNU find on macOS.
(let ((find-program (if (eq system-type 'darwin) "gfind" find-program)))
(skip-unless (executable-find find-program))
(bazel-test--with-temp-directory dir "project.org"
(let* ((dir (file-name-unquote dir)) ; unquote to work around Bug#47799
;; Unquote to work around https://bugs.gnu.org/47799.
(let* ((dir (file-name-unquote dir))
(project (project-current nil dir))
(files (project-files project)))
(should project)
Expand Down

0 comments on commit df597ac

Please sign in to comment.