Skip to content

Commit

Permalink
Use lexical-binding in bug-reference.el
Browse files Browse the repository at this point in the history
* .dir-locals.el: Set bug-reference-url-format in all modes, not just
changelog mode. Use (eval . (bug-reference-mode)) as described
in (info "(emacs) Specifying File Variables")
* lisp/progmodes/bug-reference.el: Use lexical binding.
(bug-reference-unfontify):
(bug-reference-fontify): Mention args in docstring.

Bug#35123
  • Loading branch information
jabranham committed Apr 9, 2019
1 parent 6cb4992 commit d96b672
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .dir-locals.el
@@ -1,6 +1,7 @@
((nil . ((tab-width . 8)
(sentence-end-double-space . t)
(fill-column . 70)))
(fill-column . 70)
(bug-reference-url-format . "https://debbugs.gnu.org/%s")))
(c-mode . ((c-file-style . "GNU")
(c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK"))
(electric-quote-comment . nil)
Expand All @@ -12,8 +13,7 @@
(log-edit-setup-add-author . t)))
(change-log-mode . ((add-log-time-zone-rule . t)
(fill-column . 74)
(bug-reference-url-format . "https://debbugs.gnu.org/%s")
(mode . bug-reference)))
(eval . (bug-reference-mode))))
(diff-mode . ((mode . whitespace)))
(emacs-lisp-mode . ((indent-tabs-mode . nil)
(electric-quote-comment . nil)
Expand Down
6 changes: 3 additions & 3 deletions lisp/progmodes/bug-reference.el
@@ -1,4 +1,4 @@
;; bug-reference.el --- buttonize bug references
;; bug-reference.el --- buttonize bug references -*- lexical-binding: t; -*-

;; Copyright (C) 2008-2019 Free Software Foundation, Inc.

Expand Down Expand Up @@ -91,15 +91,15 @@ The second subexpression should match the bug reference (usually a number)."
(bug-reference-set-overlay-properties)

(defun bug-reference-unfontify (start end)
"Remove bug reference overlays from region."
"Remove bug reference overlays from the region between START and END."
(dolist (o (overlays-in start end))
(when (eq (overlay-get o 'category) 'bug-reference)
(delete-overlay o))))

(defvar bug-reference-prog-mode)

(defun bug-reference-fontify (start end)
"Apply bug reference overlays to region."
"Apply bug reference overlays to the region between START and END."
(save-excursion
(let ((beg-line (progn (goto-char start) (line-beginning-position)))
(end-line (progn (goto-char end) (line-end-position))))
Expand Down

0 comments on commit d96b672

Please sign in to comment.