From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: Loading when viewing docstring of autoloaded function Date: Sat, 23 Jun 2012 22:22:00 +0200 Message-ID: <87pq8pixsn.fsf@gmail.com> References: <87395mgy6t.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1340482937 9615 80.91.229.3 (23 Jun 2012 20:22:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Jun 2012 20:22:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 23 22:22:16 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SiWqU-00020F-U6 for ged-emacs-devel@m.gmane.org; Sat, 23 Jun 2012 22:22:15 +0200 Original-Received: from localhost ([::1]:49490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiWqU-0003uz-IY for ged-emacs-devel@m.gmane.org; Sat, 23 Jun 2012 16:22:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiWqR-0003ui-VW for emacs-devel@gnu.org; Sat, 23 Jun 2012 16:22:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiWqQ-0001XZ-DM for emacs-devel@gnu.org; Sat, 23 Jun 2012 16:22:11 -0400 Original-Received: from mail-wi0-f171.google.com ([209.85.212.171]:41555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiWqN-0001Ws-75; Sat, 23 Jun 2012 16:22:07 -0400 Original-Received: by wibhq4 with SMTP id hq4so1243870wib.12 for ; Sat, 23 Jun 2012 13:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=TIh3u79mAdNwsxEYkeZlRYvPY+boi1sV+V8Wmrr5xS8=; b=kOACm2em/xgyt5PnYoK8V4Wwl2ZVzGzrx6JInz6uCOPAEF7Mu5FvJ/0CRNM0lkeGfr I5pfF/jEFkwE0dts/zT1b6qS6NLO+yyo4xn0Jj7ZRJ7OYATY2q09sQ+xe3HsID7Sp6Hv 2a0R93WYgV+/Fk8PnIfua5h8lDxkVIypA/FqyPOmm2IXWOPE8lsgdJO6uqNzBI7VmPv4 Olpj8uRpbpkYbwqGCGHNcHfwHTOuugbGi2G9qRJu11oU/dCTMpzsB4iCexpmNakDSno4 wacM/4+IiLJRjOMCdGRKB0ur6zOsgeqLARYbLslVFPxN6/hmTTRz/KRDbfBAgMzgnugw +ECQ== Original-Received: by 10.180.99.70 with SMTP id eo6mr13405249wib.17.1340482923453; Sat, 23 Jun 2012 13:22:03 -0700 (PDT) Original-Received: from localhost (176.119.broadband10.iol.cz. [90.177.119.176]) by mx.google.com with ESMTPS id t8sm5797787wiy.3.2012.06.23.13.22.01 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jun 2012 13:22:02 -0700 (PDT) In-Reply-To: <87395mgy6t.fsf@gnu.org> (Chong Yidong's message of "Sat, 23 Jun 2012 17:44:10 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.171 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151115 Archived-At: On Sat, 23 Jun 2012 17:44:10 +0800 Chong Yidong wrote: > It's a long-standing problem that documentation viewed with C-h * might > not make much sense if it refers to stuff defined in a library that has > not yet been loaded. > > The most annoying aspect is that autoloaded functions often have > docstrings containing key substitution constructs, which are expanded > into `M-x FOO' because the relevant keymaps are not yet defined. I'd > like to suggest a simple workaround: if an autoloaded function contains > key substitution constructs, just outright load the library where it was > defined. There's not much point in being conservative about loading > libraries, since it is so fast nowadays. See attached patch. > > Alternatively, we could introduce a full-blown solution by adding a new > docstring substitution construct to invoke library loading, but I'm not > sure we need that. > > Opinions? Other than the fact that this is not a solution but workaround, I don't like the idea. Loading may be fast, but the loaded libraries use memory and change the environment, which seems too much to pay for a docstring or seeing a proper key binding (which you might never want to actually use) to me. So if you do this, please at least do provide an option to turn it off. --=20 =C5=A0t=C4=9Bp=C3=A1n