all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* what is the point of point-min?
       [not found] <E19s71c-0005cn-KT@monty-python.gnu.org>
@ 2003-08-27 23:40 ` Joe Corneli
       [not found] ` <mailman.1156.1062027752.29551.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 24+ messages in thread
From: Joe Corneli @ 2003-08-27 23:40 UTC (permalink / raw)


Here is a handy rebinding of <delete> that I found on the web.

(global-set-key [delete] 
	 (lambda () (interactive) 
		   (if mark-active
		             (kill-region (point) (mark)) 
		     (delete-char 1)))) 


and here is an alternative suggestion with one small change that I do
not fully understand.  Why would this be better?

(global-set-key [delete] 
	 (lambda () (interactive)
		   (if mark-active
		             (kill-region (point) (mark)) 
		     (delete-char (point-min)))))

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

* Re: what is the point of point-min?
       [not found] ` <mailman.1156.1062027752.29551.help-gnu-emacs@gnu.org>
@ 2003-08-28  0:23   ` Jesper Harder
  2003-08-28 16:17   ` Kevin Rodgers
  1 sibling, 0 replies; 24+ messages in thread
From: Jesper Harder @ 2003-08-28  0:23 UTC (permalink / raw)


Joe Corneli <jcorneli@math.utexas.edu> writes:

> and here is an alternative suggestion with one small change that I do
> not fully understand.  Why would this be better?
>
> (global-set-key [delete] 
> 	 (lambda () (interactive)
> 		   (if mark-active
> 		             (kill-region (point) (mark)) 
> 		     (delete-char (point-min)))))

No, using `point-min' is wrong.

`point-min' usually return 1, so you won't notice any difference.  But
if the buffer is narrowed, point-min returns a different number ...
making the effect of pressing delete quite unpredictable.

There's also the built-in `delete-selection-mode' which does something
similar.

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

* Re: what is the point of point-min?
       [not found] ` <mailman.1156.1062027752.29551.help-gnu-emacs@gnu.org>
  2003-08-28  0:23   ` Jesper Harder
@ 2003-08-28 16:17   ` Kevin Rodgers
  2003-08-28 17:05     ` Jesper Harder
  1 sibling, 1 reply; 24+ messages in thread
From: Kevin Rodgers @ 2003-08-28 16:17 UTC (permalink / raw)


Joe Corneli wrote:

> Here is a handy rebinding of <delete> that I found on the web.
> 
> (global-set-key [delete] 
> 	 (lambda () (interactive) 
> 		   (if mark-active
> 		             (kill-region (point) (mark)) 
> 		     (delete-char 1)))) 

Besides the point-min confusion, kill-region should be called with
(region-beginning) and (region-end) which usually -- but not always --
correspond to (point) and (mark).

-- 
Kevin Rodgers

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

* Re: what is the point of point-min?
  2003-08-28 16:17   ` Kevin Rodgers
@ 2003-08-28 17:05     ` Jesper Harder
  2003-08-28 17:59       ` Barry Margolin
                         ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Jesper Harder @ 2003-08-28 17:05 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Besides the point-min confusion, kill-region should be called with
> (region-beginning) and (region-end) which usually -- but not always
> -- correspond to (point) and (mark).

Is this the way they work:

(defun region-beginning ()
  (min (point) (mark)))

(defun region-end ()
  (max (point) (mark)))

or are there other instances where `region-beginning' is different
from `point'?

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

* Re: what is the point of point-min?
  2003-08-28 17:05     ` Jesper Harder
@ 2003-08-28 17:59       ` Barry Margolin
  2003-08-28 18:47         ` Jesper Harder
  2003-08-28 18:34       ` Kevin Rodgers
       [not found]       ` <m3znhttxic.fsf@peorth.gweep.net>
  2 siblings, 1 reply; 24+ messages in thread
From: Barry Margolin @ 2003-08-28 17:59 UTC (permalink / raw)


In article <m365khyaoi.fsf@defun.localdomain>,
Jesper Harder  <harder@myrealbox.com> wrote:
>Is this the way they work:
>
>(defun region-beginning ()
>  (min (point) (mark)))
>
>(defun region-end ()
>  (max (point) (mark)))

Use the Source, Luke.

>or are there other instances where `region-beginning' is different
>from `point'?

Even if there aren't now, you should allow for the possibility in the
future.

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

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

