[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch for po-edit-string in po-mode
From: |
Bruno Haible |
Subject: |
Re: patch for po-edit-string in po-mode |
Date: |
Sat, 8 May 2010 17:59:54 +0200 |
User-agent: |
KMail/1.9.9 |
Hi,
Kenichi Handa wrote in
<http://lists.gnu.org/archive/html/bug-gnu-utils/2009-12/msg00004.html>:
> attached is a patch to fix a small problem of
> po-edit-string. Currently it creates an edit-buffer without
> explicitly setting a major mode. So, functions in
> after-change-major-mode-hook doesn't run in that buffer.
Thanks for the report.
> This is a reply from a maintainer of Emacs
> ------------------------------------------------------------
> > It seems that the global minor mode defined by
> > define-global-minor-mode doesn't work in a newly created
> > buffer of fundamental mode.
>
> > Isn't this a bug?
>
> I think it's not, tho it's obviously a misfeature. I think the best
> answer is to say that a buffer that is intended to be displayed to the
> user should call a major-mode function. If there's no specific
> major-mode for it, it should call fundamental-mode.
> ------------------------------------------------------------
It appears that text-mode allows spell-checking (through Esc-Tab),
whereas fundamental-mode does not. Therefore I find text-mode more
appropriate as major mode for PO subedit buffers.
> The better will be to make a real major-mode (say,
> po-subedit-mode) that inherits most features from text-mode.
Unfortunately, I don't know how to do this (as I'm familiar with
Emacs Lisp programming in general). I'm therefore applying the
patch below.
Bruno
2010-05-08 Bruno Haible <address@hidden>
* po-mode.el (po-edit-string): Assign major mode text-mode to the
subedit buffer.
Reported by Kenichi Handa <address@hidden>.
--- gettext-tools/misc/po-mode.el.orig Sat May 8 17:59:04 2010
+++ gettext-tools/misc/po-mode.el Sat May 8 17:53:46 2010
@@ -1,6 +1,6 @@
;;; po-mode.el -- major mode for GNU gettext PO files
-;; Copyright (C) 1995-1999, 2000-2002, 2005-2008 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1999, 2000-2002, 2005-2008, 2010 Free Software
Foundation, Inc.
;; Authors: François Pinard <address@hidden>
;; Greg McGary <address@hidden>
@@ -2304,6 +2304,7 @@
(setq slot (list marker edit-buffer overlay)
po-edited-fields (cons slot po-edited-fields))
(pop-to-buffer edit-buffer)
+ (text-mode)
(set (make-local-variable 'po-subedit-back-pointer) slot)
(set (make-local-variable 'indent-line-function)
'indent-relative)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: patch for po-edit-string in po-mode,
Bruno Haible <=