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: Sat, 11 Sep 2010 15:00:44 +0100 Message-ID: <8739tgxtv7.fsf@gmail.com> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1284213690 19491 80.91.229.12 (11 Sep 2010 14:01:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Sep 2010 14:01:30 +0000 (UTC) Cc: Wojciech Meyer , joakim@verona.se, emacs-devel@gnu.org, juri@jurta.org, Eli Zaretskii , deniz.a.m.dogan@gmail.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 11 16:01:26 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 1OuQdt-0007KQ-36 for ged-emacs-devel@m.gmane.org; Sat, 11 Sep 2010 16:01:21 +0200 Original-Received: from localhost ([127.0.0.1]:46900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuQds-0001VO-Jn for ged-emacs-devel@m.gmane.org; Sat, 11 Sep 2010 10:01:20 -0400 Original-Received: from [140.186.70.92] (port=36237 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuQdo-0001VI-74 for emacs-devel@gnu.org; Sat, 11 Sep 2010 10:01:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OuQdm-0004df-RV for emacs-devel@gnu.org; Sat, 11 Sep 2010 10:01:16 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:50281) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuQdm-0004dZ-Im; Sat, 11 Sep 2010 10:01:14 -0400 Original-Received: by wyb36 with SMTP id 36so4815723wyb.0 for ; Sat, 11 Sep 2010 07:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=nHaIIuAjyit6ra53XSV6NNHp6aybxZ5DqOgK3edCWRg=; b=vwzLC/EMKjoCv90P7jNu6W0/p1y/xVj0GJO0qsizSkkMqh3iE8tuq3Sj/C9DaXEsyI 54CgbjtMxEcadQRJXLV+V6R18SKN+WefiqII1X1xCarYnRtHNe9kOaGc9phJcAbLqSfc cZFF1z6AanWq5NPqgQry6OMLxjep7Tb/xHLNk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; b=AZ59l8gWmeOpAo7C/jUe0IbNQRV2gjvWMk7IrJrzZCnrjGg1aNdQeMUGfLnphWjpfs LXZQ+1bRNclSMZSVEZHehSVe2Q/hyUcUblKdK4fjy9f/vHRss4zYuoQWwZDkgFLUMBgt jE+/9mOiffbYf/meDSKkwjDW7PyMh8M5nhJEw= Original-Received: by 10.216.13.17 with SMTP id a17mr534869wea.46.1284213673475; Sat, 11 Sep 2010 07:01:13 -0700 (PDT) Original-Received: from spec-desktop.specuu.com (host86-147-138-117.range86-147.btcentralplus.com [86.147.138.117]) by mx.google.com with ESMTPS id w29sm2481885weq.18.2010.09.11.07.01.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 11 Sep 2010 07:01:12 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 11 Sep 2010 15:19:20 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 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:129981 Archived-At: Again, thanks a lot for spending time on it. In the meantime I will fix these problems, and send you back the new one. Thanks, Wojciech Stefan Monnier writes: >> Now there was some problem with buffer local variable >> `revert-buffer-function'. (in doc-view-mode) I corrected it I believe, >> and this is the final version of patch.=C2=A0 Could anybody review that = once >> more, please? > > Some nitpicks: > >> + ;; This is not interactive because you shouldn't be turning this >> + ;; mode on and off. You can corrupt things that way. >> + ;; >> + ;; Now it's derived mode, so therefore it is interactive. > > These two pieces are contradictory, please clarify. BTW, we should > change archive-mode to use buffer-swap-text like we did for tar-mode, > which should address this risk of corruption. > >> -(defun bookmark-bmenu-mode () >> +(define-derived-mode bookmark-bmenu-mode special-mode "Bookmark Menu" >> "Major mode for editing a list of bookmarks. >> Each line describes one of the bookmarks in Emacs. >> Letters do not insert themselves; instead, they are commands. >> @@ -1645,9 +1642,6 @@ >> (kill-all-local-variables) >> (use-local-map bookmark-bmenu-mode-map) > > Both kill-all-local-variables and use-local-map can be removed (actually > kill-all-local-variables *has* to be removed since it undoes the previous > call to special-mode). > >> (setq truncate-lines t) >> - (setq buffer-read-only t) >> - (setq major-mode 'bookmark-bmenu-mode) >> - (setq mode-name "Bookmark Menu") >> (run-mode-hooks 'bookmark-bmenu-mode-hook)) > > Why remove (setq buffer-read-only t) ? > And why not remove the run-mode-hooks? > >> =3D=3D=3D modified file 'lisp/doc-view.el' >> --- lisp/doc-view.el 2010-07-14 15:57:54 +0000 >> +++ lisp/doc-view.el 2010-08-29 15:08:39 +0000 >> @@ -333,7 +333,6 @@ >> (define-key map (kbd "C-c C-t") 'doc-view-open-text) >> ;; Reconvert the current document. Don't just use revert-buffer >> ;; because that resets the scale factor, the page number, ... >> - (define-key map (kbd "g") 'doc-view-revert-buffer) > > If you remove this line, you need to remove the above comment as well > (after making sure that the problem it mentions don't apply any more). > >> + (set (make-local-variable 'revert-buffer-function) 'doc-view-revert= -buffer) >> (run-mode-hooks 'doc-view-mode-hook))) > > Here as well you should remove the run-mode-hooks. > >> ;;;###autoload >> -(defun image-mode () >> +(define-derived-mode image-mode special-mode "Image" >> "Major mode for image files. >> You can use \\\\[image-toggle-display] >> to toggle between display as an image and display as text." >> - (interactive) >> (condition-case err >> (progn >> (unless (display-images-p) >> (error "Display does not support images")) >=20=20 >> (kill-all-local-variables) >> - (setq major-mode 'image-mode) > > IIRC define-derived-mode sets major-mode before running the body of the > macro, so when you call `error' above, `major-mode' and `mode-name' have > already been set and need to be reverted. > >> -(defun occur-mode () >> +(define-derived-mode occur-mode special-mode "Occur" >> "Major mode for output from \\[occur]. >> \\Move point to one of the items in this buffer, then u= se >> \\[occur-mode-goto-occurrence] to go to the occurrence that the item re= fers to. >> Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. >=20=20 >> \\{occur-mode-map}" >> - (interactive) >> (kill-all-local-variables) >> (use-local-map occur-mode-map) > > These last two should disappear as mentioned earlier. > > > Stefan