* Re: what is the point of point-min?
  2003-08-28 17:05     ` Jesper Harder
  2003-08-28 17:59       ` Barry Margolin
@ 2003-08-28 18:34       ` Kevin Rodgers
       [not found]       ` <m3znhttxic.fsf@peorth.gweep.net>
  2 siblings, 0 replies; 24+ messages in thread
From: Kevin Rodgers @ 2003-08-28 18:34 UTC (permalink / raw)


Jesper Harder wrote:

> Kevin Rodgers <ihs_4664@yahoo.com> writes:
>>Besides the point-min confusion, kill-region should be called with
>>(region-beginning) and (region-end) which usually -- but not always
>>-- correspond to (point) and (mark).
> 
> Is this the way they work:
> 
> (defun region-beginning ()
>   (min (point) (mark)))
> 
> (defun region-end ()
>   (max (point) (mark)))
> 
> or are there other instances where `region-beginning' is different
> from `point'?

That's not how they're implemented (see editfns.c), but the result is
the same according to The Region node of the Emacs Lisp manual.

-- 
Kevin Rodgers

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

* Re: what is the point of point-min?
  2003-08-28 17:59       ` Barry Margolin
@ 2003-08-28 18:47         ` Jesper Harder
  2003-08-28 20:05           ` Kai Großjohann
  2003-08-29 12:44           ` Rob Thorpe
  0 siblings, 2 replies; 24+ messages in thread
From: Jesper Harder @ 2003-08-28 18:47 UTC (permalink / raw)


Barry Margolin <barry.margolin@level3.com> writes:

> Jesper Harder  <harder@myrealbox.com> wrote:
>
>>Is this the way they work:
>>
>>(defun region-beginning ()
>>  (min (point) (mark)))
>>
>>(defun region-end ()
>>  (max (point) (mark)))
>
> Use the Source, Luke.

If they were Lisp functions I would have just read the source.  But

* I hate reading C.

* It's much more cumbersome to find the function definition for
  built-in functions, i.e. there's no handy hyperlink to the source
  when doing `C-h f' like there is for Lisp functions.

>>or are there other instances where `region-beginning' is different
>>from `point'?
>
> Even if there aren't now, you should allow for the possibility in the
> future.

Yes, in newly written code.  But it might not be worthwhile to change
stable (currently feature-freezed) code with the possibility of
introducing bugs if there's no difference between (region-end) and
(max (point) (mark)).

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

* Re: what is the point of point-min?
  2003-08-28 18:47         ` Jesper Harder
@ 2003-08-28 20:05           ` Kai Großjohann
  2003-08-28 21:11             ` Greg Hill
                               ` (3 more replies)
  2003-08-29 12:44           ` Rob Thorpe
  1 sibling, 4 replies; 24+ messages in thread
From: Kai Großjohann @ 2003-08-28 20:05 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> writes:

> If they were Lisp functions I would have just read the source.  But
>
> * I hate reading C.

Well, reading Emacs C code is very unlike reading other C code, so
please do give it a try.

> * It's much more cumbersome to find the function definition for
>   built-in functions, i.e. there's no handy hyperlink to the source
>   when doing `C-h f' like there is for Lisp functions.

I just "make tags" in the Emacs source directory and then use M-. to
find such stuff.  Not quite as convenient as M-x find-function RET,
but just a little bit worse.
-- 
Two cafe au lait please, but without milk.

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

* Re: what is the point of point-min?
       [not found]       ` <m3znhttxic.fsf@peorth.gweep.net>
@ 2003-08-28 20:39         ` Jesper Harder
       [not found]           ` <m31xv431u6.fsf@peorth.gweep.net>
  0 siblings, 1 reply; 24+ messages in thread
From: Jesper Harder @ 2003-08-28 20:39 UTC (permalink / raw)


Stainless Steel Rat <ratinox@peorth.gweep.net> writes:

> * Jesper Harder <harder@myrealbox.com>  on Thu, 28 Aug 2003
> | or are there other instances where `region-beginning' is different
> | from `point'?
>
> Absolutely.  This is an easy one.  Set point at the start of a paragraph.
> Type C-SPACE to set the mark.  Type M-n to move to the end of the
> paragraph.  You now have a region where mark is the beginning and point is
> the end.

Yes, but what I meant to say with »other instances« was if there are
any cases where (region-end) is not equivalent to (max (point) (mark)).

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

