From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Refreshing Info nodes Date: Sat, 11 Sep 2010 15:19:20 +0200 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1284211177 10644 80.91.229.12 (11 Sep 2010 13:19:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Sep 2010 13:19:37 +0000 (UTC) Cc: juri@jurta.org, Eli Zaretskii , emacs-devel@gnu.org, joakim@verona.se, deniz.a.m.dogan@gmail.com To: Wojciech Meyer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 11 15:19:34 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 1OuPzQ-0006Ii-Nh for ged-emacs-devel@m.gmane.org; Sat, 11 Sep 2010 15:19:33 +0200 Original-Received: from localhost ([127.0.0.1]:58910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuPzQ-0004vF-3N for ged-emacs-devel@m.gmane.org; Sat, 11 Sep 2010 09:19:32 -0400 Original-Received: from [140.186.70.92] (port=34320 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuPzI-0004v0-TT for emacs-devel@gnu.org; Sat, 11 Sep 2010 09:19:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OuPzH-00079L-KK for emacs-devel@gnu.org; Sat, 11 Sep 2010 09:19:24 -0400 Original-Received: from impaqm3.telefonica.net ([213.4.138.3]:58390) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuPzH-000798-7v for emacs-devel@gnu.org; Sat, 11 Sep 2010 09:19:23 -0400 Original-Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm3.telefonica.net with bizsmtp id 5Qip1f03J0r0BT63PRKMUu; Sat, 11 Sep 2010 15:19:21 +0200 Original-Received: from ceviche.home ([83.61.39.212]) by IMPmailhost2.adm.correo with BIZ IMP id 5RKL1f0084aeRwb1iRKMM5; Sat, 11 Sep 2010 15:19:21 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Original-Received: by ceviche.home (Postfix, from userid 20848) id 81CBC660D2; Sat, 11 Sep 2010 15:19:20 +0200 (CEST) In-Reply-To: (Wojciech Meyer's message of "Sun, 29 Aug 2010 16:18:48 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:129979 Archived-At: > 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.=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 > (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 use > \\[occur-mode-goto-occurrence] to go to the occurrence that the item ref= ers to. > Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. =20 > \\{occur-mode-map}" > - (interactive) > (kill-all-local-variables) > (use-local-map occur-mode-map) These last two should disappear as mentioned earlier. Stefan