From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: Bug solved Date: Thu, 30 Nov 2006 20:47:52 +0900 (JST) Message-ID: <20061130.204752.146241318.jet@gyve.org> References: <3586896.1164809578196.JavaMail.www@wwinf4201> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1164887350 27896 80.91.229.2 (30 Nov 2006 11:49:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Nov 2006 11:49:10 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 30 12:49:05 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GpkPZ-00023M-B7 for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2006 12:49:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpkPY-0006sP-Ir for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2006 06:49:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GpkOr-0006Ur-D8 for emacs-devel@gnu.org; Thu, 30 Nov 2006 06:48:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GpkOo-0006Sw-Dw for emacs-devel@gnu.org; Thu, 30 Nov 2006 06:48:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpkOn-0006Sd-P4 for emacs-devel@gnu.org; Thu, 30 Nov 2006 06:48:17 -0500 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GpkOn-0002GD-Ms for emacs-devel@gnu.org; Thu, 30 Nov 2006 06:48:17 -0500 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kAUBmGaM003085; Thu, 30 Nov 2006 06:48:16 -0500 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kAUBmEkm030491; Thu, 30 Nov 2006 06:48:15 -0500 Original-Received: from localhost (dhcp92.tokyo.redhat.com [172.16.33.92]) by pobox.tokyo.redhat.com (8.12.8/8.12.8) with ESMTP id kAUBmCIU008353; Thu, 30 Nov 2006 20:48:13 +0900 Original-To: alinsoar@voila.fr In-Reply-To: <3586896.1164809578196.JavaMail.www@wwinf4201> X-Mailer: Mew version 4.2.53 on Emacs 22.0.51 / Mule 5.0 (SAKAKI) 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:63127 Archived-At: > BUG: > > > 1) open an arbitrary file > > C-x C-f /root/.emacs for example > > 2) suppose highlight current line minor mode is on. Sinon: > > (global-hl-line-mode 1) > > 3) (hexl-mode) > > 4) (hexl-mode-exit) > > > > BUG: (hexl-mode-exit) forgot to change again the highlight, and we see the normal text with the highl. from hex mode. > > > > version: GNU Emacs 22.0.91.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2006-11-24 on alin.ro > > system: FC6: Linux alin.ro 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:37:32 EDT 2006 i686 athlon i386 GNU/Linux > > > > I attached here > - the output from cvs -d:pserver:anonymous@cvs.gnu.org:/sources/emacs diff -c emacs/lisp/hexl.el > - a lisp/changelog entry > - a little text file with comments > > Please inform me if you accepted the solution. Thank you for reporting bug and fixing it. I reviewed your patch and modified it. Generally your patch is good. However, the case that hl-line-range-function and/or hl-line-face is/are not bound to value(s) is not handled. So I modified your patch to handle the case. I also did the same on ruler related code. Could you test my patch? I think it is almost ready to install the patch to the cvs repository. However, I think about copyrigh assignment. Other developers, sign for copyrigh assignment from Alin Soare is needed in this case? Without white lines, Alin's original patch contains 6 lines. Masatake YAMATO Index: hexl.el =================================================================== RCS file: /sources/emacs/emacs/lisp/hexl.el,v retrieving revision 1.107 diff -u -r1.107 hexl.el --- hexl.el 23 Nov 2006 18:34:44 -0000 1.107 +++ hexl.el 30 Nov 2006 11:34:14 -0000 @@ -100,15 +100,22 @@ (defvar hexl-mode-map nil) +;; Variable declarations for suppressing warnings from the byte-compiler. (defvar ruler-mode) (defvar ruler-mode-ruler-function) (defvar hl-line-mode) +(defvar hl-line-range-function) +(defvar hl-line-face) +;; Variables where the original values are stored to. (defvar hexl-mode-old-hl-line-mode) +(defvar hexl-mode-old-hl-line-range-function) +(defvar hexl-mode-old-hl-line-face) (defvar hexl-mode-old-local-map) (defvar hexl-mode-old-mode-name) (defvar hexl-mode-old-major-mode) (defvar hexl-mode-old-ruler-mode) +(defvar hexl-mode-old-ruler-function) (defvar hexl-mode-old-isearch-search-fun-function) (defvar hexl-mode-old-require-final-newline) (defvar hexl-mode-old-syntax-table) @@ -386,8 +393,16 @@ (if (and (boundp 'ruler-mode) ruler-mode (not hexl-mode-old-ruler-mode)) (ruler-mode 0)) + (when (boundp 'hexl-mode-old-ruler-function) + (setq ruler-mode-ruler-function hexl-mode-old-ruler-function)) + (if (and (boundp 'hl-line-mode) hl-line-mode (not hexl-mode-old-hl-line-mode)) (hl-line-mode 0)) + (when (boundp 'hexl-mode-old-hl-line-range-function) + (setq hl-line-range-function hexl-mode-old-hl-line-range-function)) + (when (boundp hexl-mode-old-hl-line-face) + (setq hl-line-face hexl-mode-old-hl-line-face)) + (setq require-final-newline hexl-mode-old-require-final-newline) (setq mode-name hexl-mode-old-mode-name) (setq isearch-search-fun-function hexl-mode-old-isearch-search-fun-function) @@ -929,19 +944,26 @@ (defun hexl-activate-ruler () "Activate `ruler-mode'." (require 'ruler-mode) + (unless (boundp 'hexl-mode-old-ruler-function) + (set (make-local-variable 'hexl-mode-old-ruler-function) + ruler-mode-ruler-function)) (set (make-local-variable 'ruler-mode-ruler-function) 'hexl-mode-ruler) (ruler-mode 1)) (defun hexl-follow-line () "Activate `hl-line-mode'." - (require 'frame) (require 'hl-line) - (with-no-warnings - (set (make-local-variable 'hl-line-range-function) - 'hexl-highlight-line-range) - (set (make-local-variable 'hl-line-face) - 'highlight)) + (unless (boundp 'hexl-mode-old-hl-line-range-function) + (set (make-local-variable 'hexl-mode-old-hl-line-range-function) + hl-line-range-function)) + (unless (boundp 'hexl-mode-old-hl-line-face) + (set (make-local-variable 'hexl-mode-old-hl-line-face) + hl-line-face)) + (set (make-local-variable 'hl-line-range-function) + 'hexl-highlight-line-range) + (set (make-local-variable 'hl-line-face) + 'highlight) (hl-line-mode 1)) (defun hexl-highlight-line-range ()