aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Branham2019-04-09 16:27:50 -0500
committerAlex Branham2019-04-09 16:29:09 -0500
commitd96b672f2b738bb6364023c2dcb9111efd3855ed (patch)
tree0da54b89dc2b3e745174c1852dcab88243ea7707
parent6cb49922e63c2523ccdd6e0a6bd72bcfa72c50c6 (diff)
downloademacs-d96b672f2b738bb6364023c2dcb9111efd3855ed.tar.gz
emacs-d96b672f2b738bb6364023c2dcb9111efd3855ed.zip
Use lexical-binding in bug-reference.el
* .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
-rw-r--r--.dir-locals.el6
-rw-r--r--lisp/progmodes/bug-reference.el6
2 files changed, 6 insertions, 6 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index 9cd39920c23..ffd65c88027 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,6 +1,7 @@
1((nil . ((tab-width . 8) 1((nil . ((tab-width . 8)
2 (sentence-end-double-space . t) 2 (sentence-end-double-space . t)
3 (fill-column . 70))) 3 (fill-column . 70)
4 (bug-reference-url-format . "https://debbugs.gnu.org/%s")))
4 (c-mode . ((c-file-style . "GNU") 5 (c-mode . ((c-file-style . "GNU")
5 (c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK")) 6 (c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK"))
6 (electric-quote-comment . nil) 7 (electric-quote-comment . nil)
@@ -12,8 +13,7 @@
12 (log-edit-setup-add-author . t))) 13 (log-edit-setup-add-author . t)))
13 (change-log-mode . ((add-log-time-zone-rule . t) 14 (change-log-mode . ((add-log-time-zone-rule . t)
14 (fill-column . 74) 15 (fill-column . 74)
15 (bug-reference-url-format . "https://debbugs.gnu.org/%s") 16 (eval . (bug-reference-mode))))
16 (mode . bug-reference)))
17 (diff-mode . ((mode . whitespace))) 17 (diff-mode . ((mode . whitespace)))
18 (emacs-lisp-mode . ((indent-tabs-mode . nil) 18 (emacs-lisp-mode . ((indent-tabs-mode . nil)
19 (electric-quote-comment . nil) 19 (electric-quote-comment . nil)
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index 759db1f5686..813ecbe3847 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -1,4 +1,4 @@
1;; bug-reference.el --- buttonize bug references 1;; bug-reference.el --- buttonize bug references -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2008-2019 Free Software Foundation, Inc. 3;; Copyright (C) 2008-2019 Free Software Foundation, Inc.
4 4
@@ -91,7 +91,7 @@ The second subexpression should match the bug reference (usually a number)."
91(bug-reference-set-overlay-properties) 91(bug-reference-set-overlay-properties)
92 92
93(defun bug-reference-unfontify (start end) 93(defun bug-reference-unfontify (start end)
94 "Remove bug reference overlays from region." 94 "Remove bug reference overlays from the region between START and END."
95 (dolist (o (overlays-in start end)) 95 (dolist (o (overlays-in start end))
96 (when (eq (overlay-get o 'category) 'bug-reference) 96 (when (eq (overlay-get o 'category) 'bug-reference)
97 (delete-overlay o)))) 97 (delete-overlay o))))
@@ -99,7 +99,7 @@ The second subexpression should match the bug reference (usually a number)."
99(defvar bug-reference-prog-mode) 99(defvar bug-reference-prog-mode)
100 100
101(defun bug-reference-fontify (start end) 101(defun bug-reference-fontify (start end)
102 "Apply bug reference overlays to region." 102 "Apply bug reference overlays to the region between START and END."
103 (save-excursion 103 (save-excursion
104 (let ((beg-line (progn (goto-char start) (line-beginning-position))) 104 (let ((beg-line (progn (goto-char start) (line-beginning-position)))
105 (end-line (progn (goto-char end) (line-end-position)))) 105 (end-line (progn (goto-char end) (line-end-position))))