Re: [PATCH] mg: {beginning,end}-of-buffer don't set marks in Emacs

2019-05-23 Thread Kjell Wooding
> Note: I only wanted to point out something that bothered me.  I'm not
> using mg(1) these days and I don't plan to spend time on this issue.


That’s pretty much the modern internet, summarized in two sentences


Re: [PATCH] mg: {beginning,end}-of-buffer don't set marks in Emacs

2019-05-23 Thread Jeremie Courreges-Anglas
On Wed, May 22 2019, Jeremie Courreges-Anglas  wrote:

[...]

> So if you're pushing for a change here we'd need a better explanation.

Note: I only wanted to point out something that bothered me.  I'm not
using mg(1) these days and I don't plan to spend time on this issue.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: [PATCH] mg: {beginning,end}-of-buffer don't set marks in Emacs

2019-05-22 Thread Kjell Wooding
Regardless of the decision on which way the behavior should go, it is a
documentation bug either way. (E.g. beginning-of-buffer is missed
entirely). Probably my fault (from a lng time ago.)

On Wed, May 22, 2019 at 8:53 AM Leonid Bobrov  wrote:

> On Wed, May 22, 2019 at 01:36:41PM +0200, Jeremie Courreges-Anglas wrote:
> > On Wed, May 22 2019, Leonid Bobrov  wrote:
> > > It seems that nobody cares about compatibility with GNU Emacs. Besides
> > > this behaviour is annoying because when I set a mark, scroll a buffer,
> > > and decide to go to the end of buffer that overwrites my mark and I
> have
> > > to start over. Also besides that you have to figure out this behavior
> > > because manpage just says:
> > > ```
> > >M-<   beginning-of-buffer
> > >M->   end-of-buffer
> > > ```
> > > Should we consider this documentation bug and patch a manpage?
> > >
> > > On Thu, Feb 14, 2019 at 04:46:21PM +0200, Leonid Bobrov wrote:
> > >> Ping.
> > >>
> > >> On Wed, Feb 06, 2019 at 11:29:47PM +0200, Leonid Bobrov wrote:
> > >> > Hi!
> > >> >
> > >> > Going to end and begging of buffer doesn't set marks in Emacs.
> >
> > This doesn't match my understanding of marks in emacs, nor what emacs
> > C-h k says:
> >
> > --8<--
> > M-< runs the command beginning-of-buffer (found in global-map), which is
> > an interactive compiled Lisp function in ‘simple.el’.
> >
> > It is bound to ., b,   , , ,
> > M-<,.
> >
> > (beginning-of-buffer  ARG)
> >
> > This function is for interactive use only;
> > in Lisp code use `(goto-char (point-min))' instead.
> >
> > Move point to the beginning of the buffer.
> > With numeric arg N, put point N/10 of the way from the beginning.
> > If the buffer is narrowed, this command uses the beginning of the
> > accessible part of the buffer.
> >
> > Push mark at previous position, unless either a C-u prefix
> > ^^
> > is supplied, or Transient Mark mode is enabled and the mark is active.
> > -->8--
> >
> > So if you're pushing for a change here we'd need a better explanation.
> >
> > --
> > jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524
> E7EE
> >
>
> Oh, I haven't noticed that behavior in Emacs before. So, if I haven't
> pushed a mark before, then Emacs will automatically push it (while mg
> pushes it in all cases).
>
> Also that C-u prefix part is not true (I made a check, also thank you
> for new knowledge), in Emacs it pushes a mark if I haven't pushed it
> myself.
>
> In Emacs Transient Mark mode is on by default, but mg doesn't have this
> mode. Also mg doesn't have that N/10 behavior when giving it a numeric
> arg.
>
> In order to be compatible with GNU Emacs, I have to implement Transient
> Mark mode, make it on by default, while in this mode using M-< and M->
> shouldn't push mark if it's active and I have to implement N/10 behavior
> when giving a numeric arg to M-< and M->, is everything correct?
>
>


Re: [PATCH] mg: {beginning,end}-of-buffer don't set marks in Emacs

2019-05-22 Thread Leonid Bobrov
On Wed, May 22, 2019 at 01:36:41PM +0200, Jeremie Courreges-Anglas wrote:
> On Wed, May 22 2019, Leonid Bobrov  wrote:
> > It seems that nobody cares about compatibility with GNU Emacs. Besides
> > this behaviour is annoying because when I set a mark, scroll a buffer,
> > and decide to go to the end of buffer that overwrites my mark and I have
> > to start over. Also besides that you have to figure out this behavior
> > because manpage just says:
> > ```
> >M-<   beginning-of-buffer
> >M->   end-of-buffer
> > ```
> > Should we consider this documentation bug and patch a manpage?
> >
> > On Thu, Feb 14, 2019 at 04:46:21PM +0200, Leonid Bobrov wrote:
> >> Ping.
> >> 
> >> On Wed, Feb 06, 2019 at 11:29:47PM +0200, Leonid Bobrov wrote:
> >> > Hi!
> >> > 
> >> > Going to end and begging of buffer doesn't set marks in Emacs.
> 
> This doesn't match my understanding of marks in emacs, nor what emacs
> C-h k says:
> 
> --8<--
> M-< runs the command beginning-of-buffer (found in global-map), which is
> an interactive compiled Lisp function in ‘simple.el’.
> 
> It is bound to ., b,   , , ,
> M-<,.
> 
> (beginning-of-buffer  ARG)
> 
> This function is for interactive use only;
> in Lisp code use `(goto-char (point-min))' instead.
> 
> Move point to the beginning of the buffer.
> With numeric arg N, put point N/10 of the way from the beginning.
> If the buffer is narrowed, this command uses the beginning of the
> accessible part of the buffer.
> 
> Push mark at previous position, unless either a C-u prefix
> ^^
> is supplied, or Transient Mark mode is enabled and the mark is active.
> -->8--
> 
> So if you're pushing for a change here we'd need a better explanation.
> 
> -- 
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
> 

