From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?6Lev5a6i?= Newsgroups: gmane.emacs.devel Subject: Re: [elpa] master 74818d5: Brief Mode v5.86 release. Date: Fri, 19 Oct 2018 23:47:44 +0800 Message-ID: References: <20181018141131.22680.53035@vcs0.savannah.gnu.org> <20181018141132.6E8BA208EC@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000036b399057896d57d" X-Trace: blaine.gmane.org 1539964020 393 195.159.176.226 (19 Oct 2018 15:47:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 Oct 2018 15:47:00 +0000 (UTC) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 19 17:46:55 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDWzH-0008UI-9M for ged-emacs-devel@m.gmane.org; Fri, 19 Oct 2018 17:46:55 +0200 Original-Received: from localhost ([::1]:51175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDX1N-0001H5-Po for ged-emacs-devel@m.gmane.org; Fri, 19 Oct 2018 11:49:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDX0x-00016f-Hq for emacs-devel@gnu.org; Fri, 19 Oct 2018 11:48:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDX0u-0005tU-HW for emacs-devel@gnu.org; Fri, 19 Oct 2018 11:48:39 -0400 Original-Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:39449) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDX0r-0005g1-6m for emacs-devel@gnu.org; Fri, 19 Oct 2018 11:48:34 -0400 Original-Received: by mail-ed1-x52f.google.com with SMTP id d15-v6so31869228edq.6 for ; Fri, 19 Oct 2018 08:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3WlNKHCft4v5Gmx5UDA32jWP/TLD4q8hmpifG7BQKy0=; b=BwseOMdV399B4jS0Fy+BsNsC9QuQ4C9Ta3pQJ9qZzna0RI82zb4W6+bxL7147FBw2a FZ86HDNvnmbQ+8YzOZwzbHqH6UoDD2gJ/wmWdCdjERyo8rAYZ6QC+bKWlHJhILsdYzzS NdBgAGaqsbmX7cGihQ7NPIYFHi0IGjTt0O/aTdGY8mWbm+b5nZ5goEiPkfcvU7moWqgg RN0YlXChoLVtmrkxfEcXrlY1XKHCmFIEzP/AawdnFHihK/o5uKHRO2lK2cI1CblbyeXF v82ue7/0MTEm506BwCbk+F3jkfRbihxPrtakpL+/YHkHOTwC9Y23g7P6jl6SYGdhW5bY y1dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3WlNKHCft4v5Gmx5UDA32jWP/TLD4q8hmpifG7BQKy0=; b=iDfhEhUOTnTwTugNM5ABq0KBKA1h1ooKCONFruVWRYjuzqBxOG/S/fJDeD4+HVppKO r6JSFnGSTowDfALqgOwODCyZC60cGMix+2r3yN2q8gw8dGnXD51L7XWJNS65SmatuCkn sUfk5QOGpRcP2vCBYYIAkG84ZN7RMx8tHMsFFJXwK51t/VZcQwQm0g75yTx96CzB/jLL LOORhUNyjjvyH/Jkgkd1L6eBijaYwJULq744n9hdLiuVKTc2i8hCoH/9k6bfIye3afsI cU45lDEkMj7xK4da904vXB3gMsdWesvUedvrhfF16hKvgLT7TqJblOIO1KQkNHUY074M 9NUQ== X-Gm-Message-State: ABuFfoiF4FTZT9vHuZSNnVf/6vT6f7eyvx//MJ8ke/hBHXJSbNWuddBm vJ4ZcL26c24etYJW1+iHUbSwfIynduxWv94zvwWF3L90IS0= X-Google-Smtp-Source: ACcGV63vmco+3p1cVMTJDCPUmrI5IncI7vwAraukZBTWkGUtUhg+k5kWnJcKjlPFzrLCdufHz/3MdxdRsWV+vLUOXfw= X-Received: by 2002:a50:9151:: with SMTP id f17-v6mr6748335eda.159.1539964101111; Fri, 19 Oct 2018 08:48:21 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230498 Archived-At: --00000000000036b399057896d57d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > (... comments about the bash script 'b') The purpose of this quick launcher bash script "b" is to allow non-Emacs users a quick way to launch Brief mode even if one never use Emacs before, in order to elicit potential new Emacs & Brief users. This script also tries to mimic the "look and feel" of the original Brief editor and hence those default setting changes. The wrapper file 'b.el' serves for the same purpose to show new users what Emacs setting changes required to make scrolling not jumpy. 'b.el' was originally used by 'b' but later I move those things into 'b' to make things more obvious. With 'b', a new user can just install and launch Emacs with a different default keystroke configuration. Once they become a little bit more experienced with Emacs, this launcher is no longer needed. Users can change .emacs to achieve the same thing. 'b' is not intended to be used for experienced users or for long; therefore I have to assume users don't know how to install Emacs packages in the first place. >> + BRIEFVERSION ELPA brief version, default "5.86" >I'd recommend not to default to any specific version, ... The launcher could actually become more complicated to perform more extensive search and get rid of this version, but the launch time will be increased accordingly and give new users a bad impression that Emacs is slow, compare to vi, vim or nano, just like the rumors say. As 'b' might be the first impression for new users I would like to prevent this kind of possibility. It's also simple enough so any Linux user with some basic shell script capability can modify the script by themselves. >> +#!/bin/bash > >Do you actually make use of bash-isms? If so, can we avoid them >without too much extra work? If not, we should say "/bin/sh". Yes, quite a few bash specific things. Linux systems must have bash installed so even tcsh/csh/zsh users still able to run it. >> + (setq scroll-step 1 \ >> + scroll-conservatively 101) \ >> ... >Why are these (h)scroll settings here instead of adding them to It's basically telling new users what Emacs global settings are affecting those (jumpy scrolling) behavior, without a need to look into brief.el. > diff --git a/packages/brief/b.el b/packages/brief/b.el The purpose of this file is the same, sample code showing users those settings. > ;; Emacs 23.3.1, 24.4.50.2, 25.2.2, 26.0.50, 26.1 and 27.0.50. > has 5.86 still been tested with all those Emacs versions? Yes, but only some basic tests. >> (defcustom brief-fake-region-face 'region ; 'secondary-selection > ... >You probably want `:type 'face` here. I found I need to change that to defface otherwise in Emacs GUI it won't show up as "face" even if I changed to :type 'face. >The `:group 'brief` is redundant (it defaults to the last group defined I was following how the builtin "cua" package defines them, it keeps all the ":group 'cua" too. This should be more convenient if someday I move it to another file. >> +(defcustom brief-search-replace-using-regexp t >> +(defvar-local brief-search-overlay nil >> (defvar brief-latest-killed-buffer-info nil >> +(defmacro brief-meta-l-key (updown key) >> + (let* (c1 > Why not (defalias 'brief-beginning-of-file #'beginning-of-buffer) ? > Why not (defalias 'brief-end-of-file #'end-of-buffer) ? Nice, all of the above are followed, thanks! >> +(defun brief-toggle-auto-backup () >> + "Toggle auto-backup on or off." >> + (interactive) >> + (message "Turn Emacs auto-backup %s" >> + (if (setq auto-save-default (not auto-save-default)) >> + "ON" "OFF"))) > You could use a minor mode, here: > > (define-minor-mode brief-auto-backup-mode > "Whether auto-backup is done" > :global t > :variable auto-save-default) Wouldn't that become more complicated as I still need to define a function `brief-toggle-auto-backup' to toggle it? > Why not (defalias 'brief-open-new-line-next #'open-line) ? They're different, `brief-open-new-line-next' shouldn't split current line or it will be no different than the key. I added a comment there. Thanks. Best regards, Luke Lee Stefan Monnier =E6=96=BC 2018=E5=B9=B410=E6=9C= =8818=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D=8811:43=E5=AF=AB=E9=81=93= =EF=BC=9A > Hi Luke, > > Thanks for working on Brief mode. I have some comments on your patch, th= o. > > > +BRIEFVERSION=3D${BRIEFVERSION-"5.86"} > [...] > > + BRIEFVERSION ELPA brief version, default "5.86" > > I'd recommend not to default to any specific version, because it's very > likely that someone will end up bumping the "Version:" header in > brief.el without realizing that it needs to be updated elsewhere. > > Some with all the places where you say "5.86" in the README: better > reword it such that it doesn't need to be updated when the version > number changes. > > > +# Search for brief.el or brief.elc through default path list > > Why not just assume that the `brief` package was properly installed, > and hence `emacs -l brief` will just work=E2=84=A2? > > > +#!/bin/bash > > Do you actually make use of bash-isms? If so, can we avoid them > without too much extra work? If not, we should say "/bin/sh". > > > +exec ${EMACS} --load ${BRIEFPATH}/brief --eval \ > > +"(progn \ > > + (setq-default truncate-lines t) \ > > + (setq scroll-step 1 \ > > + scroll-conservatively 101) \ > > + (setq hscroll-margin 1 \ > > + hscroll-step 1) \ > > + (scroll-bar-mode -1) \ > > + (brief-mode 1))" \ > > +"${EMACSARGS[@]}" > > Why are these (h)scroll settings here instead of adding them to > brief-mode? > > If you want to keep `brief-mode` as a mode which doesn't impose > particular (h)scroll settings (which is probably a good idea, indeed), > then you could add a new function to brief.el and call that function > instead of `brief-mode`. > > > diff --git a/packages/brief/b.el b/packages/brief/b.el > > new file mode 100644 > > index 0000000..4a0ab6b > > --- /dev/null > > +++ b/packages/brief/b.el > > @@ -0,0 +1,9 @@ > > +(setq-default truncate-lines t) > > +;;(setq-default global-visual-line-mode t) > > +(setq scroll-step 1 > > + scroll-conservatively 101) > > +(setq hscroll-margin 1 > > + hscroll-step 1) > > +(scroll-bar-mode -1) > > +(load "~/bin/elisp/brief/brief") > > +(brief-mode 1) > > Several problems here: > - I don't see any place where this file is used. > - the chance that (load "~/bin/elisp/brief/brief") will work > on the user's system is fairly slim. > - this file will be in the `load-path` so (load "b") will load it and so > will (require 'b). I think we'd rather keep such short names for more > popular packages (like the `s` package). > - this Elisp file doesn't follow the convention that loading a file > doesn't have significant effects (i.e. it just defines new vars and > functions). > > > diff --git a/packages/brief/brief.el b/packages/brief/brief.el > > index 1dd3181..66d3790 100644 > > --- a/packages/brief/brief.el > > +++ b/packages/brief/brief.el > > @@ -1,11 +1,11 @@ > > -;;; brief.el --- Brief Editor Emulator > > +;;; brief.el --- Brief Editor Emulator (Brief Mode) > > The Commentary says > > ;; On Linux: (including native X11 Emacs, terminal mode Emacs on xter= m > ;; and Linux X11 Emacs running on VcXsrv (1.19.3.4+) under > ;; Win10): > ;; Emacs 23.3.1, 24.4.50.2, 25.2.2, 26.0.50, 26.1 and 27.0.50. > > has 5.86 still been tested with all those Emacs versions? > Any chance you'd be willing to drop compatibility with Emacs-23 (which > doesn't come with package.el)? > > > +(defcustom brief-search-replace-using-regexp t > > + "An option determine if search & replace using regular expression or > string. > > +This is a buffer local variable with default value 't which means > > +regular expression is used for search & replace commands by default." > > + :type 'boolean > > + :group 'brief) > > The `:group 'brief` is redundant (it defaults to the last group defined > in the same file). Same applies to all other defcustoms. > Oh, and the docstring doesn't need to say "An option" ;-) > > > (defcustom brief-fake-region-face 'region ; 'secondary-selection > > "The face (color) of fake region when `brief-search-fake-region-mark= ' > is t." > > - :type 'boolean > > + :type 'sexp > > :group 'brief) > > You probably want `:type 'face` here. > > > +(defvar-local brief-search-overlay nil > > + "A buffer local overlay which records the current search selection. > > +It is deleted when the search ends or region deactivated.") > > It should probably use a "--" in the name. > > > (defvar brief-latest-killed-buffer-info nil > > - "This variable records the info of the most recently killed file > > -buffer. If user accidentally killed a file buffer, it can be > > -recovered accordingly. > > + "This variable records the info of the most recently killed file > buffer. > > +If user accidentally killed a file buffer, it can be recovered > > +accordingly. > > Information is a list of: > > As above, the docstring doesn't need to say "This variable records". > > > +(defmacro brief-meta-l-key (updown key) > > + "Define key function and associated the key in `brief-prefix-meta-l'= ." > > + (let* ((dir (symbol-name updown)) > > + (keydesc (key-description key)) > > + (keyfunc (intern (concat "brief-mark-line-" dir "-with-" > keydesc)))) > > + `(progn > > + (defun ,keyfunc () > > + ,(concat "Mark line " dir " with " keydesc " key") > > + (interactive) > > + (,(intern (concat "brief-call-mark-line-" dir "-with-key")) > > + ,key)) > > + (define-key brief-prefix-meta-l ,key ',keyfunc)))) > > This macro name and docstring makes it sound like it works for anything > one might want to have under the M-l prefix, yet the code seems to > limit this to those few operations named > brief-call-mark-line-*-with-key, so it's much more focused than announced= . > > > (call-interactively > > '(lambda (filename) > > Please don't quote your lambdas. > > > + (let* (c1 > > + (p1 (save-excursion > > + (end-of-visual-line) > > + (setq c1 (following-char)) (point))) > > + (p2 (save-excursion > > + (end-of-line) (point)))) ;; `end-of-line' of course is > at crlf > > I think you can turn this into: > > (let* ((p1 (save-excursion > (end-of-visual-line) > (point))) > (c1 (char-after p1)) > (p2 (line-end-position))) ;; `end-of-line' of course is at crl= f > > > +(defun brief-toggle-auto-backup () > > + "Toggle auto-backup on or off." > > + (interactive) > > + (message "Turn Emacs auto-backup %s" > > + (if (setq auto-save-default (not auto-save-default)) > > + "ON" "OFF"))) > > You could use a minor mode, here: > > (define-minor-mode brief-auto-backup-mode > "Whether auto-backup is done" > :global t > :variable auto-save-default) > > > +(defun brief-beginning-of-file () > > + "Goto beginning of file." > > + (interactive "^") > > + (goto-char (point-min))) > > Why not (defalias 'brief-beginning-of-file #'beginning-of-buffer) ? > > > +(defun brief-end-of-file () > > + "Goto end of file." > > + (interactive "^") > > + (goto-char (point-max))) > > Why not (defalias 'brief-end-of-file #'end-of-buffer) ? > > > +(defun brief-open-new-line-next () > > + "Open a new line right below the current line and go there." > > + (interactive) > > + (move-end-of-line 1) > > + (newline)) > > Why not (defalias 'brief-open-new-line-next #'open-line) ? > > > Stefan > --=20 Best regards, Luke Lee --00000000000036b399057896d57d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> (... comments about= the bash script 'b')

