emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/elisp-benchmarks c8fe76b: * benchmarks/pcase.el: Don't


From: Stefan Monnier
Subject: [elpa] externals/elisp-benchmarks c8fe76b: * benchmarks/pcase.el: Don't hide the real `pcase.el`
Date: Thu, 3 Sep 2020 21:17:44 -0400 (EDT)

branch: externals/elisp-benchmarks
commit c8fe76bab0ee16457ec9d3258741e4717f77d74f
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * benchmarks/pcase.el: Don't hide the real `pcase.el`
---
 benchmarks/pcase.el | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/benchmarks/pcase.el b/benchmarks/pcase.el
index 22d9407..110027a 100644
--- a/benchmarks/pcase.el
+++ b/benchmarks/pcase.el
@@ -1,4 +1,4 @@
-;; -*- lexical-binding: t; -*-
+;;; bench/pcase.el --- Exercise code using pcase  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2020 Free Software Foundation, Inc.
 
@@ -17,10 +17,28 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
 
+(eval-and-compile
+  ;; ¡FIXME!  The GNUmakefile of elpa.git uses:
+  ;;
+  ;;    ... -L $(dir $@) -f batch-byte-compile $<
+  ;;
+  ;; to compile each file.  This is handy for some cases such as files in
+  ;; `contrib' subdirectories but for this `pcase.el' file it causes this
+  ;; `pcase.el' to hide the *real* `pcase.el'.  So we workaround this problem
+  ;; here by removing the offending element from `load-path'.  Yuck!
+  ;;
+  ;; We should probably change GNUmakefile instead so it doesn't forcefully
+  ;; add the directory to `load-path', e.g. make this dependent on the
+  ;; presence of special file like `.dont-add-to-load-path'. 
+  (when load-file-name
+    (setq load-path (remove (file-name-directory load-file-name) load-path))))
+
 ;;; Commentary:
 
 ;; Apply a simple pattern match defined with pcase on the element of a list.
 
+;;; Code:
+
 (require 'cl-lib)
 
 (defvar elb-pcase-len 5000)



reply via email to

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