From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Changes to make in elpa-packages file for nongnu elpa Date: Tue, 08 Aug 2023 04:33:35 +0000 Message-ID: <87wmy6kuan.fsf@posteo.net> References: <87r0oftgye.fsf@posteo.net> <87350vt1wz.fsf@posteo.net> <871qgen1ln.fsf@posteo.net> <87edke4mou.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29233"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 08 06:56:35 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qTEln-0007RR-KL for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Aug 2023 06:56:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTEkZ-0000Ip-Rf; Tue, 08 Aug 2023 00:55:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTEkL-0000GS-PM for emacs-devel@gnu.org; Tue, 08 Aug 2023 00:55:08 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTEkI-0008FX-TF for emacs-devel@gnu.org; Tue, 08 Aug 2023 00:55:05 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 84F01240027 for ; Tue, 8 Aug 2023 06:55:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1691470500; bh=2otwDGNqI48NfwjbytVmqjzFt6BgwyhOb5Fx4wj63h0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=G3ffhW620q1oGhL653ZatyJ+pGOROeHAYEDk4Dzjbn/tqsbfXaDm//OPK2d75/W2B /dctzcR5D1qiziyXP4X8d6qtUkeBVqpsRMnAclVD09UJOok2X7XhhoN7Ix0Ohe2Ke6 VxZlXREM/kma02cRUmoeAXtcDinmAEsdem7OsGHA23kUI08sirGZdsdHZdZ2785c4E kxbH8hHKEQiHjGmLGpKC4/pt6QkxyPz+XeIOf2wKlUht4Dn/n8Wrw+FD8is6j6G4hW xTxIwIsbPK2ZJ9zWnvc7abFwV8EFJi42YsjmtdoKWwYkhjBb1lDiBu16CY0BgybcO2 /2xGjBBReLHNA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RKgpp4NTjz6twQ; Tue, 8 Aug 2023 06:54:58 +0200 (CEST) In-reply-to: <87edke4mou.fsf@posteo.net> Received-SPF: pass client-ip=185.67.36.65; envelope-from=thievol@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308430 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello Philip, Philip Kaludercic writes: > Thierry Volpiatto writes: > >> Philip Kaludercic writes: >> >>> Thierry Volpiatto writes: >>> >>>> I see that Helm installation from nongnu elpa doesn't include >>>> emacs-helm.sh script, would it be possible to modify this? >>>> >>>> diff --git a/elpa-packages b/elpa-packages >>>> index 77d7a5409e..0923724b62 100644 >>>> --- a/elpa-packages >>>> +++ b/elpa-packages >>>> @@ -312,11 +312,11 @@ >>>> :ignored-files "COPYING") >>>>=20=20=20=20=20=20=20=20=20=20 >>>> (helm :url "https://github.com/emacs-helm/helm" >>>> - :ignored-files ("images" "Cask" "Makefile" "emacs-helm.sh" = "helm-core.el" "helm.el" >>>> + :ignored-files ("images" "Makefile" "helm-core.el" "helm.el" >>>> "helm-lib.el" "helm-source.el" "helm-multi-match.el")) >>>>=20=20=20=20=20=20=20=20=20=20 >>>> (helm-core :url "https://github.com/emacs-helm/helm" >>>> - :ignored-files ("images" "Cask" "Makefile" "emacs-helm.sh" = "helm-adaptive.el" >>>> + :ignored-files ("images" "Makefile" "emacs-helm.sh" "helm-a= daptive.el" >>>> "helm-bookmark.el" "helm-buffers.el" "helm-color.el" "hel= m-comint.el" >>>> "helm-command.el" "helm-config.el" "helm-dabbrev.el" "hel= m-easymenu.el" >>>> "helm-elisp.el" "helm-elisp-package.el" "helm-epa.el" "he= lm-eshell.el" >>> >>> There shouldn't be any issue in applying this patch, but could you >>> explain the propose of this script? >> >> It is used specially for reproducing bugs in a clean environment, see it >> as emacs -Q for Emacs when reporting bugs. This script starts Emacs -Q >> with only Helm loaded, this ensure the bug if one comes from Helm and >> not another package. This is important especially nowaday people are >> using "Emacs distribution" with the world list of packages installed. >> Apart that the script is useful to quickly launch Emacs with helm, one >> can use it from the Helm directory or symlinked to e.g. ~/bin.=20 > > I see. In that case is there any reason you implement this as a shell > script? Well when I wrote the script, packages where not existing and from outside emacs it is actually the only way to run a package isolated. > (It might be interesting to provide something like this for > package.el, to test packages in a generic way.) Yes, this would be interesting, it would be something like this: Emacs -Q M-x > I am sort of an unofficial co-maintainer, without access to any > server-side infrastructure, but other than that I'm glad to help within > my possibilities. Ok thanks. >> Ok, it's what I thought, so yes it would be nice to install wfnames >> package in Nongnu. >> Here is the link: https://github.com/thierryvolpiatto/wfnames > > Sure, but could you first take a look at these comments, suggestions and > questions I have made while skimming over the source? > > diff --git a/wfnames.el b/wfnames.el > index e5a83b5..a61a18d 100644 > --- a/wfnames.el > +++ b/wfnames.el > @@ -34,20 +34,20 @@ >=20=20 > ;; Usage: > ;; Once in the Wfnames buffer, edit your filenames and hit C-c C-c to > -;; save your changes. You have completion on filenames and directories > +;; save your changes. You have completion on filenames and directories > ;; with TAB but if you are using Iedit package and it is in action use = =3DM-TAB=3D. >=20=20 > ;;; Code: >=20=20 > -(require 'cl-lib) > +(eval-when-compile (require 'cl-lib)) ;you are only using macros, so thi= s should be OK Ok done. =20=20 > ;; Internal. > -(defvar wfnames-buffer "*Wfnames*") > -(defvar wfnames--modified nil) > +(defvar wfnames-buffer "*Wfnames*") ;perhaps `defconst' > +(defvar-local wfnames--modified nil) Ok done. > > (defgroup wfnames nil > "A mode to edit filenames." > - :group 'wfnames) > + :group 'wfnames) ;watch out, this is a recursive group Good catch, done. > (defcustom wfnames-create-parent-directories t > "Create parent directories when non nil." > @@ -57,16 +57,21 @@ > "Ask confirmation when overwriting." > :type 'boolean) >=20=20 > -(defvar wfnames-after-commit-hook nil) > +(defcustom wfnames-after-commit-hook nil > + "Hook to run after `wfnames-commit-buffer'." ;rephrase this Not sure how to rephrase this: "Hook that run after `wfnames-commit-buffer'."? >=20 > + :type 'hook) Othewise defcustom make sense, done. > (defcustom wfnames-after-commit-function #'kill-buffer > "A function to call on `wfnames-buffer' when done." > :type 'function) >=20=20 > (defcustom wfnames-make-backup nil > - "Backup files before overwriting when non nil." > + "Non-nil means files are backed up before overwriting." Ok done. >=20 > :type 'boolean) > > +;; instead of defining new faces and colours, do you think it would be > +;; possible to inherit from existing faces? Apart requiring a package just for the faces no, font-lock family doesn't provide :background faces. > (defface wfnames-modified > '((t :background "LightBlue" :foreground "black")) > "Face used when filename is modified.") > @@ -104,27 +109,27 @@ > "Provide filename completion in wfnames buffer." > (let ((beg (line-beginning-position)) > (end (point))) > + ;; Does it make sense to extend beyond END to allow completing > + ;; file names mid-string? This one for now I don't know, I transformed your comment with a FIXME. >=20 > (list beg end #'completion-file-name-table :exit-function (lambda > (str _status) (when (and (stringp str) (eq (char-after) ?/)) > (delete-char -1)))))) >=20=20 > -(define-derived-mode wfnames-mode > - text-mode "wfnames" > +(define-derived-mode wfnames-mode text-mode "wfnames" > "Major mode to edit filenames. Ok. > Special commands: > \\{wfnames-mode-map}" > (add-hook 'after-change-functions #'wfnames-after-change-hook nil t) > - (make-local-variable 'wfnames--modified) > - (set (make-local-variable 'completion-at-point-functions) #'wfnames-ca= pf) > - (set (make-local-variable 'revert-buffer-function) #'wfnames-revert-ch= anges)) > + (setq-local completion-at-point-functions #'wfnames-capf) > + (setq-local revert-buffer-function #'wfnames-revert-changes)) Yes done. =20=20 > (defun wfnames-abort () > "Quit and kill wfnames buffer." > (interactive) > - (quit-window t)) > + (quit-window t)) ;isn't this `kill-buffer-and-window' Yes, but quit-window is fine as well (I am used to it). =20=20 > (defun wfnames-after-change-hook (beg end _len) > "Put overlay on current line when modified. > @@ -137,9 +142,10 @@ Args BEG and END delimit changes on line." > (eol (line-end-position)) > (old (get-text-property bol 'old-name)) > (new (buffer-substring-no-properties bol eol)) > - ov face) > - (setq face (if (file-exists-p new) > - 'wfnames-modified-exists 'wfnames-modified)) > + (face (if (file-exists-p new) > + 'wfnames-modified-exists > + 'wfnames-modified)) > + ov) Ok. > (setq-local wfnames--modified > (cons old (delete old wfnames--modified))) > (cl-loop for o in (overlays-in bol eol) > @@ -184,10 +190,10 @@ When APPEND is specified, append FILES to existing = `wfnames-buffer'." > "* " > 'face 'wfnames-prefix)) > "\n")) > - (when append (delete-duplicate-lines (point-min) (point-max)))) > + (when append (delete-duplicate-lines (point-min) (point-max)))) ;t= his requires Emacs 24.4 > (unless append > ;; Go to beginning of basename on first line. > - (while (re-search-forward "/" (line-end-position) t)) > + (re-search-forward "\\(?:/[^/]*\\)*/" (line-end-position) t) Ok. > (wfnames-mode) > (funcall display-fn wfnames-buffer)))) > > @@ -202,7 +208,7 @@ When APPEND is specified, append FILES to existing `w= fnames-buffer'." > "Backup FILE." > (when wfnames-make-backup > (with-current-buffer (find-file-noselect file) > - (let ((backup-by-copying t)) > + (let ((backup-by-copying t)) ;why is this bound? isn't this > a user preference? Yes removed. >=20 > (backup-buffer)) (kill-buffer)))) >=20=20 > @@ -252,7 +258,7 @@ When APPEND is specified, append FILES to existing `w= fnames-buffer'." > (let ((basedir (file-name-directory > (directory-file-name = new)))) > (unless (file-directory-p basedir) > - (mkdir basedir 'parents)))) > + (make-directory basedir > 'parents)))) Ok, make sense. > (if (and ow (wfnames-ask-for-overwrite = new)) > ;; Direct overwrite i.e. first loop. > (progn > @@ -300,21 +306,22 @@ With a numeric prefix ARG, revert the ARG next line= s." > (wfnames-revert-current-line-1) > (when (eobp) (forward-line -1)) > (goto-char (line-beginning-position)) > - (while (re-search-forward "/" (line-end-position) t)))) > + (re-search-forward "\\(?:/[^/]*\\)*/" (line-end-position) t))) Ok, same as above. =20=20 > (defun wfnames-revert-changes (_ignore-auto _no-confirm) > "Revert wfnames buffer to its initial state. >=20=20 > This is used as `revert-buffer-function' for `wfnames-mode'." > (with-current-buffer wfnames-buffer > - (cl-loop for o in (overlays-in (point-min) (point-max)) > - when (overlay-get o 'hff-changed) > - do (delete-overlay o)) > + (dolist (o (overlays-in (point-min) (point-max))) > + (when (overlay-get o 'hff-changed) > + (delete-overlay o))) If you want ;-) done. > (goto-char (point-min)) > (save-excursion > (while (not (eobp)) > (wfnames-revert-current-line-1))) > - (while (re-search-forward "/" (line-end-position) t)))) > + (re-search-forward "\\(?:/[^/]*\\)*/" (line-end-position) t))) > + Ok same as above. =20=20 > (provide 'wfnames) >=20=20 > > >> Thanks. Thanks. =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmTRyqATHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk2BXC/93c6ercbsQrAuMaXJ16uAfhNuk3e+/ m1pyY+7fFjBM5VSnM/UFwMIaotLUaFWK9Myhrtq4k95f3LtiR8fX3gOUfGrknoWO dW88ypmqb+zBQ7whUtSyiXZQ4as6XGLo5DYRQyIa3jbRwunzIXaPSo1XVCigxNVe NU9AezNTFtE/K2wxeCYK01nC2Goq7crRvlmAie8zy3FzmAPXrTEWefeUcQayosMw m+ajQP3+RjFEXWE/3TRYGKR28dyRX6wE320sBftMhITULX+cFCs+bWla817OLUs+ 0qH3b4vwu8LR/FbFZN01SLBkUXQIkh18GR/0ytyFYCFXAZqqKtR7Q13dfH4/VDuB NpYCV+odA0cRjOOKkR4C8GVH2OZaM4qZS8L/Mk8dH/QTlkToE08RJggk5n8eXVTb BzUalRzJ6qmnupdTreQkNyt15wJb4QmxjZisUAoa6dIbtzHGOVMLx+o2ZlBhG95q DiO4B5p6K1WTSiCybrTQMBGBV0rqcppjZko= =PhrU -----END PGP SIGNATURE----- --=-=-=--