The purpose of this quick launcher bash script "b" is to= allow
non-Emacs users a quick way to launch Brief mode even if one neve= r use
Emacs before, in order to elicit potential new Emacs & Brief u= sers.

This script also tries to mimic the "look and feel" = of the original
Brief editor and hence those default setting changes. Th= e wrapper file
'b.el' serves for the same purpose to show new us= ers what Emacs setting
changes required to make scrolling not jumpy.=C2= =A0 'b.el' was originally
used by 'b' but later I move t= hose things into 'b' to make things more
obvious. With 'b= 9;, a new user can just install and launch Emacs with a
different defaul= t keystroke configuration.

Once they become a little bit more experi= enced with Emacs, this
launcher is no longer needed.=C2=A0 Users can cha= nge .emacs to achieve the
same thing.=C2=A0 'b' is not intended = to be used for experienced users or
for long; therefore I have to assume= users don't know how to install
Emacs packages in the first place.<= br>
>> +=C2=A0=C2=A0=C2=A0 BRIEFVERSION=C2=A0=C2=A0=C2=A0=C2=A0 EL= PA brief version, default "5.86"
>I'd recommend not to = default to any specific version, ...

The launcher could actually bec= ome more complicated to perform more
extensive search and get rid of thi= s version, but the launch time
will be increased accordingly and give ne= w users a bad impression
that Emacs is slow, compare to vi, vim or nano,= just like the rumors
say.=C2=A0 As 'b' might be the first impre= ssion for new users I would like
to prevent this kind of possibility.=C2= =A0 It's also simple enough so
any Linux user with some basic shell = script capability can modify
the script by themselves.

