From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Kuleshov Newsgroups: gmane.emacs.bugs Subject: bug#22453: [PATCH] Support for switching to hexl-mode from image mode Date: Sun, 24 Jan 2016 20:59:41 +0600 Message-ID: <20160124145941.GA1301@localhost> References: <1453617036-17528-1-git-send-email-kuleshovmail@gmail.com> <83fuxn3ufa.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1453647868 7230 80.91.229.3 (24 Jan 2016 15:04:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Jan 2016 15:04:28 +0000 (UTC) Cc: 22453@debbugs.gnu.org, Alexander Kuleshov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 24 16:04:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aNMDA-000490-Gf for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jan 2016 16:04:16 +0100 Original-Received: from localhost ([::1]:60760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNMD6-0003f4-Cm for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jan 2016 10:04:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNMD0-0003cA-Tx for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 10:04:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNMCw-0007L0-RE for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 10:04:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNMCw-0007Kw-Ne for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 10:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aNMCw-0006Zr-9m for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 10:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alexander Kuleshov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jan 2016 15:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22453-submit@debbugs.gnu.org id=B22453.145364780825242 (code B ref 22453); Sun, 24 Jan 2016 15:04:02 +0000 Original-Received: (at 22453) by debbugs.gnu.org; 24 Jan 2016 15:03:28 +0000 Original-Received: from localhost ([127.0.0.1]:35024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aNMCO-0006Z4-Iy for submit@debbugs.gnu.org; Sun, 24 Jan 2016 10:03:28 -0500 Original-Received: from mail-lb0-f169.google.com ([209.85.217.169]:34271) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aNMCN-0006Yo-Cr for 22453@debbugs.gnu.org; Sun, 24 Jan 2016 10:03:27 -0500 Original-Received: by mail-lb0-f169.google.com with SMTP id cl12so62362646lbc.1 for <22453@debbugs.gnu.org>; Sun, 24 Jan 2016 07:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=DniPpxGX48sWvoBYYFf/QBIncUR/nLhjs23N/R8NMOQ=; b=cuzUTUZNwwn1sxoXOdFlqm5c5YySRwDvX80nHBtMR+xfpTjGEnLYW1TH4Z0M8FJVBO DGZPBjbzpusI5N2m4+eFofAw5ACKY8DqdequofZVfs8YSnCp5mcdnqlgYM745RV/zkf+ jYpX6DV4TJaHGdINz07mTVc8CpBZcA7ofVUomzzf5n8eJB/x6lnrRw1u4cHjIEFV6JO4 ks0Yh0Ko7WukeAQcYBjN2ruL7QQJMkNI0a1XbtV2Mj5JUV28uyqRxQDIlTgc594hIy3R waW5p+XvKFau74bXzrRngjbbRrTJ2K+xOAYYSh1c2dBho7+MWj9iVwuQVEj7W5lu72DQ qtFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=DniPpxGX48sWvoBYYFf/QBIncUR/nLhjs23N/R8NMOQ=; b=TWk8kR/oEaeUf3lLvUm5FIrNR3eQGgteCN1tEUe/Q6Ngt1zFNdl47GLajyJwacmMIA Ma9Bue/xOz2HADb1P0pi6GVzRoKKiPFp0eKyLcdN2D3MsL6Kq79RGVPIJLxaZXeUDhAp nR6BLTCF43QprlxKcHtFVGsK6+yQM0KWa8wHxqLLcuelz9DMkz2OW+2hHD52Msip90Jo Q1nJVdKxqBM6BdbjvGGJQ6Acj0ROZRE6+CULdEKp/xSbqHRjKTrTyDqNCeRl1e2nH/i9 5dpmz8TSVT5Qr8KnRdjtYc2q7QzqIXz5uQlBzF1GXd1/EYYGvwWXW8VKwdd4nZQ3E4DO k38w== X-Gm-Message-State: AG10YORX1RJfoYvKwd18z2dk9QExiHTo7OMe/gtKrKYAOApzF7ibqCVKDVsubsri/9IAEQ== X-Received: by 10.112.150.169 with SMTP id uj9mr4516009lbb.17.1453647801326; Sun, 24 Jan 2016 07:03:21 -0800 (PST) Original-Received: from localhost ([37.151.211.186]) by smtp.gmail.com with ESMTPSA id th4sm2069004lbb.46.2016.01.24.07.03.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jan 2016 07:03:20 -0800 (PST) Content-Disposition: inline In-Reply-To: <83fuxn3ufa.fsf@gnu.org> X-Operating-System: Linux X-Date: Sun Jan 24 18:46:33 ALMT 2016 User-Agent: Mutt/1.6.0-rc0 ((null)) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111917 Archived-At: Hello, first of all thanks for your feedback. On 01-24-16, Eli Zaretskii wrote: > > From: Alexander Kuleshov > > Date: Sun, 24 Jan 2016 12:30:36 +0600 > > Cc: Alexander Kuleshov > > > > We can easily switch to text mode from the image mode by the > > pressing of C-c C-c. But sometimes, it is more useful to open > > an image in hex format. This patch provides new keybinding > > for the image mode - C-c C-x which works like C-c C-c, but > > executes switch to the hexl-mode. Like switching to text mode, > > switching to hex mode supports switching back to the image-mode. > > > > The patch contains following changes: > > ... > > ... > > ... > > > > Patch tested on top of emacs-25 branch on fedora 23 with all > > Linux related configured options. > > Thanks. This generally looks good. A few comments: > > . This should go to master, not emacs-25, as it's a new feature. Ah, ok, didn't know will move it into master in next revision. > . Please provide a ChangeLog-style commit log message for the > changes (some details are in CONTRIBUTE). Ok, will do, just one question. where do I need add it? As you may see I added some description to the commit message. Do I need to do something additional? But anyway, I will look into CONTRIBUTE. > . Please provide an update for the user manual, which describes > "C-c C-c", to describe "C-x C-x" as well. Will do. > Some specific comments below. > > > +(defun image-mode-as-hex () > > + "Set a non-image mode as major mode in combination with image minor mode. > > +A non-mage major mode found from `auto-mode-alist' or fundamental mode > > +displays an image file as hex. `image-minor-mode' provides the key > > +\\\\[image-toggle-hex-display] to switch back to `image-mode' > > +to display an image file as the actual image. > > + > > +You can use `image-mode-as-text' in `auto-mode-alist' when you wanto > ^^^^^ > A typo. > > > +to display an image file as text initially. > > Why does this sentence talk about text, when the mode is about hex > display? Copy/paste mistake? Yes, anyway it is very similar. Will fix it. > > +(defun image-toggle-hex-display () > > + "Toggle between image and text display. > > +If the current buffer is displaying an image file as an image, > > +call `image-mode-as-hex' to switch to text. Otherwise, display > > +the image by calling `image-mode'." > > It is best to avoid referring to another command in a doc string, if > you can avoid that. In this case, the reference doesn't add any > useful information, so I think it should be deleted. Are you about `image-mode-as-hex`? I've copied it from the image-toggle-display doc string. Do we need to delete it there too? > Last, but not least, I think this contribution is too large to accept > without legal paperwork. I don't see your copyright assignment on > file; would you like me to send you the form so you could start the > paperwork rolling? Yes, sure. Thank you.