From unknown Sun Aug 17 10:22:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8453: enhancement to image mode Resent-From: Christian Wittern Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Apr 2011 01:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 8453@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13023126057530 (code B ref -1); Sat, 09 Apr 2011 01:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Apr 2011 01:30:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8N00-0001xP-Le for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:30:04 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8Mzy-0001we-IB for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:30:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8Mzs-00045N-FQ for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:29:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:49444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8Mzs-00045I-Co for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:29:56 -0400 Received: from [140.186.70.92] (port=49430 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8Mzr-0003Rd-5y for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2011 21:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8Mzq-00044F-8y for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2011 21:29:55 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:33020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8Mzq-00042c-3h for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2011 21:29:54 -0400 Received: by iwg8 with SMTP id 8so5270097iwg.0 for ; Fri, 08 Apr 2011 18:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=VW5DguOo8Z5NKx+6AOxX7PCc5CmZXLA5HLntFzdr7zE=; b=oxEg/iGG2nPO9/RTRUTrtFwwC6sSEGiQ2FT5fHPZKlnORsR/rfEGM72FTFLWl70uiS w8eIY4shLLJ4EMSS2Wir+5cKv/lMoelUqFt/FgN1PW5Ou4eeFdgddFdr/M1ETs3nkZfv nApfEcX+F+d1rdmss6UwLWhn4g+BoWbmmsysc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=oEbfBR2lEXV5TVD2SLZmcq96konRTd5qw30XaJbbxUdlz8bgoqgSSj1sno8lA4wks/ chAxuUVdXGEMsTnoorye6oSS4T4PmZgkM/glv7hbRTvCuwNzG0qswwIlICXAL1UMHoK6 kV7SbaLp3LnV+Lg7LYZ5NPsFfOts/iYLRbxNU= Received: by 10.42.134.131 with SMTP id l3mr3915266ict.412.1302312592507; Fri, 08 Apr 2011 18:29:52 -0700 (PDT) Received: from mbp.local (182-167-84-124f1.kyt1.eonet.ne.jp [182.167.84.124]) by mx.google.com with ESMTPS id o3sm2237772ibd.61.2011.04.08.18.29.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Apr 2011 18:29:51 -0700 (PDT) Message-ID: <4D9FB68C.50206@gmail.com> Date: Sat, 09 Apr 2011 10:29:48 +0900 From: Christian Wittern User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hello, I am trying to send this through the send bug report function, I hope it works. With the help of Drew Adams on gnu.emacs.help, I added the following to image-mode, which allows one to visit the following or previous image, which is useful if images are in a series, such as in pages of books. If this is deemed useful, I would like to have this added to emacs. (require 'image-mode) (define-key image-mode-map "n" 'next-image) (define-key image-mode-map "p" 'previous-image) (defun next-image (arg) "when visitng an image, go to the next image in the same directory of the same type. No argument or nil will move to the following image in ascending order, t will move to the previous one. Thanks to Drew Adams for help with this on gnu.emacs.help" (interactive "P") (unless (and (buffer-file-name) (eq major-mode 'image-mode)) (error "Not visiting a file in image mode")) (let* ((files (directory-files (file-name-directory (buffer-file-name)) nil (file-name-extension (buffer-file-name)) )) (len (length files)) (this (file-name-nondirectory (buffer-file-name))) (idx 0)) (catch 'next-image (dolist (file files) (when (string= this file) (throw 'next-image (1+ idx))) (setq idx (1+ idx)))) (setq idx (+ idx (if arg -1 1))) (when (< idx 0) (setq idx (1- len))) (when (>= idx len) (setq idx 0)) (find-file (elt files idx)))) (defun previous-image (arg) "when visitng an image, go to the next image in the same directory of the same type. No argument or nil will move to the following image in ascending order, t will move to the previous one. Thanks to Drew Adams for help with this on gnu.emacs.help" (interactive "P") (next-image t)) -- Christian Wittern From unknown Sun Aug 17 10:22:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8453: enhancement to image mode Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Apr 2011 03:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Christian Wittern Cc: 8453@debbugs.gnu.org Received: via spool by 8453-submit@debbugs.gnu.org id=B8453.130240608823179 (code B ref 8453); Sun, 10 Apr 2011 03:29:02 +0000 Received: (at 8453) by debbugs.gnu.org; 10 Apr 2011 03:28:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8lJn-00061n-MR for submit@debbugs.gnu.org; Sat, 09 Apr 2011 23:28:07 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8lJl-00061K-Iu for 8453@debbugs.gnu.org; Sat, 09 Apr 2011 23:28:06 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:51434 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Q8lJf-0002j4-F7; Sat, 09 Apr 2011 23:28:00 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 5D2EB66124; Sat, 9 Apr 2011 23:27:56 -0400 (EDT) From: Stefan Monnier Message-ID: References: <4D9FB68C.50206@gmail.com> Date: Sun, 10 Apr 2011 00:27:56 -0300 In-Reply-To: <4D9FB68C.50206@gmail.com> (Christian Wittern's message of "Sat, 09 Apr 2011 10:29:48 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) > With the help of Drew Adams on gnu.emacs.help, I added the following to > image-mode, which allows one to visit the following or previous image, which > is useful if images are in a series, such as in pages of books. If this is > deemed useful, I would like to have this added to emacs. This looks very handy, indeed. I'd recommend to slightly change the code so it just looks for the first filename greater than the current name (so it also works in the odd case where the current file is not in the directory any more). I'm currently traveling, so if someone else can take care of cleaning-up and installing this code, I'd appreciate it. Stefan PS: this again calls for closer integration between doc-mode and image-mode. From unknown Sun Aug 17 10:22:00 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Christian Wittern Subject: bug#8453: closed (Re: bug#8453: enhancement to image mode) Message-ID: References: <87ip6t42oo.fsf@gnu.org> <4D9FB68C.50206@gmail.com> X-Gnu-PR-Message: they-closed 8453 X-Gnu-PR-Package: emacs Reply-To: 8453@debbugs.gnu.org Date: Sat, 19 Jan 2013 15:25:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1358609101-778-1" This is a multi-part message in MIME format... ------------=_1358609101-778-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8453: enhancement to image mode which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8453@debbugs.gnu.org. --=20 8453: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8453 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1358609101-778-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8453-done) by debbugs.gnu.org; 19 Jan 2013 15:24:27 +0000 Received: from localhost ([127.0.0.1]:40441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TwaHT-0000Bf-1k for submit@debbugs.gnu.org; Sat, 19 Jan 2013 10:24:27 -0500 Received: from mail-da0-f43.google.com ([209.85.210.43]:42189) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TwaHL-0000BE-8L for 8453-done@debbugs.gnu.org; Sat, 19 Jan 2013 10:24:26 -0500 Received: by mail-da0-f43.google.com with SMTP id u36so2068360dak.30 for <8453-done@debbugs.gnu.org>; Sat, 19 Jan 2013 07:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=CCHmrGw/7ep8d+3RC2/YCXOo3hsduDy48vJEpzPKjw8=; b=H49buXKtAu3kSFpuEaimiD1gS/my3gtjRqSoagdqAW45wn1T+cBS/5oBxbUXQ2XCBb W4/Ah57WihB/GZiWHpaCWr55v7S1PRdo+C14QsORqXI2xeWEiPRXIaA5SC0w4XvBslnB t6BdLKHxEaRySIsCpZdGh76psuER3sJ2iKwn+cKVbqWhtwHQ817txHzGSC1O85+DYhyq un1VF2qhOaPk3ANd4Amk9hJT2Z1nHIpuRBeR8ScSqvt2wwkqZcK7m/kml3L4E5wHTZS9 8boXQFTZ3hPcQCkne1CBUxfU3OZrb69iC7Pq7f7xFuzpo2GSsJ9Bx/TThJjCJ5tUd71u 9nmQ== X-Received: by 10.66.74.2 with SMTP id p2mr33450529pav.55.1358609005464; Sat, 19 Jan 2013 07:23:25 -0800 (PST) Received: from tsparkle (cm107.delta179.maxonline.com.sg. [59.189.179.107]) by mx.google.com with ESMTPS id d8sm5586904pax.23.2013.01.19.07.23.21 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 19 Jan 2013 07:23:23 -0800 (PST) From: Chong Yidong To: Stefan Monnier Subject: Re: bug#8453: enhancement to image mode References: <4D9FB68C.50206@gmail.com> Date: Sat, 19 Jan 2013 23:23:19 +0800 In-Reply-To: (Stefan Monnier's message of "Sun, 10 Apr 2011 00:27:56 -0300") Message-ID: <87ip6t42oo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8453-done Cc: Christian Wittern , 8453-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Stefan Monnier writes: >> With the help of Drew Adams on gnu.emacs.help, I added the following >> to image-mode, which allows one to visit the following or previous >> image, which is useful if images are in a series, such as in pages of >> books. If this is deemed useful, I would like to have this added to >> emacs. > > This looks very handy, indeed. I'd recommend to slightly change the > code so it just looks for the first filename greater than the current > name (so it also works in the odd case where the current file is not > in the directory any more). Done, with some substantial modifications. ------------=_1358609101-778-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Apr 2011 01:30:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8N00-0001xP-Le for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:30:04 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8Mzy-0001we-IB for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:30:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8Mzs-00045N-FQ for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:29:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:49444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8Mzs-00045I-Co for submit@debbugs.gnu.org; Fri, 08 Apr 2011 21:29:56 -0400 Received: from [140.186.70.92] (port=49430 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8Mzr-0003Rd-5y for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2011 21:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8Mzq-00044F-8y for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2011 21:29:55 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:33020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8Mzq-00042c-3h for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2011 21:29:54 -0400 Received: by iwg8 with SMTP id 8so5270097iwg.0 for ; Fri, 08 Apr 2011 18:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=VW5DguOo8Z5NKx+6AOxX7PCc5CmZXLA5HLntFzdr7zE=; b=oxEg/iGG2nPO9/RTRUTrtFwwC6sSEGiQ2FT5fHPZKlnORsR/rfEGM72FTFLWl70uiS w8eIY4shLLJ4EMSS2Wir+5cKv/lMoelUqFt/FgN1PW5Ou4eeFdgddFdr/M1ETs3nkZfv nApfEcX+F+d1rdmss6UwLWhn4g+BoWbmmsysc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=oEbfBR2lEXV5TVD2SLZmcq96konRTd5qw30XaJbbxUdlz8bgoqgSSj1sno8lA4wks/ chAxuUVdXGEMsTnoorye6oSS4T4PmZgkM/glv7hbRTvCuwNzG0qswwIlICXAL1UMHoK6 kV7SbaLp3LnV+Lg7LYZ5NPsFfOts/iYLRbxNU= Received: by 10.42.134.131 with SMTP id l3mr3915266ict.412.1302312592507; Fri, 08 Apr 2011 18:29:52 -0700 (PDT) Received: from mbp.local (182-167-84-124f1.kyt1.eonet.ne.jp [182.167.84.124]) by mx.google.com with ESMTPS id o3sm2237772ibd.61.2011.04.08.18.29.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Apr 2011 18:29:51 -0700 (PDT) Message-ID: <4D9FB68C.50206@gmail.com> Date: Sat, 09 Apr 2011 10:29:48 +0900 From: Christian Wittern User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: enhancement to image mode Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hello, I am trying to send this through the send bug report function, I hope it works. With the help of Drew Adams on gnu.emacs.help, I added the following to image-mode, which allows one to visit the following or previous image, which is useful if images are in a series, such as in pages of books. If this is deemed useful, I would like to have this added to emacs. (require 'image-mode) (define-key image-mode-map "n" 'next-image) (define-key image-mode-map "p" 'previous-image) (defun next-image (arg) "when visitng an image, go to the next image in the same directory of the same type. No argument or nil will move to the following image in ascending order, t will move to the previous one. Thanks to Drew Adams for help with this on gnu.emacs.help" (interactive "P") (unless (and (buffer-file-name) (eq major-mode 'image-mode)) (error "Not visiting a file in image mode")) (let* ((files (directory-files (file-name-directory (buffer-file-name)) nil (file-name-extension (buffer-file-name)) )) (len (length files)) (this (file-name-nondirectory (buffer-file-name))) (idx 0)) (catch 'next-image (dolist (file files) (when (string= this file) (throw 'next-image (1+ idx))) (setq idx (1+ idx)))) (setq idx (+ idx (if arg -1 1))) (when (< idx 0) (setq idx (1- len))) (when (>= idx len) (setq idx 0)) (find-file (elt files idx)))) (defun previous-image (arg) "when visitng an image, go to the next image in the same directory of the same type. No argument or nil will move to the following image in ascending order, t will move to the previous one. Thanks to Drew Adams for help with this on gnu.emacs.help" (interactive "P") (next-image t)) -- Christian Wittern ------------=_1358609101-778-1--