Philip Kaludercic writes: [...] > > gnu-indent: > > 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) Done. > > ;;;###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)) MILLISEC argument is obsolete, I used SECONDS instead. > (unless (eq (process-exit-status process) 0) > - (display-buffer (process-buffer process)) > + (pop-to-buffer (process-buffer process)) Done. > (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)))) On my computer, the point doesn't move relative to text, because the fifth argument to insert-file-contents is 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"))))) > + Great idea. But would it cause problem to assign copyright if I take your change? (AFAIK you've completed paperwork, but in this case you're not contributing to FSF-copyrighted code, so is this change covered by your paperwork? Right now, no, you're the copyright holder. (According to Section 2 of copyright assignment agreement sent to me.)) > ;;;###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))) Done. > > > devhelp: > > 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? > + Yes, it makes sense. But I didn't find any way to detected the directories, except heuristics. > ;; 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/\" Done. > \"/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") Yes. Change done. > @@ -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