* Re: what is the point of point-min?
  2003-08-28 20:05           ` Kai Großjohann
@ 2003-08-28 21:11             ` Greg Hill
  2003-08-29 11:30               ` Eli Zaretskii
  2003-08-28 22:11             ` Johan Bockgård
                               ` (2 subsequent siblings)
  3 siblings, 1 reply; 24+ messages in thread
From: Greg Hill @ 2003-08-28 21:11 UTC (permalink / raw)


At 10:05 PM +0200 8/28/03, Kai Großjohann wrote:
>Jesper Harder <harder@myrealbox.com> writes:
>
>>  If they were Lisp functions I would have just read the source.  But
>>
>>  * I hate reading C.
>
>Well, reading Emacs C code is very unlike reading other C code, so
>please do give it a try.

Indeed it is.  In fact, until you have mastered the peculiar coding
conventions it adheres to, including the usage of ten billion
#defined terms whose meanings are far from obvious, it is very VERY
much more difficult than reading any other C code that I have ever
encountered.  For all intents and purposes, Emacs C is a language
unto itself, whose mastery is much more difficult than any "general
purpose" language like LISP.  Though not by any means a "C guru," I
have done a fair amount of both writing C code from scratch and
maintaining other people's C code; and I have long-since concluded
that looking at the C source for Emacs hoping to figure out what it
is doing is a total waste of my time.  I have never made any
significant progress in anything close to a reasonable amount of time.

So "give it a try" at the risk of your sanity.  And don't feel bad it
the experience leaves you feeling totally frustrated, irritated and
alienated.

--Greg

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

* Re: what is the point of point-min?
  2003-08-28 20:05           ` Kai Großjohann
  2003-08-28 21:11             ` Greg Hill
@ 2003-08-28 22:11             ` Johan Bockgård
  2003-08-29  7:33             ` Oliver Scholz
       [not found]             ` <mailman.1207.1062105211.29551.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 24+ messages in thread
From: Johan Bockgård @ 2003-08-28 22:11 UTC (permalink / raw)


kai.grossjohann@gmx.net (Kai Großjohann) writes:

> Not quite as convenient as M-x find-function RET

I use (find-function-setup-keys) which sets up some shortcuts.

C-x [4,5] F  find-function
C-x [4,5] V  find-variable
C-x       K  find-function-on-key

-- 
Johan Bockgård

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

* Re: what is the point of point-min?
       [not found]             ` <mailman.1207.1062105211.29551.help-gnu-emacs@gnu.org>
@ 2003-08-29  7:21               ` Oliver Scholz
  2003-08-29 11:32                 ` Eli Zaretskii
  2003-08-29 10:41               ` Kai Großjohann
  1 sibling, 1 reply; 24+ messages in thread
From: Oliver Scholz @ 2003-08-29  7:21 UTC (permalink / raw)


Greg Hill <ghill@synergymicro.com> writes:

> At 10:05 PM +0200 8/28/03, Kai Großjohann wrote:
>>Jesper Harder <harder@myrealbox.com> writes:
>>
>>>  If they were Lisp functions I would have just read the source.  But
>>>
>>>  * I hate reading C.
>>
>>Well, reading Emacs C code is very unlike reading other C code, so
>>please do give it a try.
>
> Indeed it is.  In fact, until you have mastered the peculiar coding
> conventions it adheres to, including the usage of ten billion #defined
> terms whose meanings are far from obvious, it is very VERY much more
> difficult than reading any other C code that I have ever encountered.

Somehow this comforts me. If you are right, then the fact that I am so
terribly slow at reading the C source of Emacs doesn't necessarily
mean that I am dumb. :-)

> For all intents and purposes, Emacs C is a language unto itself, whose
> mastery is much more difficult than any "general purpose" language
> like LISP.
[...]
> So "give it a try" at the risk of your sanity.  And don't feel bad it
> the experience leaves you feeling totally frustrated, irritated and
> alienated.
[...]

OTOH, "Emacs C" shares a lot of data structures with Emacs Lisp and
uses functions that are Emacs Lisp primitives. So if you are very
comfortable with Emacs Lisp and willing to deal with data structure
you don't fully understand, you have a fair chance to see something in
the code. Some parts of it rather look like Emacs Lisp with less
sophisticated control structures and with a very weird syntax.

Some sort of "Emacs C Reference Manual" which explains the most
important data structures and their accessor macros would be nice. But
OTOH, it's not too hard to guess what CONSP, EQ, STRINGP ... etc. do.

