From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Replacement for C-x 8 based on input methods Date: Tue, 14 May 2002 17:17:38 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1021389487 30903 127.0.0.1 (14 May 2002 15:18:07 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 14 May 2002 15:18:07 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 177e3y-00082K-00 for ; Tue, 14 May 2002 17:18:06 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 177eF4-0008LE-00 for ; Tue, 14 May 2002 17:29:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 177e48-0001rc-00; Tue, 14 May 2002 11:18:16 -0400 Original-Received: from waldorf.cs.uni-dortmund.de ([129.217.4.42]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 177e3d-0001nh-00 for ; Tue, 14 May 2002 11:17:45 -0400 Original-Received: from lothlorien.cs.uni-dortmund.de (lothlorien [129.217.19.67]) by waldorf.cs.uni-dortmund.de with ESMTP id g4EFHhb01436 for ; Tue, 14 May 2002 17:17:44 +0200 (MES) Original-Received: from lucy.cs.uni-dortmund.de (lucy [129.217.19.80]) by lothlorien.cs.uni-dortmund.de id RAA17904; Tue, 14 May 2002 17:17:38 +0200 (MET DST) Original-Received: by lucy.cs.uni-dortmund.de (Postfix, from userid 6104) id 75E233B41E; Tue, 14 May 2002 17:17:38 +0200 (CEST) Original-To: emacs-devel@gnu.org Original-Lines: 77 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.50 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:3925 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3925 Thanks to Miles Bader I've now got something which can show how the C-x 8 replacement could in principle work. Todo: * Make an input method (or several input methods) which are appropriate for this application. It might be useful to construct an input method by computing the union of several other input methods (such as latin-1-prefix and latin-1-postfix). * Put more features in it. Maybe a prefix arg could ask the user for an input method to use for just the next C-x 8 command? Do you think that this goes in the right direction? kai --=20 Silence is foo! ;;; c-x-9.el --- Like C-x 8 but with input method ;; Copyright (C) 2002 Free Software Foundation, Inc. ;; Author: Kai Gro=DFjohann ;; Keywords: i18n, languages ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; This file is a demonstration of what a replacement of C-x 8 could ;; look like. It would be more useful if there was an input method ;; especially designed for this. Thanks a lot to Miles Bader for the ;; meat of the function. ;;; Variables: (require 'cus-edit) (defcustom secondary-input-method "latin-1-postfix" "For `C-x 9'." :group 'mule :type '(choice (const nil) string)) ;;; Code: (defun insert-with-secondary-input-method () "Insert a character using the secondary input method." (interactive) (let ((old-method current-input-method)) (unwind-protect (progn (activate-input-method secondary-input-method) (insert (apply 'string (funcall input-method-function (read-char (format "Insert char using %s: " secondary-input-method)))))) (if old-method (activate-input-method old-method) (inactivate-input-method))))) (global-set-key (kbd "C-x 9") 'insert-with-secondary-input-method) (provide 'c-x-9) ;;; c-x-9.el ends here