From c57a60ee958821790a1fe4220a2c3837b664e9be Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Fri, 23 Oct 2020 11:11:51 +0200 Subject: [PATCH] Use lexical binding in ffap.el * lisp/ffap.el (ffap-search-backward-file-end): Remove binding for variable shadowing an optional (and never used) argument. (ffap--gopher-var-on-line): Remove unused variable. --- lisp/ffap.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 94aba5e5fb5..bf035886006 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1,4 +1,4 @@ -;;; ffap.el --- find file (or url) at point +;;; ffap.el --- find file (or url) at point -*- lexical-binding: t -*- ;; Copyright (C) 1995-1997, 2000-2020 Free Software Foundation, Inc. @@ -1139,7 +1139,7 @@ Move point and return point if an adjustment was done." (unless dir-separator (setq dir-separator "/")) (let ((opoint (point)) - point punct end whitespace-p) + point punct whitespace-p) (when (re-search-backward (regexp-quote dir-separator) (line-beginning-position) t) ;; Move to the beginning of the match.. @@ -1360,12 +1360,14 @@ Set to nil to disable matching gopher bookmarks.") (defun ffap--gopher-var-on-line () "Return (KEY . VALUE) of gopher bookmark on current line." (save-excursion - (let ((eol (progn (end-of-line) (skip-chars-backward " ") (point))) - (bol (progn (beginning-of-line) (point)))) - (when (re-search-forward ffap-gopher-regexp eol t) - (let ((key (match-string 1)) - (val (buffer-substring-no-properties (match-end 0) eol))) - (cons (intern (downcase key)) val)))))) + (end-of-line) + (skip-chars-backward " ") + (let ((eol (point))) + (beginning-of-line) + (when (re-search-forward ffap-gopher-regexp eol t) + (let ((key (match-string 1)) + (val (buffer-substring-no-properties (match-end 0) eol))) + (cons (intern (downcase key)) val)))))) (defun ffap-gopher-at-point () "If point is inside a gopher bookmark block, return its URL. -- 2.39.2