all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Get char at point
@ 2010-07-17  4:32 TheFlyingDutchman
  2010-07-17  8:55 ` Harald Hanche-Olsen
  0 siblings, 1 reply; 6+ messages in thread
From: TheFlyingDutchman @ 2010-07-17  4:32 UTC (permalink / raw
  To: help-gnu-emacs

Is there a function to get the character at point?  I see get-byte,
which would work for an ASCII coded file, but I believe Emacs has some
support for multi-byte character sets.


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

* Re: Get char at point
  2010-07-17  4:32 Get char at point TheFlyingDutchman
@ 2010-07-17  8:55 ` Harald Hanche-Olsen
  2010-07-17  9:37   ` AmosBurke
  2010-07-17  9:45   ` TheFlyingDutchman
  0 siblings, 2 replies; 6+ messages in thread
From: Harald Hanche-Olsen @ 2010-07-17  8:55 UTC (permalink / raw
  To: help-gnu-emacs

+ TheFlyingDutchman <zzbbaadd@aol.com>:

> Is there a function to get the character at point?  I see get-byte,
> which would work for an ASCII coded file, but I believe Emacs has some
> support for multi-byte character sets.

If you type C-h f char TAB, you will see a bunch of functions whose
names begin with "char". Then you might wildly guess that the first hit,
char-after, is what you are looking for, and if you actually select
that, the wild guess is confirmed.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


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

* Re: Get char at point
  2010-07-17  8:55 ` Harald Hanche-Olsen
@ 2010-07-17  9:37   ` AmosBurke
  2010-07-17  9:45   ` TheFlyingDutchman
  1 sibling, 0 replies; 6+ messages in thread
From: AmosBurke @ 2010-07-17  9:37 UTC (permalink / raw
  To: help-gnu-emacs

On Jul 17, 1:55 am, Harald Hanche-Olsen <han...@math.ntnu.no> wrote:
> + TheFlyingDutchman <zzbba...@aol.com>:
>
> > Is there a function to get the character at point?  I see get-byte,
> > which would work for an ASCII coded file, but I believe Emacs has some
> > support for multi-byte character sets.
>
> If you type C-h f char TAB, you will see a bunch of functions whose
> names begin with "char". Then you might wildly guess that the first hit,
> char-after, is what you are looking for, and if you actually select
> that, the wild guess is confirmed.
>
> --
> * Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
> - It is undesirable to believe a proposition
>   when there is no ground whatsoever for supposing it is true.
>   -- Bertrand Russell

Thanks!  I believe I did look at the char* functions. If it had been
named char-at I would have gotten it. It should be noted that the help
for "char-after" says
--------------------------------------------------------------------------------
(char-after &optional POS)

Return character in current buffer at position POS.
POS is an integer or a marker and defaults to point.
If POS is out of range, the value is nil.
----------------------------------------------------------------------------
The concept of "point" being between characters, was unfortunately
followed in naming the function, and then luckily ignored in the help
for the function.


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

* Re: Get char at point
  2010-07-17  8:55 ` Harald Hanche-Olsen
  2010-07-17  9:37   ` AmosBurke
@ 2010-07-17  9:45   ` TheFlyingDutchman
  2010-07-17  9:57     ` Andreas Politz
  1 sibling, 1 reply; 6+ messages in thread
From: TheFlyingDutchman @ 2010-07-17  9:45 UTC (permalink / raw
  To: help-gnu-emacs

On Jul 17, 1:55 am, Harald Hanche-Olsen <han...@math.ntnu.no> wrote:
> + TheFlyingDutchman <zzbba...@aol.com>:
>
> > Is there a function to get the character at point?  I see get-byte,
> > which would work for an ASCII coded file, but I believe Emacs has some
> > support for multi-byte character sets.
>
> If you type C-h f char TAB, you will see a bunch of functions whose
> names begin with "char". Then you might wildly guess that the first hit,
> char-after, is what you are looking for, and if you actually select
> that, the wild guess is confirmed.
>
> --
> * Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
> - It is undesirable to believe a proposition
>   when there is no ground whatsoever for supposing it is true.
>   -- Bertrand Russell

Thanks!  I believe I did look at the char* functions. If it had been
named char-at I would have gotten it. It should be noted that the help
for "char-after" says
--------------------------------------------------------------------------------
(char-after &optional POS)

Return character in current buffer at position POS.
POS is an integer or a marker and defaults to point.
If POS is out of range, the value is nil.
----------------------------------------------------------------------------
The dubious concept of "point" being between characters, was
unfortunately
followed in naming the function, and then luckily ignored in the help
for the function.



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

* Re: Get char at point
  2010-07-17  9:45   ` TheFlyingDutchman
@ 2010-07-17  9:57     ` Andreas Politz
  2010-07-17 22:48       ` TheFlyingDutchman
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Politz @ 2010-07-17  9:57 UTC (permalink / raw
  To: help-gnu-emacs

TheFlyingDutchman <zzbbaadd@aol.com> writes:

> Thanks!  I believe I did look at the char* functions. If it had been
> named char-at I would have gotten it.

General functions are generally easier to find in the elisp manual.

---
File: elisp,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)

Emacs Lisp
**********
...
* Text:: Examining and changing text in buffers.
...
---

-> (info "(elisp) Text")

And the first function of the first entry is what you were looking for.

-ap


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

* Re: Get char at point
  2010-07-17  9:57     ` Andreas Politz
@ 2010-07-17 22:48       ` TheFlyingDutchman
  0 siblings, 0 replies; 6+ messages in thread
From: TheFlyingDutchman @ 2010-07-17 22:48 UTC (permalink / raw
  To: help-gnu-emacs

On Jul 17, 2:57 am, Andreas Politz <poli...@fh-trier.de> wrote:
> TheFlyingDutchman <zzbba...@aol.com> writes:
> > Thanks!  I believe I did look at the char* functions. If it had been
> > named char-at I would have gotten it.
>
> General functions are generally easier to find in the elisp manual.
>
> ---
> File: elisp,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
>
> Emacs Lisp
> **********
> ...
> * Text:: Examining and changing text in buffers.
> ...
> ---
>
> -> (info "(elisp) Text")
>
> And the first function of the first entry is what you were looking for.
>
> -ap

OK, thanks, I will check that in the future.


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

end of thread, other threads:[~2010-07-17 22:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-17  4:32 Get char at point TheFlyingDutchman
2010-07-17  8:55 ` Harald Hanche-Olsen
2010-07-17  9:37   ` AmosBurke
2010-07-17  9:45   ` TheFlyingDutchman
2010-07-17  9:57     ` Andreas Politz
2010-07-17 22:48       ` TheFlyingDutchman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.