Re: [PATCH 02/23] emacs: Remove excess empty lines
Tomi Ollila writes: > On Sun, Jul 26 2020, Jonas Bernoulli wrote: >> ;; Outer single and double quotes, which might be nested. >> (cl-loop with start-of-loop >> - do (setq start-of-loop p-name) >> - >> + do (setq start-of-loop p-name) >> when (string-match "^\"\\(.*\\)\"$" p-name) >> - do (setq p-name (match-string 1 p-name)) >> - >> + do (setq p-name (match-string 1 p-name)) >> when (string-match "^'\\(.*\\)'$" p-name) >> - do (setq p-name (match-string 1 p-name)) >> - >> + do (setq p-name (match-string 1 p-name)) >> until (string= start-of-loop p-name))) > These changes in spaces after `do` I don't understand... IMO it looks a bit better when aligned with the `when' lines. Since these lines alternate with the lines that I modified because of the stated reason of this commit, I felt that it was appropriate to make this change as well. But the alignment is an improvement is subjective and I would be happy to change this. I don't feel strongly about it. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH 02/23] emacs: Remove excess empty lines
On Sun, Jul 26 2020, Jonas Bernoulli wrote: > Most people who write lots of lisp tend to only sparsely use empty > "separator" lines within forms. In lisp they feel unnecessary and > since most files stick to this convention we get a bit confused > when there are extra empty lines. It feels like the s-expressions > are falling into pieces. > > All of this is especially true between a function's doc-string and > body because the doc-string is colored differently, which visually > already separates it quite sufficiently from the code that follows. > --- > emacs/make-deps.el | 2 - > emacs/notmuch-address.el | 2 - > emacs/notmuch-crypto.el | 4 -- > emacs/notmuch-hello.el | 18 - > emacs/notmuch-jump.el| 5 --- > emacs/notmuch-lib.el | 10 - > emacs/notmuch-maildir-fcc.el | 7 > emacs/notmuch-mua.el | 26 - > emacs/notmuch-parser.el | 5 --- > emacs/notmuch-show.el| 75 ++-- > emacs/notmuch-tag.el | 3 -- > emacs/notmuch-tree.el| 9 - > emacs/notmuch-wash.el| 18 + > emacs/notmuch.el | 7 > 14 files changed, 5 insertions(+), 186 deletions(-) > > diff --git a/emacs/make-deps.el b/emacs/make-deps.el > index 5b6db698..dcac319c 100644 > --- a/emacs/make-deps.el > +++ b/emacs/make-deps.el > @@ -23,7 +23,6 @@ > > (defun batch-make-deps () >"Invoke `make-deps' for each file on the command line." > - >(setq debug-on-error t) >(dolist (file command-line-args-left) > (let ((default-directory command-line-default-directory)) > @@ -37,7 +36,6 @@ (defun make-deps (&optional dir) > This prints make dependencies to `standard-output' based on the > top-level `require' expressions in the current buffer. Paths in > rules will be given relative to DIR, or `default-directory'." > - >(setq dir (or dir default-directory)) >(save-excursion > (goto-char (point-min)) > diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el > index 2a9c411a..ca4da3f3 100644 > --- a/emacs/notmuch-address.el > +++ b/emacs/notmuch-address.el > @@ -302,7 +302,6 @@ (defun notmuch-address-harvest (&optional addr-prefix > synchronous callback) > Address harvesting may take some time so the address collection runs > asynchronously unless SYNCHRONOUS is t. In case of asynchronous > execution, CALLBACK is called when harvesting finishes." > - >(let* ((sent (eq (car notmuch-address-internal-completion) 'sent)) >(config-query (cadr notmuch-address-internal-completion)) >(prefix-query (when addr-prefix > @@ -335,7 +334,6 @@ (defun notmuch-address-harvest (&optional addr-prefix > synchronous callback) > ;; Kill any existing process > (when current-proc > (kill-buffer (process-buffer current-proc))) ; this also kills the > process > - > (setq current-proc > (apply 'notmuch-start-notmuch proc-name proc-buf >callback ; process sentinel > diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el > index 2327ff1f..58947a20 100644 > --- a/emacs/notmuch-crypto.el > +++ b/emacs/notmuch-crypto.el > @@ -123,17 +123,14 @@ (defun notmuch-crypto-insert-sigstatus-button > (sigstatus from) > face 'notmuch-crypto-signature-good-key)) > (setq button-action 'notmuch-crypto-sigstatus-good-callback > help-msg (concat "Click to list key ID 0x" fingerprint "." > - > ((string= status "error") >(setq label (concat "Unknown key ID " keyid " or unsupported > algorithm") > button-action 'notmuch-crypto-sigstatus-error-callback > help-msg (concat "Click to retrieve key ID " keyid >" from keyserver."))) > - > ((string= status "bad") >(setq label (concat "Bad signature (claimed key ID " keyid ")") > face 'notmuch-crypto-signature-bad)) > - > (status >(setq label (concat "Unknown signature status: " status))) > (t > @@ -232,7 +229,6 @@ (defun notmuch-crypto-sigstatus-error-callback (button) > (process-put p :notmuch-show-buffer (current-buffer)) > (process-put p :notmuch-show-point (point)) > (message "Getting the GPG key %s asynchronously..." keyid))) > - >(let ((window (display-buffer buffer))) > (with-selected-window window > (with-current-buffer buffer > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index 11c625ea..e71e55f3 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -150,7 +150,6 @@ (defcustom notmuch-saved-searches > ;; The saved-search format is also used by the all-tags notmuch-hello > ;; section. This section generates its own saved-search list in one of > ;; the latter two forms. > - >:get 'notmuch-hello--saved-searches-to-plist >:type '(repeat notmuch-saved-search-plist) >:tag "List of
[PATCH 02/23] emacs: Remove excess empty lines
Most people who write lots of lisp tend to only sparsely use empty "separator" lines within forms. In lisp they feel unnecessary and since most files stick to this convention we get a bit confused when there are extra empty lines. It feels like the s-expressions are falling into pieces. All of this is especially true between a function's doc-string and body because the doc-string is colored differently, which visually already separates it quite sufficiently from the code that follows. --- emacs/make-deps.el | 2 - emacs/notmuch-address.el | 2 - emacs/notmuch-crypto.el | 4 -- emacs/notmuch-hello.el | 18 - emacs/notmuch-jump.el| 5 --- emacs/notmuch-lib.el | 10 - emacs/notmuch-maildir-fcc.el | 7 emacs/notmuch-mua.el | 26 - emacs/notmuch-parser.el | 5 --- emacs/notmuch-show.el| 75 ++-- emacs/notmuch-tag.el | 3 -- emacs/notmuch-tree.el| 9 - emacs/notmuch-wash.el| 18 + emacs/notmuch.el | 7 14 files changed, 5 insertions(+), 186 deletions(-) diff --git a/emacs/make-deps.el b/emacs/make-deps.el index 5b6db698..dcac319c 100644 --- a/emacs/make-deps.el +++ b/emacs/make-deps.el @@ -23,7 +23,6 @@ (defun batch-make-deps () "Invoke `make-deps' for each file on the command line." - (setq debug-on-error t) (dolist (file command-line-args-left) (let ((default-directory command-line-default-directory)) @@ -37,7 +36,6 @@ (defun make-deps (&optional dir) This prints make dependencies to `standard-output' based on the top-level `require' expressions in the current buffer. Paths in rules will be given relative to DIR, or `default-directory'." - (setq dir (or dir default-directory)) (save-excursion (goto-char (point-min)) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 2a9c411a..ca4da3f3 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -302,7 +302,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback) Address harvesting may take some time so the address collection runs asynchronously unless SYNCHRONOUS is t. In case of asynchronous execution, CALLBACK is called when harvesting finishes." - (let* ((sent (eq (car notmuch-address-internal-completion) 'sent)) (config-query (cadr notmuch-address-internal-completion)) (prefix-query (when addr-prefix @@ -335,7 +334,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback) ;; Kill any existing process (when current-proc (kill-buffer (process-buffer current-proc))) ; this also kills the process - (setq current-proc (apply 'notmuch-start-notmuch proc-name proc-buf callback ; process sentinel diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index 2327ff1f..58947a20 100644 --- a/emacs/notmuch-crypto.el +++ b/emacs/notmuch-crypto.el @@ -123,17 +123,14 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from) face 'notmuch-crypto-signature-good-key)) (setq button-action 'notmuch-crypto-sigstatus-good-callback help-msg (concat "Click to list key ID 0x" fingerprint "." - ((string= status "error") (setq label (concat "Unknown key ID " keyid " or unsupported algorithm") button-action 'notmuch-crypto-sigstatus-error-callback help-msg (concat "Click to retrieve key ID " keyid " from keyserver."))) - ((string= status "bad") (setq label (concat "Bad signature (claimed key ID " keyid ")") face 'notmuch-crypto-signature-bad)) - (status (setq label (concat "Unknown signature status: " status))) (t @@ -232,7 +229,6 @@ (defun notmuch-crypto-sigstatus-error-callback (button) (process-put p :notmuch-show-buffer (current-buffer)) (process-put p :notmuch-show-point (point)) (message "Getting the GPG key %s asynchronously..." keyid))) - (let ((window (display-buffer buffer))) (with-selected-window window (with-current-buffer buffer diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 11c625ea..e71e55f3 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -150,7 +150,6 @@ (defcustom notmuch-saved-searches ;; The saved-search format is also used by the all-tags notmuch-hello ;; section. This section generates its own saved-search list in one of ;; the latter two forms. - :get 'notmuch-hello--saved-searches-to-plist :type '(repeat notmuch-saved-search-plist) :tag "List of Saved Searches" @@ -482,20 +481,17 @@ (defun notmuch-hello-tags-per-line (widest) ;; Count is 9 wide (8 digits plus space), 1 for the space ;; after the name. (+ 9 1 (max no