From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] 11 new packages! Date: Fri, 25 Nov 2022 19:07:53 +0000 Message-ID: <87v8n2zwc6.fsf@posteo.net> References: <87r0y6ug9z.fsf@disroot.org> <87y1sct2hp.fsf@posteo.net> <87k03vf5m8.fsf@disroot.org> <87edu2narn.fsf@posteo.net> <8735aieqtr.fsf@disroot.org> <87cz9mlq3o.fsf@posteo.net> <875yfdd5ad.fsf@disroot.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11972"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Developer List To: Akib Azmain Turja Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 25 20:08:35 2022 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 1oye3v-0002uQ-2m for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 20:08:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oye3N-0006qW-JG; Fri, 25 Nov 2022 14:08:01 -0500 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 1oye3L-0006qH-MM for emacs-devel@gnu.org; Fri, 25 Nov 2022 14:07:59 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oye3J-0007sb-4q for emacs-devel@gnu.org; Fri, 25 Nov 2022 14:07:59 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7FA03240104 for ; Fri, 25 Nov 2022 20:07:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1669403273; bh=p/5rNn1ayaw3OJ0xPzms+JGvW5loRYBufjJR7MOyBv4=; h=From:To:Cc:Subject:Date:From; b=J8XEuhJd6SoW87xo74VivL2m8oa+rrqxLVhn2oyTNGZNAFCweQleioLDnmR3fG6fr 4Q0FbEI/2OymdUDrOTgkXSYtw1Expz6dY0KRq3Vcbqq+HOsUE+7MdLmQL0VsXAvFOZ eIYtfkiQOGfJvHkp+nkt5+B/kkdz83yjfZm+CAEHBi9o1a0JQHUnOZWke7mmJ4C8bF iOMa729AG57tBIjB9HmWO4kaP4OfzY7hP8DgUi8pALc2QKsUb8NYX0MGBTp22mxvcV ibOfoVe9/dydIU0zL6bOzu6KGxd37n9S+e9IoI9/aH6Md3OlXxE30P14SCjX5+LJvL 0C1qssxJXYnyg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NJks451lxz6tp0; Fri, 25 Nov 2022 20:07:52 +0100 (CET) In-Reply-To: <875yfdd5ad.fsf@disroot.org> (Akib Azmain Turja's message of "Thu, 17 Nov 2022 20:28:10 +0600") Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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:300509 Archived-At: --=-=-= Content-Type: text/plain Akib Azmain Turja writes: > Philip Kaludercic writes: > >>>> OK, then adding them to NonGNU ELPA seems like the safer bet. >>>> >>>> I'd like to add them, but I'll have to take the time to review them >>>> first, which might take a bit. >>> >>> What do you want to review? The patches, or the packages? >> >> The packages, unless you aren't interested in comments. > > Review if you wish, I welcome feedback. Few more comments: gnu-indent: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=comments.diff diff --git a/gnu-indent.el b/gnu-indent.el index 1a37851e96..8aea4161dc 100644 --- a/gnu-indent.el +++ b/gnu-indent.el @@ -51,18 +51,17 @@ ;; Autoload so that users can set it as file local variable without ;; warning. ;;;###autoload -(progn - (defcustom gnu-indent-options nil - "Arguments to pass to GNU Indent." - :type '(repeat string) - :safe (lambda (val) - (let ((valid t)) - (while (and valid val) - (unless (stringp (car val)) - (setq valid nil)) - (setq val (cdr val))) - valid)) - :group 'gnu-indent)) +(defcustom gnu-indent-options nil + "Arguments to pass to GNU Indent." + :type '(repeat string) + :safe (lambda (val) + (let ((valid t)) + (while (and valid val) + (unless (stringp (car val)) + (setq valid nil)) + (setq val (cdr val))) + valid)) + :group 'gnu-indent) ;;;###autoload (defun gnu-indent-region (beg end) @@ -88,14 +87,15 @@ When called non-interactively, indent text between BEG and END." (send-region process beg end) (process-send-eof process) (redisplay) - (while (process-live-p process) - (sleep-for 0.01)) + (while (accept-process-output process nil 10)) (unless (eq (process-exit-status process) 0) - (display-buffer (process-buffer process)) + (pop-to-buffer (process-buffer process)) (error "GNU Indent exited with non-zero status")) (save-restriction (let ((inhibit-read-only t)) (narrow-to-region beg end) + ;; Perhaps something should be done to try an preserve + ;; the point after indentation? (insert-file-contents temp-file nil nil nil t)))) (delete-file temp-file))) @@ -108,11 +108,24 @@ When called non-interactively, indent text between BEG and END." (interactive) (gnu-indent-region (point-min) (point-max))) +;; A little suggestion +;;;###autoload +(defun gnu-indent-defun-or-fill (arg) + "Indent current function with GNU Indent. +If point is in a comment, call `fill-paragraph' instead. A +prefix argument ARG is passed to `fill-paragraph'." + (interactive "P") + (if (nth 8 (syntax-ppss)) ;if in a comment + (fill-paragraph arg) + (let ((bounds (bounds-of-thing-at-point 'defun))) + (if (consp bounds) + (gnu-indent-region (car bounds) (cdr bounds)) + (user-error "No defun at point"))))) + ;;;###autoload (define-minor-mode gnu-indent-mode "Indent buffer automatically with GNU Indent." :lighter " GNU-Indent" - :keymap nil (if gnu-indent-mode (add-hook 'before-save-hook #'gnu-indent-buffer nil t) (remove-hook 'before-save-hook #'gnu-indent-buffer t))) --=-=-= Content-Type: text/plain devhelp: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=comments.diff diff --git a/devhelp.el b/devhelp.el index 6b3d9a1ce9..05aeb1e18e 100644 --- a/devhelp.el +++ b/devhelp.el @@ -48,6 +48,10 @@ ;; "~/.guix-profile/share/doc/" ;; "~/.guix-profile/share/gtk-doc/html/")) +;; Do you think it makes sense to automatically detect this (if the +;; user has a ~/.guix-profile directory) and make the changes to the +;; default value? + ;; You can also bookmark pages, with the standard `bookmark-set' function. ;;; Code: @@ -89,7 +93,7 @@ Integer means use that many columns. Nil means use full window width." Note that on GNU Guix, Nix or other FHS (Filesystem Hierarchy Standard) non-compliant distributions, the default value won't work. For GNU Guix, -set it to '(\"/run/current-system/profile/share/doc/\" +set it to \\='(\"/run/current-system/profile/share/doc/\" \"/run/current-system/profile/share/gtk-doc/html/\" \"~/.guix-profile/share/doc/\" \"~/.guix-profile/share/gtk-doc/html/\")." :type '(repeat directory)) @@ -147,6 +151,7 @@ absolute path to it." ,(expand-file-name (dom-attr sec 'link) base) ,(mapcar #'process-section (children-by-tag sec 'sub))))) + ;; `List' would be better here, right? `(,(or (dom-attr dom 'title) "Untitled") ,(or (dom-attr dom 'name) (file-name-base file)) ,(or (dom-attr dom 'language) "any") @@ -219,6 +224,7 @@ If a single file was opened, only show that book's table of contents." See `devhelp-toc' for more details." (let ((inhibit-read-only t)) (erase-buffer) + ;; Why not prepare the document in SXML and then use `dom-print'? (insert "Table of contents
    " (let ((book-tocs @@ -447,6 +453,8 @@ When BASE is given, use it to make relative URLs absolute." (recenter))) (defun devhelp-history-back (&optional n) + ;; Is the variable actually optional, or won't the + raise a wrong + ;; type signal if invoked without an argument? "Go to the previous page. When prefix argument N is given, go to Nth previous page." --=-=-= Content-Type: text/plain why-this: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=comments.diff diff --git a/why-this.el b/why-this.el index 287ee99921..19acb90f9f 100644 --- a/why-this.el +++ b/why-this.el @@ -36,6 +36,10 @@ (require 'timezone) (require 'color) +;; A very high-level request that would probably take too much work to +;; actualise, would be to figure out some way to integrate this into +;; VC. That way you can make use of this even if you don't use Git or Hg. + (defgroup why-this nil "Show why the current line contains this." :group 'tools @@ -64,6 +68,7 @@ the first argument is the command (which is a symbol): `:author' Name of the author. `:time' Time of change (local). `:desc' Single line description of change." + ;; Would it make sense to use a `cl-defstruct'? :type 'hook :options (list #'why-this-git #'why-this-hg) @@ -326,6 +331,7 @@ TIME-FORMAT is used to format data." (?t . (why-this-format-time time-format (plist-get data :time))) (?i . (plist-get data :desc))))) + ;; `format-spec' should make this simpler (replace-regexp-in-string "%." (lambda (str) @@ -342,7 +348,7 @@ TIME-FORMAT is used to format data." (defun why-this--overlay-bg-type (pos) "Return the background type for overlay at POS." (cond - ((and (use-region-p) + ((and (use-region-p) ;perhaps `region-active-p'? (>= pos (region-beginning)) (< pos (region-end))) 'region) @@ -364,6 +370,7 @@ TIME-FORMAT is used to format data." 'solaire-region-face 'region)) ('line + ;; Looks like a `cond' to me (if (bound-and-true-p hl-line-mode) (if (bound-and-true-p solaire-mode) 'solaire-hl-line-face @@ -382,12 +389,10 @@ TIME-FORMAT is used to format data." (while why-this--overlays (delete-overlay (pop why-this--overlays))) (when why-this-mode - (let* ((begin (line-number-at-pos (if (use-region-p) - (region-beginning) - (point)))) - (end (1+ (line-number-at-pos (if (use-region-p) - (region-end) - (point))))) + (let* ((line (line-number-at-pos (if (use-region-p) + (region-beginning) + (point)))) + (begin line) (end (1+ line)) (backend why-this--backend) (data (funcall backend 'line-data begin end))) (dolist (i (number-sequence 0 (- end begin 1))) @@ -446,6 +451,8 @@ TIME-FORMAT is used to format data." (region-end) (point)))))) (setq + ;; Perhaps this could be made more readble by using + ;; `thread-last' or the above let binding why-this--overlays (delq nil @@ -458,10 +465,10 @@ TIME-FORMAT is used to format data." (< line end) (eq line (overlay-get ov 'why-this-line))))) (progn - (let* ((ov-start (overlay-start ov)) - line-begin - line-end - column) + (let ((ov-start (overlay-start ov)) + line-begin + line-end + column) (save-excursion (goto-char ov-start) (setq line-begin (line-beginning-position)) @@ -537,6 +544,11 @@ Actually the supported backend is returned." (* (- (nth i b-color) (nth i a-color)) ratio))))) + ;; Note that RGB interpolation doesn't always behave the way you + ;; think it does. You'd have to convert it into some other color + ;; space like CIELAB to get perceptual mixing right (but even that + ;; is trying because it requires some kind of a white-reference + ;; point). (color-rgb-to-hex (funcall mix 0) (funcall mix 1) (funcall mix 2) --=-=-= Content-Type: text/plain A general comment might be that adding a .dir-locals.el file that regulates Emcas' whitespace behaviour would be nice to have. Also, I don't think you need to distribute the texinfo.tex files with your packages, or at the least you could mark them as ignorable in the .elpaignore file. --=-=-=--