I should add that I don't really know C. I decided once to learn C by
studying the source of Emacs. So I can't really compare. However, I
rather enjoy it now.

One thing that helped me a lot is to step through the code with
gdb. The gdb macros described in etc/DEBUG are a great help to
inspect the data structures.

Then again, I am afraid I'll never understand garbage collection or
redisplay.

    Oliver
-- 
11 Fructidor an 211 de la Révolution
Liberté, Egalité, Fraternité!

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

* Re: what is the point of point-min?
  2003-08-28 20:05           ` Kai Großjohann
  2003-08-28 21:11             ` Greg Hill
  2003-08-28 22:11             ` Johan Bockgård
@ 2003-08-29  7:33             ` Oliver Scholz
       [not found]             ` <mailman.1207.1062105211.29551.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 24+ messages in thread
From: Oliver Scholz @ 2003-08-29  7:33 UTC (permalink / raw)


kai.grossjohann@gmx.net (Kai Großjohann) writes:

> Jesper Harder <harder@myrealbox.com> writes:
[...]
>> * It's much more cumbersome to find the function definition for
>>   built-in functions, i.e. there's no handy hyperlink to the source
>>   when doing `C-h f' like there is for Lisp functions.
>
> I just "make tags" in the Emacs source directory and then use M-. to
> find such stuff.  Not quite as convenient as M-x find-function RET,
> but just a little bit worse.
[...]

I seem to recall that there once was a discussion in emacs-devel to
add a link in the *help* buffer after `C-h f' that lets you jump to
the right place in the C sources. What has become of it? [I have not
updated my working copy since.]

    Oliver
-- 
12 Fructidor an 211 de la Révolution
Liberté, Egalité, Fraternité!

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

* Re: what is the point of point-min?
       [not found]             ` <mailman.1207.1062105211.29551.help-gnu-emacs@gnu.org>
  2003-08-29  7:21               ` Oliver Scholz
@ 2003-08-29 10:41               ` Kai Großjohann
  1 sibling, 0 replies; 24+ messages in thread
From: Kai Großjohann @ 2003-08-29 10:41 UTC (permalink / raw)


Greg Hill <ghill@synergymicro.com> writes:

> Indeed it is.  In fact, until you have mastered the peculiar coding
> conventions it adheres to, including the usage of ten billion #defined
> terms whose meanings are far from obvious, it is very VERY much more
> difficult than reading any other C code that I have ever encountered.

Whee.  Interesting.

I understand very little of the Emacs C code, so it seems I was just
lucky to find the right place to modify which wasn't so difficult.

(I added the variables x-{alt,meta,super,hyper}-keysym.)
-- 
Two cafe au lait please, but without milk.

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

* Re: what is the point of point-min?
  2003-08-28 21:11             ` Greg Hill
@ 2003-08-29 11:30               ` Eli Zaretskii
  0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2003-08-29 11:30 UTC (permalink / raw)


> Date: Thu, 28 Aug 2003 14:11:30 -0700
> From: Greg Hill <ghill@synergymicro.com>
>
> Though not by any means a "C guru," I 
> have done a fair amount of both writing C code from scratch and 
> maintaining other people's C code; and I have long-since concluded 
> that looking at the C source for Emacs hoping to figure out what it 
> is doing is a total waste of my time.  I have never made any 
> significant progress in anything close to a reasonable amount of time.

What other programs of comparable size did you have to read and
understand?  Perhaps Emacs (more than 300K lines of C) is much larger
than you are used to?

FWIW, the macros are there to make reading code _easier_, not harder.
Macros such as CONSP, STRINGP, XCONS, etc., should be almost instantly
understandable to anyone who knows a bit of Lisp.  By contrast, if
you'd see something like

	  if ((enum Lisp_type) foo.u.type == Lisp_Cons)

you might have hard time understanding what is going on.

(It is true that, if you need to _debug_ some Emacs code, you need to
actually read and understand the macros involved.  But the need to
debug the C code is not the issue in this thread, is it?)

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

* Re: what is the point of point-min?
  2003-08-29  7:21               ` Oliver Scholz
@ 2003-08-29 11:32                 ` Eli Zaretskii
  0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2003-08-29 11:32 UTC (permalink / raw)


