unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] image-mode.el (image-kill-buffer): New command.
Date: Wed, 4 Feb 2015 23:04:15 +0000	[thread overview]
Message-ID: <CAAdUY-++ZvVsxGHEr_Yr5fYJ_YJPbSWmbcLTiTTqdT6VaajPGQ@mail.gmail.com> (raw)
In-Reply-To: <CAAdUY-JUYrXLZzH7X-oySpMhsqgV_9xhq86Uvsi8AyXO1a6A5A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

Forgot to attach the patch. Sorry.

2015-02-04 20:11 GMT-02:00 Artur Malabarba <bruce.connor.am@gmail.com>:
> Given how similar docview and image-mode are, I'm always taken
> off-guard when I run into a small difference. This patch fixes one.
>
> k kills the buffer in docview, and I see no reason why it wouldn't do
> the same in image-mode. If nobody opposes this patch I'll merge it
> myself.
>
> Cheers to all,

[-- Attachment #2: 0001-image-mode.el-image-kill-buffer-New-command.patch --]
[-- Type: text/x-patch, Size: 1711 bytes --]

From fa7711bf92aaf86087af5fdfbb5e25ad1540fabb Mon Sep 17 00:00:00 2001
From: Artur Malabarba <bruce.connor.am@gmail.com>
Date: Wed, 4 Feb 2015 18:02:14 -0200
Subject: [PATCH] * image-mode.el (image-kill-buffer): New command.

---
 lisp/ChangeLog     | 3 +++
 lisp/image-mode.el | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9e473e2..15d79b4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -14,6 +14,9 @@
 
 2015-02-04  Artur Malabarba  <bruce.connor.am@gmail.com>
 
+	* image-mode.el (image-kill-buffer): New command.
+	(image-mode-map): Bind it to k.
+
 	* emacs-lisp/package.el (package-delete): Remove package from
 	`package-selected-packages' even if it can't be deleted.
 	(package-installed-p): Accept package-desc objects.
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 9e527f1..8ea1a2b 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -380,6 +380,7 @@ call."
     (define-key map "a-" 'image-decrease-speed)
     (define-key map "a0" 'image-reset-speed)
     (define-key map "ar" 'image-reverse-speed)
+    (define-key map "k" 'image-kill-buffer)
     (define-key map [remap forward-char] 'image-forward-hscroll)
     (define-key map [remap backward-char] 'image-backward-hscroll)
     (define-key map [remap right-char] 'image-forward-hscroll)
@@ -722,6 +723,12 @@ the image by calling `image-mode'."
       (image-mode-as-text)
     (image-mode)))
 
+(defun image-kill-buffer ()
+  "Kill the current buffer."
+  (interactive)
+  (when (eq major-mode 'image-mode)
+    (kill-buffer (current-buffer))))
+
 (defun image-after-revert-hook ()
   (when (image-get-display-property)
     (image-toggle-display-text)
-- 
2.2.2


  reply	other threads:[~2015-02-04 23:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 22:11 [PATCH] image-mode.el (image-kill-buffer): New command Artur Malabarba
2015-02-04 23:04 ` Artur Malabarba [this message]
2015-02-05  2:15   ` Stefan Monnier
2015-02-05  8:17     ` Artur Malabarba
2015-02-05 14:03       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAdUY-++ZvVsxGHEr_Yr5fYJ_YJPbSWmbcLTiTTqdT6VaajPGQ@mail.gmail.com \
    --to=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).