Oh, I haven't noticed that behavior in Emacs before. So, if I haven't
pushed a mark before, then Emacs will automatically push it (while mg
pushes it in all cases).

Also that C-u prefix part is not true (I made a check, also thank you
for new knowledge), in Emacs it pushes a mark if I haven't pushed it
myself.

In Emacs Transient Mark mode is on by default, but mg doesn't have this
mode. Also mg doesn't have that N/10 behavior when giving it a numeric
arg.

In order to be compatible with GNU Emacs, I have to implement Transient
Mark mode, make it on by default, while in this mode using M-< and M->
shouldn't push mark if it's active and I have to implement N/10 behavior
when giving a numeric arg to M-< and M->, is everything correct?



Re: [PATCH] mg: {beginning,end}-of-buffer don't set marks in Emacs

2019-05-22 Thread Jeremie Courreges-Anglas
On Wed, May 22 2019, Leonid Bobrov  wrote:
> It seems that nobody cares about compatibility with GNU Emacs. Besides
> this behaviour is annoying because when I set a mark, scroll a buffer,
> and decide to go to the end of buffer that overwrites my mark and I have
> to start over. Also besides that you have to figure out this behavior
> because manpage just says:
> ```
>M-<   beginning-of-buffer
>M->   end-of-buffer
> ```
> Should we consider this documentation bug and patch a manpage?
>
> On Thu, Feb 14, 2019 at 04:46:21PM +0200, Leonid Bobrov wrote:
>> Ping.
>> 
>> On Wed, Feb 06, 2019 at 11:29:47PM +0200, Leonid Bobrov wrote:
>> > Hi!
>> > 
>> > Going to end and begging of buffer doesn't set marks in Emacs.

This doesn't match my understanding of marks in emacs, nor what emacs
C-h k says:

--8<--
M-< runs the command beginning-of-buffer (found in global-map), which is
an interactive compiled Lisp function in ‘simple.el’.

It is bound to ., b,   , , ,
M-<,.

(beginning-of-buffer  ARG)

This function is for interactive use only;
in Lisp code use `(goto-char (point-min))' instead.

Move point to the beginning of the buffer.
With numeric arg N, put point N/10 of the way from the beginning.
If the buffer is narrowed, this command uses the beginning of the
accessible part of the buffer.

Push mark at previous position, unless either a C-u prefix
^^
is supplied, or Transient Mark mode is enabled and the mark is active.
-->8--

So if you're pushing for a change here we'd need a better explanation.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: [PATCH] mg: {beginning,end}-of-buffer don't set marks in Emacs

2019-05-22 Thread Leonid Bobrov
It seems that nobody cares about compatibility with GNU Emacs. Besides
this behaviour is annoying because when I set a mark, scroll a buffer,
and decide to go to the end of buffer that overwrites my mark and I have
to start over. Also besides that you have to figure out this behavior
because manpage just says:
```
   M-<   beginning-of-buffer
   M->   end-of-buffer