> From: Oliver Scholz <alkibiades@gmx.de>
> Newsgroups: gnu.emacs.help
> Date: Fri, 29 Aug 2003 09:21:32 +0200
> 
> Some sort of "Emacs C Reference Manual" which explains the most
> important data structures and their accessor macros would be nice.

The chapter "GNU Emacs Internals" in the ELisp manual should be of
some help.

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

* Re: what is the point of point-min?
  2003-08-28 18:47         ` Jesper Harder
  2003-08-28 20:05           ` Kai Großjohann
@ 2003-08-29 12:44           ` Rob Thorpe
  2003-08-30  2:54             ` Jesper Harder
  2003-09-07  6:50             ` Jim Janney
  1 sibling, 2 replies; 24+ messages in thread
From: Rob Thorpe @ 2003-08-29 12:44 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> wrote in message news:<m3r835wrec.fsf@defun.localdomain>...
> Barry Margolin <barry.margolin@level3.com> writes:
> 
> > Jesper Harder  <harder@myrealbox.com> wrote:
> >
> >>Is this the way they work:
> >>
> >>(defun region-beginning ()
> >>  (min (point) (mark)))
> >>
> >>(defun region-end ()
> >>  (max (point) (mark)))
> >
> > Use the Source, Luke.
> 
> If they were Lisp functions I would have just read the source.  But
> 
> * I hate reading C.
> 
> * It's much more cumbersome to find the function definition for
>   built-in functions, i.e. there's no handy hyperlink to the source
>   when doing `C-h f' like there is for Lisp functions.
> 
> >>or are there other instances where `region-beginning' is different
> >>from `point'?
> >
> > Even if there aren't now, you should allow for the possibility in the
> > future.
> 
> Yes, in newly written code.  But it might not be worthwhile to change
> stable (currently feature-freezed) code with the possibility of
> introducing bugs if there's no difference between (region-end) and
> (max (point) (mark)).

I don't know what this moaning about reading emacs source is about,
its not easy, but its not exactly brain surgery.  The behaviour of
region-beginning is subtly different from point.  Firstly as previous
posters have mentioned it will swap the two around to put them in the
right order.  Secondly it will obey the value of the variable
transient-mark-mode, if it is set to non-nil then the mark will
deactivate when the buffer contents change.
Given the function you have posted:

(global-set-key [delete] 
  (lambda () (interactive) 
     (if mark-active
               (kill-region (point) (mark)) 
       (delete-char 1))))

This version in transient mark mode will delete the region even though
in this mode it is not thought of as existing after a character is
inserted into the buffer.

>From editfns.c:-

/* Return the start or end position of the region.
   BEGINNINGP non-zero means return the start.
   If there is no region active, signal an error. */

static Lisp_Object
region_limit (beginningp)
     int beginningp;
{
  extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c.
*/
  Lisp_Object m;
  
  if (!NILP (Vtransient_mark_mode)
      && NILP (Vmark_even_if_inactive)
      && NILP (current_buffer->mark_active))
    Fsignal (Qmark_inactive, Qnil);
  
  m = Fmarker_position (current_buffer->mark);
  if (NILP (m))
    error ("There is no region now");
  
  if ((PT < XFASTINT (m)) == beginningp)
    m = make_number (PT);
  return m;
}

DEFUN ("region-beginning", Fregion_beginning, Sregion_beginning, 0, 0,
0,
  "Return position of beginning of region, as an integer.")
  ()
{
  return region_limit (1);
}

DEFUN ("region-end", Fregion_end, Sregion_end, 0, 0, 0,
  "Return position of end of region, as an integer.")
  ()
{
  return region_limit (0);
}

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

* Re: what is the point of point-min?
  2003-08-29 12:44           ` Rob Thorpe
@ 2003-08-30  2:54             ` Jesper Harder
  2003-09-01 13:41               ` Rob Thorpe
  2003-09-07  6:50             ` Jim Janney
  1 sibling, 1 reply; 24+ messages in thread
From: Jesper Harder @ 2003-08-30  2:54 UTC (permalink / raw)


robert.thorpe@antenova.com (Rob Thorpe) writes:

> Jesper Harder <harder@myrealbox.com> wrote:

>> if there's no difference between (region-end) and (max (point)
>> (mark)).
>
> Secondly it will obey the value of the variable transient-mark-mode,
> if it is set to non-nil then the mark will deactivate when the
> buffer contents change.  Given the function you have posted:
>
> (global-set-key [delete] 
>   (lambda () (interactive) 
>      (if mark-active
>                (kill-region (point) (mark)) 
>        (delete-char 1))))
>
> This version in transient mark mode will delete the region even though
> in this mode it is not thought of as existing after a character is
> inserted into the buffer.

