unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* input methods per file
@ 2008-01-24 14:29 Phillip Lord
  2008-01-24 14:44 ` Peter Dyballa
       [not found] ` <mailman.6474.1201185888.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Phillip Lord @ 2008-01-24 14:29 UTC (permalink / raw)
  To: help-gnu-emacs




I've been tearing my hair out about this, but being new to
internationalisation, I can't find an answer. 

I'm trying to set an input method on a per file basis. Most of the time I
don't use an one, but a few files that I have are written in a different
language. 

I've tried putting this at the end of the file. 


;; Local Variables: ***
;; eval: (set-input-method "italian-postfix") ***
;; End: ***


Which works well, but is a pain because I get asked a yes no question as eval
is risky. As I use desktop to re-open my files this makes startup a problem. 

Obviously I could make eval non risky, but obviously I don't want to do that.
I thought about language environments as well, but then this seems to require
evaluating a function, rather than setting a variable. 

The best I can have come up with is to set a variable, and then put a hook
into the open file process which runs set-input-method.

I'm missing something surely. Am I the only one who wants to do this? Is there
a better way to achieve the same thing?

Phil

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: input methods per file
  2008-01-24 14:29 input methods per file Phillip Lord
@ 2008-01-24 14:44 ` Peter Dyballa
       [not found] ` <mailman.6474.1201185888.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2008-01-24 14:44 UTC (permalink / raw)
  To: Phillip Lord; +Cc: help-gnu-emacs


Am 24.01.2008 um 15:29 schrieb Phillip Lord:

> Is there a better way to achieve the same thing?


I was asked a few times until I pressed ``!´´ – and some  
customisation was saved. This does not help in your case?

--
Greetings

   Pete

Wasting time is an important part of living.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: input methods per file
       [not found] <mailman.6472.1201185130.18990.help-gnu-emacs@gnu.org>
@ 2008-01-24 15:04 ` Thien-Thi Nguyen
  2008-01-24 15:08 ` Johan Bockgård
  1 sibling, 0 replies; 6+ messages in thread
From: Thien-Thi Nguyen @ 2008-01-24 15:04 UTC (permalink / raw)
  To: gnu-emacs-help

() Phillip Lord <phillip.lord@newcastle.ac.uk>
() Thu, 24 Jan 2008 14:29:15 +0000

   ;; Local Variables: ***
   ;; eval: (set-input-method "italian-postfix") ***
   ;; End: ***

you can use `default-input-method' (a variable).

thi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: input methods per file
       [not found] <mailman.6472.1201185130.18990.help-gnu-emacs@gnu.org>
  2008-01-24 15:04 ` Thien-Thi Nguyen
@ 2008-01-24 15:08 ` Johan Bockgård
  2008-01-25 12:42   ` Phil Lord
  1 sibling, 1 reply; 6+ messages in thread
From: Johan Bockgård @ 2008-01-24 15:08 UTC (permalink / raw)
  To: help-gnu-emacs

Phillip Lord <phillip.lord@newcastle.ac.uk> writes:

> ;; Local Variables: ***
> ;; eval: (set-input-method "italian-postfix") ***
> ;; End: ***
>
> Which works well, but is a pain because I get asked a yes no question
> as eval is risky.

You can use

    ;; Allow italian-postfix input method
    (add-to-list 'safe-local-eval-forms
                 '(set-input-method "italian-postfix"))

or

    ;; Allow all uses of set-input-method
    (put 'set-input-method 'safe-local-eval-function t)

-- 
Johan Bockgård

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: input methods per file
       [not found] ` <mailman.6474.1201185888.18990.help-gnu-emacs@gnu.org>
@ 2008-01-25 12:39   ` Phil Lord
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Lord @ 2008-01-25 12:39 UTC (permalink / raw)
  To: help-gnu-emacs

On Jan 24, 2:44 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 24.01.2008 um 15:29 schrieb Phillip Lord:
>
> > Is there a better way to achieve the same thing?
>
> I was asked a few times until I pressed ``!´´ - and some
> customisation was saved. This does not help in your case?
>


This doesn't work with "eval"; it's a special, which evaluates the
function following it. As this
could be anything including wiping your hard drive, it's not really a
good idea to mark it as
safe.

Phil

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: input methods per file
  2008-01-24 15:08 ` Johan Bockgård
@ 2008-01-25 12:42   ` Phil Lord
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Lord @ 2008-01-25 12:42 UTC (permalink / raw)
  To: help-gnu-emacs

On Jan 24, 3:08 pm, bojohan+n...@dd.chalmers.se (Johan Bockgård)
wrote:
> Phillip Lord <phillip.l...@newcastle.ac.uk> writes:
> > ;; Local Variables: ***
> > ;; eval: (set-input-method "italian-postfix") ***
> > ;; End: ***
>
> > Which works well, but is a pain because I get asked a yes no question
> > as eval is risky.
>
> You can use
>
>     ;; Allow italian-postfix input method
>     (add-to-list 'safe-local-eval-forms
>                  '(set-input-method "italian-postfix"))
>
> or
>
>     ;; Allow all uses of set-input-method
>     (put 'set-input-method 'safe-local-eval-function t)


Perfect, just what I was looking for.
Many thanks!

Phil

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-25 12:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-24 14:29 input methods per file Phillip Lord
2008-01-24 14:44 ` Peter Dyballa
     [not found] ` <mailman.6474.1201185888.18990.help-gnu-emacs@gnu.org>
2008-01-25 12:39   ` Phil Lord
     [not found] <mailman.6472.1201185130.18990.help-gnu-emacs@gnu.org>
2008-01-24 15:04 ` Thien-Thi Nguyen
2008-01-24 15:08 ` Johan Bockgård
2008-01-25 12:42   ` Phil Lord

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).