emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c57a60e: Use lexical binding in ffap.el


From: Mattias Engdegård
Subject: master c57a60e: Use lexical binding in ffap.el
Date: Fri, 23 Oct 2020 05:16:06 -0400 (EDT)

branch: master
commit c57a60ee958821790a1fe4220a2c3837b664e9be
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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 94aba5e..bf03588 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]