I don't understand that.  The code tests `mark-active', so it won't
delete the region in transient-mark-mode if the region is inactive
(i.e. the mark is deactivated).

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

* Re: what is the point of point-min?
       [not found]           ` <m31xv431u6.fsf@peorth.gweep.net>
@ 2003-08-30  3:32             ` Jesper Harder
       [not found]               ` <m3ekz2idao.fsf@peorth.gweep.net>
  0 siblings, 1 reply; 24+ messages in thread
From: Jesper Harder @ 2003-08-30  3:32 UTC (permalink / raw)


Stainless Steel Rat <ratinox@peorth.gweep.net> writes:

> * Jesper Harder <harder@myrealbox.com>  on Thu, 28 Aug 2003
>
> | Yes, but what I meant to say with »other instances« was if there are
> | any cases where (region-end) is not equivalent to (max (point) (mark)).
>
> That is a very different question, but the answer is still "yes".
> One case is with XEmacs.  If zmacs-regions is t then (mark) returns
> nil unless the region is active (highlighted).

Ah yes, thanks.

But I also noticed that `region-end' isn't even completely compatible
between the two Emacsen.  `region-end' in XEmacs is equivalent to:

   (let ((mark-even-if-inactive t))
     (region-end))

in Emacs.

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

* Re: what is the point of point-min?
       [not found]               ` <m3ekz2idao.fsf@peorth.gweep.net>
@ 2003-08-31 10:58                 ` Unknown
  2003-09-01 17:04                 ` Stefan Monnier
  1 sibling, 0 replies; 24+ messages in thread
From: Unknown @ 2003-08-31 10:58 UTC (permalink / raw)


> From: Stainless Steel Rat <ratinox@peorth.gweep.net>
> Newsgroups: gnu.emacs.help
> Date: Sun, 31 Aug 2003 01:52:47 -0400
> 
> There are many such little not quite identicalities between FSF GNU Emacs
> and XEmacs.  One of my personal favories (ugh) is how they both handle the
> no-conversion coding system.  FSF and X do different things, neither of
> which are in fact no conversion (at least, that was the case last time I
> did anything along those lines).

IIRC, with GNU Emacs 21.x, no-conversion does no conversions at all if
you read the text into a unibyte buffer.  (That's the only case where
it's possible to avoid any conversions without grave consequences such
as byte-combining dread.)  I don't know if that is what you want.

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

* Re: what is the point of point-min?
  2003-08-30  2:54             ` Jesper Harder
@ 2003-09-01 13:41               ` Rob Thorpe
  0 siblings, 0 replies; 24+ messages in thread
From: Rob Thorpe @ 2003-09-01 13:41 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> wrote in message news:<m3he3zsvlz.fsf@defun.localdomain>...
> robert.thorpe@antenova.com (Rob Thorpe) writes:
> 
> > Jesper Harder <harder@myrealbox.com> wrote:
>  
> >> if there's no difference between (region-end) and (max (point)
> >> (mark)).
> >
> > Secondly it will obey the value of the variable transient-mark-mode,
> > if it is set to non-nil then the mark will deactivate when the
> > buffer contents change.  Given the function you have posted:
> >
> > (global-set-key [delete] 
> >   (lambda () (interactive) 
> >      (if mark-active
> >                (kill-region (point) (mark)) 
> >        (delete-char 1))))
> >
> > This version in transient mark mode will delete the region even though
> > in this mode it is not thought of as existing after a character is
> > inserted into the buffer.
> 
> I don't understand that.  The code tests `mark-active', so it won't
> delete the region in transient-mark-mode if the region is inactive
> (i.e. the mark is deactivated).

Sorry, your right, my mistake.

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

* Re: what is the point of point-min?
       [not found]               ` <m3ekz2idao.fsf@peorth.gweep.net>
  2003-08-31 10:58                 ` Unknown
