From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#25823: 26.0.50; describe-function: Don't require cl-lib at runtime Date: Tue, 21 Feb 2017 12:39:29 +0900 Message-ID: <87mvdgdxfy.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1487648416 2542 195.159.176.226 (21 Feb 2017 03:40:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2017 03:40:16 +0000 (UTC) Cc: stefan monnier , tino.calancha@gmail.com To: 25823@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 21 04:40:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg1JA-0008Tb-PF for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Feb 2017 04:40:09 +0100 Original-Received: from localhost ([::1]:42112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg1JG-0008VN-Cl for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Feb 2017 22:40:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg1JA-0008UI-9n for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 22:40:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg1J5-0002JB-DZ for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 22:40:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cg1J5-0002J5-AU for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 22:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cg1J4-00075o-GH; Mon, 20 Feb 2017 22:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2017 03:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: stefan monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.148764839227240 (code B ref -1); Tue, 21 Feb 2017 03:40:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Feb 2017 03:39:52 +0000 Original-Received: from localhost ([127.0.0.1]:48031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg1Iu-00075H-0x for submit@debbugs.gnu.org; Mon, 20 Feb 2017 22:39:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg1Is-000753-LE for submit@debbugs.gnu.org; Mon, 20 Feb 2017 22:39:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg1Im-0002GN-62 for submit@debbugs.gnu.org; Mon, 20 Feb 2017 22:39:45 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53155) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg1Im-0002GI-31 for submit@debbugs.gnu.org; Mon, 20 Feb 2017 22:39:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg1Ik-0008Rl-FC for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 22:39:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg1If-0002CK-Fk for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 22:39:42 -0500 Original-Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:35993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cg1If-0002BR-8X for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2017 22:39:37 -0500 Original-Received: by mail-pg0-x242.google.com with SMTP id a123so13044350pgc.3 for ; Mon, 20 Feb 2017 19:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version; bh=pAQw15vL3Ecl0PlXChGMQPv2AmRFv94T7Vc4hNcuiOc=; b=o1U7vY9vodAj26FZS3QCk0gOc59yb/joWRG2plLJv0urNpOKTvSGXi3HftWMPi6Oap O3Ba3za4Ls8ws02DmCiS1/Yx+L9FvlE2yXYT8OOuUhcD7lehydfLU9QW1cj8FDEpNoaG mjkM8V3v2ZyclzuIzZeAVhunMl1qIlrcn1LCw7YHfLqjvrlAG9cIwW/uTDnPxTBs2KmV E5J0zpc3pW0Y3PPyeaZgzqnnFrk3GSzLwEZbvVLhCOISP/W3d9cLwc3A+bfIfTDjCqls pRYQxtGbIEKt4Mt6r4AfD/EkgkaYHpZtNraeJU6Dw+dJIUHJUYqHR7o3ZO+j+yup1RE+ K9IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=pAQw15vL3Ecl0PlXChGMQPv2AmRFv94T7Vc4hNcuiOc=; b=oS87hCznSXum/msR//8EBwQyXXqqURkq/b7Tn+JC/g6sNuxOPzADTJIfPp9H9MCGe5 /Rslub3c/xsbL27D0IP0El3/BaHVKNRTenHTWyAqtyz3l8rPitTYUW5ViyoDKUdrkA3p impQJAzORuf39ydjLD7hdtnYKxWkxFWj9PdSXIeyTyq1miq8PA9ewFWLximtaapVWU38 saCVzSBiN45O0kRIE072ASF9hn5Y4wHlp840HYEcXnLh/DUu3LkUuW9lz/xXTssB03UJ 1Rb9DdgjaA4SZg28iLA7cuY9ytn3iODc2aaKxti9qjUXRYzEzvD71eLomxKqNzfGzOcM JS4g== X-Gm-Message-State: AMke39mcaXmFanN7WXT/yO5AQbc4ioUBsUXc13AMr2bnek4e9+4WnjZmZqYkdV5I7YqYBA== X-Received: by 10.84.247.23 with SMTP id n23mr3282844pll.39.1487648376060; Mon, 20 Feb 2017 19:39:36 -0800 (PST) Original-Received: from calancha-pc (104.81.147.124.dy.bbexcite.jp. [124.147.81.104]) by smtp.gmail.com with ESMTPSA id p15sm37474385pfk.58.2017.02.20.19.39.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2017 19:39:35 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129610 Archived-At: X-Debbugs-CC: Stefan Monnier emacs -Q: I) (progn (describe-function 'dolist) (delete-other-windows) (featurep 'cl-lib)) => t The patch below prevent to load cl-lib in this case. II) After the patch, we still load extra libs in _interactive_ calls. ;; (Applied patch below) (progn (describe-function 'mapc) (delete-other-windows) (featurep 'cl-lib)) => nil ;; Now interactively. M-x describe-function RET mapc RET M-: (featurep 'cl-lib) RET => t ;; Becase it loads map.el which depends on seq.el, and ;; this one depends on cl-lib. ;; ;; IMO, an input "mapc" should not load map.el, ;; because "mapc" doesn't match a prefix "map-". ;; Does it have sense for you? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From ff83f7b3d8f48eeef037f6e7606ba3c3be3fb3c2 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 21 Feb 2017 12:20:35 +0900 Subject: [PATCH] help-mode: Don't require cl-lib at run-time * lisp/help-mode.el: Require cl-lib at compile time (Bug#25823). (help--find-symbol): New defun. (help-make-xrefs): Use it instead of cl-some. * lisp/help-fns.el: Require cl-lib at compile time. (describe-symbol): Use help--find-symbol. --- lisp/help-fns.el | 8 +++----- lisp/help-mode.el | 10 +++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 742c66919a..479d109ce9 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -32,7 +32,7 @@ ;;; Code: -(require 'cl-lib) +(eval-when-compile (require 'cl-lib)) (require 'help-mode) (require 'radix-tree) @@ -1089,8 +1089,7 @@ describe-symbol current buffer and the selected frame, respectively." (interactive (let* ((v-or-f (symbol-at-point)) - (found (cl-some (lambda (x) (funcall (nth 1 x) v-or-f)) - describe-symbol-backends)) + (found (help--find-symbol v-or-f)) (v-or-f (if found v-or-f (function-called-at-point))) (found (or found v-or-f)) (enable-recursive-minibuffers t) @@ -1100,8 +1099,7 @@ describe-symbol "Describe symbol: ") obarray (lambda (vv) - (cl-some (lambda (x) (funcall (nth 1 x) vv)) - describe-symbol-backends)) + (help--find-symbol vv)) t nil nil (if found (symbol-name v-or-f))))) (list (if (equal val "") diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 3fb793e7aa..0196577206 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -30,7 +30,7 @@ ;;; Code: (require 'button) -(require 'cl-lib) +(eval-when-compile (require 'cl-lib)) (eval-when-compile (require 'easymenu)) (defvar help-mode-map @@ -400,6 +400,11 @@ describe-symbol-backends (get symbol 'variable-documentation))) ,#'describe-variable))) +(defun help--find-symbol (sym) + (catch 'found + (cl-loop for seq the elements of describe-symbol-backends + do (when (funcall (nth 1 seq) sym) + (throw 'found t))))) ;;;###autoload (defun help-make-xrefs (&optional buffer) "Parse and hyperlink documentation cross-references in the given BUFFER. @@ -502,8 +507,7 @@ help-make-xrefs ;; (pop-to-buffer (car location)) ;; (goto-char (cdr location)))) (help-xref-button 8 'help-function-def sym)) - ((cl-some (lambda (x) (funcall (nth 1 x) sym)) - describe-symbol-backends) + ((help--find-symbol sym) (help-xref-button 8 'help-symbol sym))))))) ;; An obvious case of a key substitution: (save-excursion -- 2.11.0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.7) of 2017-02-21 Repository revision: 96cea19842b577eb4f2e057d702aea54d736233e