>> += #!/bin/bash
>
>Do you actually make use of bash-isms?=C2=A0 If = so, can we avoid them
>without too much extra work?=C2=A0 If not, we = should say "/bin/sh".

Yes, quite a few bash specific thing= s. Linux systems must have bash
installed so even tcsh/csh/zsh users sti= ll able to run it.

>> +=C2=A0 (setq scroll-step 1 \
>>= ; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 scroll-conservatively 101) \<= br>>> ...
>Why are these (h)scroll settings here instead of add= ing them to

It's basically telling new users what Emacs global s= ettings are
affecting those (jumpy scrolling) behavior, without a need t= o look
into brief.el.

> diff --git a/packages/brief/b.el b/pac= kages/brief/b.el

The purpose of this file is the same, sample code s= howing users
those settings.

>=C2=A0=C2=A0=C2=A0 ;;=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 Emacs 23.3.1, 24.4.50.2, 25.2.2, 26.0.50, 26.1 and 27= .0.50.
> has 5.86 still been tested with all those Emacs versions?
Yes, but only some basic tests.

>>=C2=A0 (defcustom brief= -fake-region-face 'region ; 'secondary-selection
> ...
>= ;You probably want `:type 'face` here.

I found I need to change = that to defface otherwise in Emacs GUI
it won't show up as "fac= e" even if I changed to :type 'face.

>The `:group 'b= rief` is redundant (it defaults to the last group defined

I was foll= owing how the builtin "cua" package defines them, it
keeps all= the ":group 'cua" too. This should be more convenient
if = someday I move it to another file.

>> +(defcustom brief-search= -replace-using-regexp t

>> +(defvar-local brief-search-overlay= nil

>>=C2=A0 (defvar brief-latest-killed-buffer-info nil
<= br>>> +(defmacro brief-meta-l-key (updown key)

>> +=C2= =A0 (let* (c1

> Why not (defalias 'brief-beginning-of-file #&= #39;beginning-of-buffer) ?

> Why not (defalias 'brief-end-of-= file #'end-of-buffer) ?

Nice, all of the above are followed, tha= nks!

>> +(defun brief-toggle-auto-backup ()
>> +=C2= =A0 "Toggle auto-backup on or off."
>> +=C2=A0 (interact= ive)
>> +=C2=A0 (message "Turn Emacs auto-backup %s"
= >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if = (setq auto-save-default (not auto-save-default))
>> +=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &q= uot;ON" "OFF")))
> You could use a minor mode, here:>
>=C2=A0=C2=A0=C2=A0 (define-minor-mode brief-auto-backup-mode<= br>>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Whether auto-backup is done&quo= t;
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :global t
>=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 :variable auto-save-default)

Wouldn't that becom= e more complicated as I still need to define
a function `brief-toggle-au= to-backup' to toggle it?

> Why not (defalias 'brief-open-= new-line-next #'open-line) ?

They're different, `brief-open-= new-line-next' shouldn't split
current line or it will be no dif= ferent than the <Enter> key.
I added a comment there.

Thank= s.

Best regards,
Luke Lee

Stefan Monnier <monnier@iro.umontreal.ca> =E6=96=BC 2018=E5=B9=B41= 0=E6=9C=8818=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D=8811:43=E5=AF=AB= =E9=81=93=EF=BC=9A
Hi Luke,

Thanks for working on Brief mode.=C2=A0 I have some comments on your patch,= tho.

> +BRIEFVERSION=3D${BRIEFVERSION-"5.86"}
[...]
> +=C2=A0 =C2=A0 BRIEFVERSION=C2=A0 =C2=A0 =C2=A0ELPA brief version, def= ault "5.86"

I'd recommend not to default to any specific version, because it's = very
likely that someone will end up bumping the "Version:" header in<= br> brief.el without realizing that it needs to be updated elsewhere.

Some with all the places where you say "5.86" in the README: bett= er
reword it such that it doesn't need to be updated when the version
number changes.

> +# Search for brief.el or brief.elc through default path list

Why not just assume that the `brief` package was properly installed,
and hence `emacs -l brief` will just work=E2=84=A2?

> +#!/bin/bash

Do you actually make use of bash-isms?=C2=A0 If so, can we avoid them
without too much extra work?=C2=A0 If not, we should say "/bin/sh"= ;.

> +exec ${EMACS} --load ${BRIEFPATH}/brief --eval \
> +"(progn \
> +=C2=A0 (setq-default truncate-lines t) \
> +=C2=A0 (setq scroll-step 1 \
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 scroll-conservatively 101) \
> +=C2=A0 (setq hscroll-margin 1 \
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 hscroll-step 1) \
> +=C2=A0 (scroll-bar-mode -1) \
> +=C2=A0 (brief-mode 1))" \
> +"${EMACSARGS[@]}"

Why are these (h)scroll settings here instead of adding them to
brief-mode?

If you want to keep `brief-mode` as a mode which doesn't impose
particular (h)scroll settings (which is probably a good idea, indeed),
then you could add a new function to brief.el and call that function
instead of `brief-mode`.

> diff --git a/packages/brief/b.el b/packages/brief/b.el
> new file mode 100644
> index 0000000..4a0ab6b
> --- /dev/null
> +++ b/packages/brief/b.el
> @@ -0,0 +1,9 @@
> +(setq-default truncate-lines t)
> +;;(setq-default global-visual-line-mode t)
> +(setq scroll-step 1
> +=C2=A0 =C2=A0 =C2=A0 scroll-conservatively 101)
> +(setq hscroll-margin 1
> +=C2=A0 =C2=A0 =C2=A0 hscroll-step 1)
> +(scroll-bar-mode -1)
> +(load "~/bin/elisp/brief/brief")
> +(brief-mode 1)

Several problems here:
- I don't see any place where this file is used.
- the chance that (load "~/bin/elisp/brief/brief") will work
=C2=A0 on the user's system is fairly slim.
- this file will be in the `load-path` so (load "b") will load it= and so
=C2=A0 will (require 'b).=C2=A0 I think we'd rather keep such short= names for more
=C2=A0 popular packages (like the `s` package).
- this Elisp file doesn't follow the convention that loading a file
=C2=A0 doesn't have significant effects (i.e. it just defines new vars = and
=C2=A0 functions).

> diff --git a/packages/brief/brief.el b/packages/brief/brief.el
> index 1dd3181..66d3790 100644
> --- a/packages/brief/brief.el
> +++ b/packages/brief/brief.el
> @@ -1,11 +1,11 @@
> -;;; brief.el --- Brief Editor Emulator
> +;;; brief.el --- Brief Editor Emulator (Brief Mode)

The Commentary says

=C2=A0 =C2=A0 ;; On Linux: (including native X11 Emacs, terminal mode Emacs= on xterm
=C2=A0 =C2=A0 ;;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 and Linux X11 Ema= cs running on VcXsrv (1.19.3.4+) under
=C2=A0 =C2=A0 ;;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Win10):
=C2=A0 =C2=A0 ;;=C2=A0 =C2=A0 =C2=A0 Emacs 23.3.1, 24.4.50.2, 25.2.2, 26.0.= 50, 26.1 and 27.0.50.

has 5.86 still been tested with all those Emacs versions?
Any chance you'd be willing to drop compatibility with Emacs-23 (which<= br> doesn't come with package.el)?

> +(defcustom brief-search-replace-using-regexp t
> +=C2=A0 "An option determine if search & replace using regula= r expression or string.
> +This is a buffer local variable with default value 't which means=
> +regular expression is used for search & replace commands by defau= lt."
> +=C2=A0 :type=C2=A0 'boolean
> +=C2=A0 :group 'brief)

The `:group 'brief` is redundant (it defaults to the last group defined=
in the same file).=C2=A0 Same applies to all other defcustoms.
Oh, and the docstring doesn't need to say "An option" ;-)

>=C2=A0 (defcustom brief-fake-region-face 'region ; 'secondary-s= election
>=C2=A0 =C2=A0 "The face (color) of fake region when `brief-search-= fake-region-mark' is t."
> -=C2=A0 :type=C2=A0 'boolean
> +=C2=A0 :type=C2=A0 'sexp
>=C2=A0 =C2=A0 :group 'brief)

You probably want `:type 'face` here.

> +(defvar-local brief-search-overlay nil
> +=C2=A0 "A buffer local overlay which records the current search = selection.
> +It is deleted when the search ends or region deactivated.")

It should probably use a "--" in the name.

>=C2=A0 (defvar brief-latest-killed-buffer-info nil
> -=C2=A0 "This variable records the info of the most recently kill= ed file
> -buffer.=C2=A0 If user accidentally killed a file buffer, it can be > -recovered accordingly.
> +=C2=A0 "This variable records the info of the most recently kill= ed file buffer.
> +If user accidentally killed a file buffer, it can be recovered
> +accordingly.
>=C2=A0 Information is a list of:

As above, the docstring doesn't need to say "This variable records= ".

> +(defmacro brief-meta-l-key (updown key)
> +=C2=A0 "Define key function and associated the key in `brief-pre= fix-meta-l'."
> +=C2=A0 (let* ((dir=C2=A0 =C2=A0 =C2=A0(symbol-name updown))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(keydesc (key-description key))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(keyfunc (intern (concat "brie= f-mark-line-" dir "-with-" keydesc))))
> +=C2=A0 =C2=A0 `(progn
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(defun ,keyfunc ()
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0,(concat "Mark line " dir= " with " keydesc " key")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(interactive)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(,(intern (concat "brief-call-= mark-line-" dir "-with-key"))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ,key))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(define-key brief-prefix-meta-l ,key '= ,keyfunc))))

This macro name and docstring makes it sound like it works for anything
one might want to have under the M-l prefix, yet the code seems to
limit this to those few operations named
brief-call-mark-line-*-with-key, so it's much more focused than announc= ed.

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (call-interactively
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'(lambda (filename)

Please don't quote your lambdas.

> +=C2=A0 (let* (c1
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(p1 (save-excursion
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end-of-visual= -line)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq c1 (foll= owing-char)) (point)))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(p2 (save-excursion
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end-of-line) = (point)))) ;; `end-of-line' of course is at crlf

I think you can turn this into:

=C2=A0 =C2=A0 (let* ((p1 (save-excursion
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end-of-visua= l-line)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(point)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(c1 (char-after p1))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(p2 (line-end-position))) ;; `end-= of-line' of course is at crlf

> +(defun brief-toggle-auto-backup ()
> +=C2=A0 "Toggle auto-backup on or off."
> +=C2=A0 (interactive)
> +=C2=A0 (message "Turn Emacs auto-backup %s"
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (setq auto-save-default = (not auto-save-default))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"ON"= "OFF")))

You could use a minor mode, here:

=C2=A0 =C2=A0 (define-minor-mode brief-auto-backup-mode
=C2=A0 =C2=A0 =C2=A0 "Whether auto-backup is done"
=C2=A0 =C2=A0 =C2=A0 :global t
=C2=A0 =C2=A0 =C2=A0 :variable auto-save-default)

> +(defun brief-beginning-of-file ()
> +=C2=A0 "Goto beginning of file."
> +=C2=A0 (interactive "^")
> +=C2=A0 (goto-char (point-min)))

Why not (defalias 'brief-beginning-of-file #'beginning-of-buffer) ?=

> +(defun brief-end-of-file ()
> +=C2=A0 "Goto end of file."
> +=C2=A0 (interactive "^")
> +=C2=A0 (goto-char (point-max)))

Why not (defalias 'brief-end-of-file #'end-of-buffer) ?

> +(defun brief-open-new-line-next ()
> +=C2=A0 "Open a new line right below the current line and go ther= e."
> +=C2=A0 (interactive)
> +=C2=A0 (move-end-of-line 1)
> +=C2=A0 (newline))

Why not (defalias 'brief-open-new-line-next #'open-line) ?


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


--
Best regards,
Luke L= ee

--00000000000036b399057896d57d--