* bug#35123: [PATCH] Use lexical-binding in bug-reference
@ 2019-04-03 14:40 Alex Branham
2019-04-03 16:42 ` Basil L. Contovounesios
0 siblings, 1 reply; 4+ messages in thread
From: Alex Branham @ 2019-04-03 14:40 UTC (permalink / raw)
To: 35123
[-- Attachment #1: Type: text/plain, Size: 461 bytes --]
Hi -
The attached patch switches bug-reference.el to use lexical binding.
There don't appear to be any tests for bug-reference, but I've tested it
locally and everything seems to work just fine. The patch also updates
.dir-locals so that bug-reference-url-format is set in all modes, not
just changelog mode. This helps users who e.g. use magit. Arguably that
should be two commits. Just let me know if you'd prefer that and I can
split it out.
Thanks,
Alex
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-lexical-binding-in-bug-reference.el.patch --]
[-- Type: text/x-patch, Size: 2718 bytes --]
From 2c463bf99835f907ab2c93ffc79fe8d7a4054e4b Mon Sep 17 00:00:00 2001
From: Alex Branham <alex.branham@gmail.com>
Date: Wed, 3 Apr 2019 09:36:23 -0500
Subject: [PATCH] Use lexical binding in bug-reference.el
* .dir-locals.el: Set bug-reference-url-format in all modes, not just
changelog mode.
* lisp/progmodes/bug-reference.el: Use lexical binding.
(bug-reference-unfontify):
(bug-reference-fontify): Mention args in docstring.
---
.dir-locals.el | 4 ++--
lisp/progmodes/bug-reference.el | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.dir-locals.el b/.dir-locals.el
index 9cd39920c2..506edfcf73 100644
--- a/.dir-locals.el
+++ b/.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)
@@ -12,7 +13,6 @@
(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)))
(diff-mode . ((mode . whitespace)))
(emacs-lisp-mode . ((indent-tabs-mode . nil)
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index 8baf74854f..d21f5b984f 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/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.
@@ -91,7 +91,7 @@ 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))))
@@ -99,7 +99,7 @@ The second subexpression should match the bug reference (usually a number)."
(defvar bug-reference-prog-mode)
(defun bug-reference-fontify (start end)
- "Apply bug reference overlays to region."
+ "Apply bug reference overlays to 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))))
--
2.19.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#35123: [PATCH] Use lexical-binding in bug-reference
2019-04-03 14:40 bug#35123: [PATCH] Use lexical-binding in bug-reference Alex Branham
@ 2019-04-03 16:42 ` Basil L. Contovounesios
2019-04-04 14:33 ` Alex Branham
2019-04-09 21:31 ` Alex Branham
0 siblings, 2 replies; 4+ messages in thread
From: Basil L. Contovounesios @ 2019-04-03 16:42 UTC (permalink / raw)
To: Alex Branham; +Cc: 35123
Alex Branham <alex.branham@gmail.com> writes:
> diff --git a/.dir-locals.el b/.dir-locals.el
> index 9cd39920c2..506edfcf73 100644
> --- a/.dir-locals.el
> +++ b/.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)
> @@ -12,7 +13,6 @@
> (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)))
> (diff-mode . ((mode . whitespace)))
> (emacs-lisp-mode . ((indent-tabs-mode . nil)
While you're at it, why not also change (mode . bug-reference)
to (eval . (bug-reference-mode)) as per the recommended way to enable
minor modes described in (info "(emacs) Specifying File Variables")?
Apart from that, and FWIW, LGTM.
Thanks,
--
Basil
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#35123: [PATCH] Use lexical-binding in bug-reference
2019-04-03 16:42 ` Basil L. Contovounesios
@ 2019-04-04 14:33 ` Alex Branham
2019-04-09 21:31 ` Alex Branham
1 sibling, 0 replies; 4+ messages in thread
From: Alex Branham @ 2019-04-04 14:33 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 35123
On Wed 03 Apr 2019 at 11:42, Basil L. Contovounesios <contovob@tcd.ie> wrote:
> While you're at it, why not also change (mode . bug-reference)
> to (eval . (bug-reference-mode)) as per the recommended way to enable
> minor modes described in (info "(emacs) Specifying File Variables")?
Sure, I can update that too.
Thanks,
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#35123: [PATCH] Use lexical-binding in bug-reference
2019-04-03 16:42 ` Basil L. Contovounesios
2019-04-04 14:33 ` Alex Branham
@ 2019-04-09 21:31 ` Alex Branham
1 sibling, 0 replies; 4+ messages in thread
From: Alex Branham @ 2019-04-09 21:31 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 35123-done
Pushed as commit d96b672f2b738bb6364023c2dcb9111efd3855ed to appear in Emacs 27.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-09 21:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-03 14:40 bug#35123: [PATCH] Use lexical-binding in bug-reference Alex Branham
2019-04-03 16:42 ` Basil L. Contovounesios
2019-04-04 14:33 ` Alex Branham
2019-04-09 21:31 ` Alex Branham
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).