Re: [PATCH 01/23] emacs: Shorten long lines

2020-07-27 Thread Jonas Bernoulli
Tomi Ollila  writes:

> On Sun, Jul 26 2020, Jonas Bernoulli wrote:

>>  (defun notmuch-maildir-add-file-style-fcc-header (subdir)
>> @@ -249,9 +250,8 @@ (defun notmuch-maildir-fcc-with-notmuch-insert 
>> (fcc-header  create)
>>;; typo, or just the user want a new folder, let the user decide
>>;; how to deal with it.
>>(error
>> -   (let ((response (notmuch-read-char-choice
>> -"Insert failed: (r)etry, (c)reate folder, (i)gnore, or 
>> (e)dit the header? "
>> -'(?r ?c ?i ?e
>> +   (let ((response (notmuch-read-char-choice "Insert failed: \
>> +\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i 
>> ?e
>
> Otherwise looks good, but what are these backslashes before (:s in line
> above

This is necessary because `outline-minor-mode' (and I believe also
commands that move by s-expression) for performance reasons just assume
that any parenthesis at the beginning of a line marks the beginning of
a top-level expression.  To signal that that is not the case one has to
quote the paren.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 01/23] emacs: Shorten long lines

2020-07-27 Thread Tomi Ollila
On Sun, Jul 26 2020, Jonas Bernoulli wrote:

> ---
>  emacs/coolj.el   |   2 +-
>  emacs/notmuch-address.el |  38 +++--
>  emacs/notmuch-company.el |  17 --
>  emacs/notmuch-crypto.el  |  16 +++---
>  emacs/notmuch-draft.el   |  12 ++--
>  emacs/notmuch-hello.el   |  43 ++-
>  emacs/notmuch-jump.el|   7 ++-
>  emacs/notmuch-lib.el |  62 +
>  emacs/notmuch-maildir-fcc.el |  14 ++---
>  emacs/notmuch-message.el |   3 +-
>  emacs/notmuch-mua.el |  78 +++---
>  emacs/notmuch-show.el| 103 +++
>  emacs/notmuch-tag.el |  14 +++--
>  emacs/notmuch-tree.el|  55 +--
>  emacs/notmuch-wash.el|  19 +--
>  emacs/notmuch.el |  27 ++---
>  emacs/rstdoc.el  |   3 +-
>  17 files changed, 326 insertions(+), 187 deletions(-)
>
> diff --git a/emacs/coolj.el b/emacs/coolj.el
> index 350d537f..5d311170 100644
> --- a/emacs/coolj.el
> +++ b/emacs/coolj.el
> @@ -1,6 +1,6 @@
>  ;;; coolj.el --- automatically wrap long lines  -*- coding:utf-8 -*-
>  
> -;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free 
> Software Foundation, Inc.
> +;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
>  
>  ;; Authors:Kai Grossjohann 
>  ;; Alex Schroeder 
> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
> index 0d56fba7..2a9c411a 100644
> --- a/emacs/notmuch-address.el
> +++ b/emacs/notmuch-address.el
> @@ -195,10 +195,11 @@ (defun notmuch-address-options (original)
> ((eq notmuch-address-command 'internal)
>  (unless (notmuch-address--harvest-ready)
>;; First, run quick synchronous harvest based on what the user
> -  ;; entered so far
> +  ;; entered so far.
>(notmuch-address-harvest original t))
>  (prog1 (notmuch-address-matching original)
> -  ;; Then start the (potentially long-running) full asynchronous harvest 
> if necessary
> +  ;; Then start the (potentially long-running) full asynchronous
> +  ;; harvest if necessary.
>(notmuch-address-harvest-trigger)))
> (t
>  (process-lines notmuch-address-command original
> @@ -241,7 +242,8 @@ (defun notmuch-address-expand-name ()
>   (push chosen notmuch-address-history)
>   (delete-region beg end)
>   (insert chosen)
> - (run-hook-with-args 'notmuch-address-post-completion-functions 
> chosen))
> + (run-hook-with-args 'notmuch-address-post-completion-functions
> + chosen))
>   (message "No matches.")
>   (ding
> (t nil)))
> @@ -393,10 +395,11 @@ (defun notmuch-address--save-address-hash ()
> ;; The file exists, check it is a file we saved
>   (notmuch-address--get-address-hash))
>   (with-temp-file notmuch-address-save-filename
> -   (let ((save-plist (list :version notmuch-address--save-hash-version
> -   :completion-settings 
> notmuch-address-internal-completion
> -   :last-harvest notmuch-address-last-harvest
> -   :completions notmuch-address-completions)))
> +   (let ((save-plist
> +  (list :version notmuch-address--save-hash-version
> +:completion-settings notmuch-address-internal-completion
> +:last-harvest notmuch-address-last-harvest
> +:completions notmuch-address-completions)))
>   (print "notmuch-address-hash" (current-buffer))
>   (print save-plist (current-buffer
>(message "\
> @@ -408,16 +411,17 @@ (defun notmuch-address-harvest-trigger ()
>(let ((now (float-time)))
>  (when (> (- now notmuch-address-last-harvest) 86400)
>(setq notmuch-address-last-harvest now)
> -  (notmuch-address-harvest nil nil
> -(lambda (proc event)
> -  ;; If harvest fails, we want to try
> -  ;; again when the trigger is next
> -  ;; called
> -  (if (string= event "finished\n")
> -  (progn
> -(notmuch-address--save-address-hash)
> -(setq 
> notmuch-address-full-harvest-finished t))
> -(setq notmuch-address-last-harvest 0)))
> +  (notmuch-address-harvest
> +   nil nil
> +   (lambda (proc event)
> +  ;; If harvest fails, we want to try
> +  ;; again when the trigger is next
> +  ;; called
> +  (if (string= event "finished\n")
> +  (progn
> +(notmuch-address--save-address-hash)
> +(setq notmuch-address-full-harvest-finished t))
> +(setq notmuch-address-last-harvest 0)))
>  
>  ;;
>  

[PATCH 01/23] emacs: Shorten long lines

2020-07-26 Thread Jonas Bernoulli
---
 emacs/coolj.el   |   2 +-
 emacs/notmuch-address.el |  38 +++--
 emacs/notmuch-company.el |  17 --
 emacs/notmuch-crypto.el  |  16 +++---
 emacs/notmuch-draft.el   |  12 ++--
 emacs/notmuch-hello.el   |  43 ++-
 emacs/notmuch-jump.el|   7 ++-
 emacs/notmuch-lib.el |  62 +
 emacs/notmuch-maildir-fcc.el |  14 ++---
 emacs/notmuch-message.el |   3 +-
 emacs/notmuch-mua.el |  78 +++---
 emacs/notmuch-show.el| 103 +++
 emacs/notmuch-tag.el |  14 +++--
 emacs/notmuch-tree.el|  55 +--
 emacs/notmuch-wash.el|  19 +--
 emacs/notmuch.el |  27 ++---
 emacs/rstdoc.el  |   3 +-
 17 files changed, 326 insertions(+), 187 deletions(-)

diff --git a/emacs/coolj.el b/emacs/coolj.el
index 350d537f..5d311170 100644
--- a/emacs/coolj.el
+++ b/emacs/coolj.el
@@ -1,6 +1,6 @@
 ;;; coolj.el --- automatically wrap long lines  -*- coding:utf-8 -*-
 
-;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free Software 
Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
 
 ;; Authors:Kai Grossjohann 
 ;; Alex Schroeder 
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 0d56fba7..2a9c411a 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -195,10 +195,11 @@ (defun notmuch-address-options (original)
((eq notmuch-address-command 'internal)
 (unless (notmuch-address--harvest-ready)
   ;; First, run quick synchronous harvest based on what the user
-  ;; entered so far
+  ;; entered so far.
   (notmuch-address-harvest original t))
 (prog1 (notmuch-address-matching original)
-  ;; Then start the (potentially long-running) full asynchronous harvest 
if necessary
+  ;; Then start the (potentially long-running) full asynchronous
+  ;; harvest if necessary.
   (notmuch-address-harvest-trigger)))
(t
 (process-lines notmuch-address-command original
@@ -241,7 +242,8 @@ (defun notmuch-address-expand-name ()
(push chosen notmuch-address-history)
(delete-region beg end)
(insert chosen)
-   (run-hook-with-args 'notmuch-address-post-completion-functions 
chosen))
+   (run-hook-with-args 'notmuch-address-post-completion-functions
+   chosen))
(message "No matches.")
(ding
(t nil)))
@@ -393,10 +395,11 @@ (defun notmuch-address--save-address-hash ()
  ;; The file exists, check it is a file we saved
(notmuch-address--get-address-hash))
(with-temp-file notmuch-address-save-filename
- (let ((save-plist (list :version notmuch-address--save-hash-version
- :completion-settings 
notmuch-address-internal-completion
- :last-harvest notmuch-address-last-harvest
- :completions notmuch-address-completions)))
+ (let ((save-plist
+(list :version notmuch-address--save-hash-version
+  :completion-settings notmuch-address-internal-completion
+  :last-harvest notmuch-address-last-harvest
+  :completions notmuch-address-completions)))
(print "notmuch-address-hash" (current-buffer))
(print save-plist (current-buffer
   (message "\
@@ -408,16 +411,17 @@ (defun notmuch-address-harvest-trigger ()
   (let ((now (float-time)))
 (when (> (- now notmuch-address-last-harvest) 86400)
   (setq notmuch-address-last-harvest now)
-  (notmuch-address-harvest nil nil
-  (lambda (proc event)
-;; If harvest fails, we want to try
-;; again when the trigger is next
-;; called
-(if (string= event "finished\n")
-(progn
-  (notmuch-address--save-address-hash)
-  (setq 
notmuch-address-full-harvest-finished t))
-  (setq notmuch-address-last-harvest 0)))
+  (notmuch-address-harvest
+   nil nil
+   (lambda (proc event)
+;; If harvest fails, we want to try
+;; again when the trigger is next
+;; called
+(if (string= event "finished\n")
+(progn
+  (notmuch-address--save-address-hash)
+  (setq notmuch-address-full-harvest-finished t))
+  (setq notmuch-address-last-harvest 0)))
 
 ;;
 
diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index ac998f9b..c1f3594e 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -69,9 +69,11 @@