From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Beck Newsgroups: gmane.emacs.bugs Subject: bug#8297: Request: Better Emacs self-documentation for customization Date: Wed, 23 Mar 2011 09:59:37 +0100 Message-ID: <4D89B679.3030804@miszellen.de> References: <4D854552.6000509@miszellen.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1300872401 1067 80.91.229.12 (23 Mar 2011 09:26:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2011 09:26:41 +0000 (UTC) To: 8297@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 23 10:26:35 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2KKp-0008Ux-6x for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Mar 2011 10:26:35 +0100 Original-Received: from localhost ([127.0.0.1]:51380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2K6P-0006t7-0l for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Mar 2011 05:11:41 -0400 Original-Received: from [140.186.70.92] (port=43830 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2K28-00053f-JW for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2011 05:11:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2K1x-0005er-U6 for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2011 05:07:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2K1x-0005ek-AA for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2011 05:07:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q2JvA-0005bo-Hy; Wed, 23 Mar 2011 05:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Florian Beck Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Mar 2011 09:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8297 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8297-submit@debbugs.gnu.org id=B8297.130087078821517 (code B ref 8297); Wed, 23 Mar 2011 09:00:04 +0000 Original-Received: (at 8297) by debbugs.gnu.org; 23 Mar 2011 08:59:48 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2Jut-0005b0-8m for submit@debbugs.gnu.org; Wed, 23 Mar 2011 04:59:47 -0400 Original-Received: from mo-p00-ob.rzone.de ([81.169.146.160]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2Jup-0005ai-68 for 8297@debbugs.gnu.org; Wed, 23 Mar 2011 04:59:44 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1300870777; l=2488; s=domk; d=streitblatt.de; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References: Subject:To:MIME-Version:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=0TGQFAilRC9SaIw8aFdsPx3Nez0=; b=VYwSvx66db+I1uLUzxOfIMK6JD9RQXQZTbcFAKGQhjBDBeELQuG+b4Ld0LGTYJUZOAG Yf2VkZoqq0LYs/QW7UupD24Pry+08H1tArh8rvAlGl1HWxF1H0f2q0IZ+yPi6bPbY56Dt V5z1nl/saQKDXcoIdmtTYFIoBOVNcYS1jB8= X-RZG-AUTH: :KmALZ0mpdbGonPxw7gDkop508XQjelhLxGYn4B74/jTNdrjLjuwMuuiy8j0BYXGgeN5xhQ== X-RZG-CLASS-ID: mo00 Original-Received: from [192.168.2.100] (p5499481F.dip.t-dialin.net [84.153.72.31]) by post.strato.de (jimi mo5) (RZmta 25.8) with ESMTPA id Y02858n2N7icF5 for <8297@debbugs.gnu.org>; Wed, 23 Mar 2011 09:59:36 +0100 (MET) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 23 Mar 2011 05:00:04 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45279 Archived-At: On 03/21/2011 11:00 PM, Stefan Monnier wrote: > Note that for your case, another option is to use a defadvice, and > indeed defadvice should also add a hyperlink to the advice. Right. So that one is not so urgent. It is only that I already have quite some redefined functions (from the emacs source or from third-party packages) and finding the original definition can be surprisingly difficult. > >> - 'describe-variable', on the other hand, remembers the original >> definition, but doesn't remember the place where I changed the value. > > That might turn out to be more difficult to track, but at least for some > simple cases (e.g. when the vlue is changed via `custom' functions rather > than via `setq') that should definitely be doable. If the var was set > via `setq' it's more difficult since `setq' is a very low-level > primitive that needs to run fast. Understood. Again, unfortunatly `setq' is what I have. Perhaps an old-fashioned but definitly valid way of customizing. > But maybe we could somehow handle > `setq' outside of functions in a special way (these shouldn't impact > performance since they can't be in loops). That would be great indeed. > >> - `describe-key' only provides a link to the function, not to the place the >> key was defined. > > That's also more difficult because OT1H `define-key' does not get much > information (it can check load-file-name, but it doesn't know the line > number, nor the name of the map it receives and neither does it know > reliably what the key description looks like in the source file, so it's > hard to do a regexp-search), and OTOH there's no place currently to > store that information, tho I guess we could keep it in some side > hash-table. This one, on the other hand, is a major annoyance. Say, I use `global-set-key' to customize a key binding. I continue working with my emacs session, maybe for day. But the next time I start emacs, the binding is overwritten, because I defined the same key in some other file. > >> Obviously, this is not easy, because evaluations don't necessarily >> have a fixed place and key bindings can be defined in many ways. Regardless, >> I think this is something on which Emacs could improve. > > Agreed. It's not high on my todo list, but I'll be happy to take > patches for those. For defadvice it should be pretty easy, and for > function re-definitions it shouldn't be too hard either. > > > Stefan > > > >