help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using backward-char non-interactively


From: Andreas Röhler
Subject: Re: Using backward-char non-interactively
Date: Tue, 31 Dec 2013 19:10:36 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Am 31.12.2013 14:58, schrieb Marcin Borkowski:
Hi,

is it ok to use backward-char in elisp programs assuming that I did
check that I'm not at beginning of buffer?  Or is it better to use
(goto-char (1- point)) or something like that?  Or maybe it doesn't
matter?  ("Better" may be in terms of style, speed, or side effects,
like cluttering the *Messages* buffer.)

TIA,


Hi,

answer depends from the case.

In general it's okay.
If you must avoid any messages, would use (unless (bobp)

Here a from to try it:

(funcall (lambda ()(goto-char 1)(unless (bobp)(backward-char))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]