```
Should we consider this documentation bug and patch a manpage?

On Thu, Feb 14, 2019 at 04:46:21PM +0200, Leonid Bobrov wrote:
> Ping.
> 
> On Wed, Feb 06, 2019 at 11:29:47PM +0200, Leonid Bobrov wrote:
> > Hi!
> > 
> > Going to end and begging of buffer doesn't set marks in Emacs.
> > 
> > Index: basic.c
> > ===
> > RCS file: /cvs/src/usr.bin/mg/basic.c,v
> > retrieving revision 1.47
> > diff -u -p -u -p -r1.47 basic.c
> > --- basic.c 10 Oct 2015 09:13:14 -  1.47
> > +++ basic.c 6 Feb 2019 21:18:34 -
> > @@ -122,7 +122,6 @@ forwchar(int f, int n)
> >  int
> >  gotobob(int f, int n)
> >  {
> > -   (void) setmark(f, n);
> > curwp->w_dotp = bfirstlp(curbp);
> > curwp->w_doto = 0;
> > curwp->w_rflag |= WFFULL;
> > @@ -140,7 +139,6 @@ gotoeob(int f, int n)
> >  {
> > struct line *lp;
> >  
> > -   (void) setmark(f, n);
> > curwp->w_dotp = blastlp(curbp);
> > curwp->w_doto = llength(curwp->w_dotp);
> > curwp->w_dotline = curwp->w_bufp->b_lines;
> > Index: region.c
> > ===
> > RCS file: /cvs/src/usr.bin/mg/region.c,v
> > retrieving revision 1.37
> > diff -u -p -u -p -r1.37 region.c
> > --- region.c9 Sep 2016 06:05:51 -   1.37
> > +++ region.c6 Feb 2019 21:18:34 -
> > @@ -405,6 +405,7 @@ markbuffer(int f, int n)
> >  {
> > if (gotoeob(f,n) == FALSE)
> > return (FALSE);
> > +   (void) setmark(f, n);
> > if (gotobob(f,n) == FALSE)
> > return (FALSE);
> > return (TRUE);
> > 
> 



Re: [PATCH] mg: {beginning,end}-of-buffer don't set marks in Emacs

2019-02-14 Thread Leonid Bobrov
Ping.

On Wed, Feb 06, 2019 at 11:29:47PM +0200, Leonid Bobrov wrote:
> Hi!
> 
> Going to end and begging of buffer doesn't set marks in Emacs.
> 
> Index: basic.c
> ===
> RCS file: /cvs/src/usr.bin/mg/basic.c,v
> retrieving revision 1.47
> diff -u -p -u -p -r1.47 basic.c
> --- basic.c   10 Oct 2015 09:13:14 -  1.47
> +++ basic.c   6 Feb 2019 21:18:34 -
> @@ -122,7 +122,6 @@ forwchar(int f, int n)
>  int
>  gotobob(int f, int n)
>  {
> - (void) setmark(f, n);
>   curwp->w_dotp = bfirstlp(curbp);
>   curwp->w_doto = 0;
>   curwp->w_rflag |= WFFULL;
> @@ -140,7 +139,6 @@ gotoeob(int f, int n)
>  {
>   struct line *lp;
>  
> - (void) setmark(f, n);
>   curwp->w_dotp = blastlp(curbp);
>   curwp->w_doto = llength(curwp->w_dotp);
>   curwp->w_dotline = curwp->w_bufp->b_lines;
> Index: region.c
> ===
> RCS file: /cvs/src/usr.bin/mg/region.c,v
> retrieving revision 1.37
> diff -u -p -u -p -r1.37 region.c
> --- region.c  9 Sep 2016 06:05:51 -   1.37
> +++ region.c  6 Feb 2019 21:18:34 -
> @@ -405,6 +405,7 @@ markbuffer(int f, int n)
>  {
>   if (gotoeob(f,n) == FALSE)
>   return (FALSE);
> + (void) setmark(f, n);
>   if (gotobob(f,n) == FALSE)
>   return (FALSE);
>   return (TRUE);
>