From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wojciech Meyer Newsgroups: gmane.emacs.devel Subject: Re: Refreshing Info nodes Date: Mon, 13 Sep 2010 11:22:50 +0100 Message-ID: References: <87631mkeic.fsf@gmail.com> <87hbl54oi0.fsf@mail.jurta.org> <87r5k9clxh.fsf@mail.jurta.org> <87hbl4kn77.fsf@mail.jurta.org> <87bpbbkgt1.fsf@gmail.com> <87vd6upj5m.fsf@gmail.com> <83d3t2lavg.fsf@gnu.org> <8739ty9ybi.fsf@gmail.com> <87r5gy5svm.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1284373390 10934 80.91.229.12 (13 Sep 2010 10:23:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Sep 2010 10:23:10 +0000 (UTC) Cc: juri@jurta.org, Eli Zaretskii , emacs-devel@gnu.org, joakim@verona.se, deniz.a.m.dogan@gmail.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 13 12:23:08 2010 Return-path: Envelope-to: ged-emacs-devel@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 1Ov6Bk-0006qS-Ni for ged-emacs-devel@m.gmane.org; Mon, 13 Sep 2010 12:23:06 +0200 Original-Received: from localhost ([127.0.0.1]:36204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ov6Bj-00080z-2M for ged-emacs-devel@m.gmane.org; Mon, 13 Sep 2010 06:23:03 -0400 Original-Received: from [140.186.70.92] (port=45726 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ov6BY-00080E-8m for emacs-devel@gnu.org; Mon, 13 Sep 2010 06:22:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ov6BX-0003N9-0L for emacs-devel@gnu.org; Mon, 13 Sep 2010 06:22:52 -0400 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:53809) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov6BW-0003N3-UN; Mon, 13 Sep 2010 06:22:50 -0400 Original-Received: by qyk2 with SMTP id 2so5436785qyk.0 for ; Mon, 13 Sep 2010 03:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=81tJk8GC+y2WZQBnhZ9JQ4vSso9KOW7S+dnr4mxBCX4=; b=H45WlBItJsJ+Ib/fSF/iVH/DbA2eU0+3MiQmPkUay3D+0RnF0/5Ez0HsyY7Rd9VMws 5JYOmupMFPWu9Zb0tifhZsdSAo1P7HH8MQbYd/tind8gaT+Yh4OvCOweytCAabP0aAEj dBejSZmpMNpZ5RWe3qVhFKNnq7wGNZxS+SPfg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=TByJBTxLgocQKJI8tCBW8N7qSfasgFkeIQ3cWvO3MmQ8w/lQKf6DtiiFCEfNnz2Y8N EuUaA0F2w7dPsleXLWOK89ooqMDEDTbKhGWyiND4zLuMxgaHqJSO8RhDM3aDI+D78caR rb01L7M/80PkyNi0hS84olhjfExKgiW5jLsE0= Original-Received: by 10.224.79.131 with SMTP id p3mr2644264qak.354.1284373370195; Mon, 13 Sep 2010 03:22:50 -0700 (PDT) Original-Received: by 10.229.92.9 with HTTP; Mon, 13 Sep 2010 03:22:50 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130037 Archived-At: On Mon, Sep 13, 2010 at 11:11 AM, Stefan Monnier wrote: >> Done. I am investigating possibility of using swap-buffer with >> archive-mode. > > Great, but note that it's a separate issue to the one of using special-mode. I know.. and I thought I could look at it later. > >> BTW: Maybe we should think about merging (at least reusing bits & pieces >> and making user interface more consistent) tar-mode <-> archive-mode? > > Yes, bringing them closer would be good, indeed. > >> - changing `image-mode' to something else and wrapping the rest into >> `defun' (ad-hoc solution, which I like at least) > > This solution you like least is the right one: image-mode should really > be a command that sets the major-mode to image-mode, not a command that > tries it and does something else if it can't be done. I.e. we need > a separate command to do the "check if image-mode can be used, and call > image-mode if possible". > OK. >> Ideally in case of saving previous mode we should have a stack for this >> (even better, stack with functions that restore previous state, but this >> might be an overkill). > > The user might want to switch in a circular rather than stack fashion. > Since we don't know how best to solve this general case, we stick to the > only really use case we know, where the user switches between two modes > (the doc-view/image-mode and the "see raw data" mode (can be > fundamental-mode, ps-mode, c-mode, ...)). Yes, I will do just major-mode swap for time being. > >> (define-derived-mode my-major-mode special-mode >> :keymap 'my-major-mode-map >> ...) > > This would encourage the use of non-standard naming, so I'd rather not > go down that road. Actually that's what i though initially. > >> As you notice I also think that defining key-maps should be easier. >> Generally maybe we should do what's been done with `easy-menu' for maps. > > As you may have noticed in easy-mmode-define-keymap, I've toyed with > this idea in the past. Maybe a `defkeymap' macro would be good, indeed, > but it's not that important, I think. > >> +(define-derived-mode archive-mode special-mode "Archive mode" > [...] >> ;; Archive mode is suitable only for specially formatted data. >> (put 'archive-mode 'mode-class 'special) In the begining, I was not sure if i should leave those lines. > > The above line is made redundant by deriving from special-mode. > >> +(define-derived-mode bookmark-edit-annotation-mode nil "Edit Bookmark Annotation" > [...] >> (run-mode-hooks 'text-mode-hook)) > > This run-mode-hooks is a good hint that the mode should actually derive > from text-mode-hook. That was my consideration too. > >> (put 'occur-mode 'mode-class 'special) >> -(defun occur-mode () >> +(define-derived-mode occur-mode special-mode "Occur" > > Here also, the `put' is now redundant. Yes. > > > Stefan > Thank you, I will send the final version soon. Wojciech