@ 2003-09-01 17:04                 ` Stefan Monnier
  1 sibling, 0 replies; 24+ messages in thread
From: Stefan Monnier @ 2003-09-01 17:04 UTC (permalink / raw)


> and XEmacs.  One of my personal favories (ugh) is how they both handle the
> no-conversion coding system.  FSF and X do different things, neither of
> which are in fact no conversion (at least, that was the case last time I
> did anything along those lines).

Maybe it's been changed since, but at least now Emacs's `no-conversion'
is an alias for `binary' and thus treats every byte as a character
without any attempt to convert it in any way.


        Stefan

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

* Re: what is the point of point-min?
  2003-08-29 12:44           ` Rob Thorpe
  2003-08-30  2:54             ` Jesper Harder
@ 2003-09-07  6:50             ` Jim Janney
  2003-09-07 17:28               ` Eli Zaretskii
  1 sibling, 1 reply; 24+ messages in thread
From: Jim Janney @ 2003-09-07  6:50 UTC (permalink / raw)


Rob Thorpe <robert.thorpe@antenova.com> wrote, in part:

> From editfns.c:-
> 
> /* Return the start or end position of the region.
>    BEGINNINGP non-zero means return the start.
>    If there is no region active, signal an error. */
> 
> static Lisp_Object
> region_limit (beginningp)
>      int beginningp;
> {
>   extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c.
> */
>   Lisp_Object m;
>   
>   if (!NILP (Vtransient_mark_mode)
>       && NILP (Vmark_even_if_inactive)
>       && NILP (current_buffer->mark_active))
>     Fsignal (Qmark_inactive, Qnil);
>   
>   m = Fmarker_position (current_buffer->mark);
>   if (NILP (m))
>     error ("There is no region now");
>   
>   if ((PT < XFASTINT (m)) == beginningp)
>     m = make_number (PT);
>   return m;
> }

Note that the description of BEGINNINGP in the comment is wrong: the way
the code is written, it only returns the start when beginningp is 1.

-- 
Jim Janney 

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

* Re: what is the point of point-min?
  2003-09-07  6:50             ` Jim Janney
@ 2003-09-07 17:28               ` Eli Zaretskii
  0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2003-09-07 17:28 UTC (permalink / raw)


> From: jjanney@xmission.com (Jim Janney)
> Newsgroups: gnu.emacs.help
> Date: Sun, 7 Sep 2003 00:50:01 -0600
> >   
> >   if ((PT < XFASTINT (m)) == beginningp)
> >     m = make_number (PT);
> >   return m;
> > }
> 
> Note that the description of BEGINNINGP in the comment is wrong: the way
> the code is written, it only returns the start when beginningp is 1.

Thanks for pointing this out, I've fixed the code to deliver as
promised by the comment.

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

end of thread, other threads:[~2003-09-07 17:28 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E19s71c-0005cn-KT@monty-python.gnu.org>
2003-08-27 23:40 ` what is the point of point-min? Joe Corneli
     [not found] ` <mailman.1156.1062027752.29551.help-gnu-emacs@gnu.org>
2003-08-28  0:23   ` Jesper Harder
2003-08-28 16:17   ` Kevin Rodgers
2003-08-28 17:05     ` Jesper Harder
2003-08-28 17:59       ` Barry Margolin
2003-08-28 18:47         ` Jesper Harder
2003-08-28 20:05           ` Kai Großjohann
2003-08-28 21:11             ` Greg Hill
2003-08-29 11:30               ` Eli Zaretskii
2003-08-28 22:11             ` Johan Bockgård
2003-08-29  7:33             ` Oliver Scholz
     [not found]             ` <mailman.1207.1062105211.29551.help-gnu-emacs@gnu.org>
2003-08-29  7:21               ` Oliver Scholz
2003-08-29 11:32                 ` Eli Zaretskii
2003-08-29 10:41               ` Kai Großjohann
2003-08-29 12:44           ` Rob Thorpe
2003-08-30  2:54             ` Jesper Harder
2003-09-01 13:41               ` Rob Thorpe
2003-09-07  6:50             ` Jim Janney
2003-09-07 17:28               ` Eli Zaretskii
2003-08-28 18:34       ` Kevin Rodgers
     [not found]       ` <m3znhttxic.fsf@peorth.gweep.net>
2003-08-28 20:39         ` Jesper Harder
     [not found]           ` <m31xv431u6.fsf@peorth.gweep.net>
2003-08-30  3:32             ` Jesper Harder
     [not found]               ` <m3ekz2idao.fsf@peorth.gweep.net>
2003-08-31 10:58                 ` Unknown
2003-09-01 17:04                 ` Stefan Monnier

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.