unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: David Bremner <david@tethera.net>,
	Thomas Hisch <t.hisch@gmail.com>,
	aaermolov@gmail.com
Cc: notmuch@notmuchmail.org, Austin Clements <amdragon@gmail.com>
Subject: [PATCH] emacs/notmuch.el: don't use 'function' as variable name.
Date: Sat,  8 Apr 2017 14:03:29 -0300	[thread overview]
Message-ID: <20170408170329.10196-1-david@tethera.net> (raw)
In-Reply-To: <874ly0foc9.fsf@tethera.net>

In principle this should work, but at least in some pre-release
versions of emacs26, this causes problems inside lexical let [1].

[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26406
---
 emacs/notmuch.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index d8d3afeb..40b9fabd 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -402,17 +402,17 @@ returns nil"
     (next-single-property-change (or pos (point)) 'notmuch-search-result
 				 nil (point-max))))
 
-(defun notmuch-search-foreach-result (beg end function)
-  "Invoke FUNCTION for each result between BEG and END.
+(defun notmuch-search-foreach-result (beg end fn)
+  "Invoke FN for each result between BEG and END.
 
-FUNCTION should take one argument.  It will be applied to the
+FN should take one argument.  It will be applied to the
 character position of the beginning of each result that overlaps
 the region between points BEG and END.  As a special case, if (=
-BEG END), FUNCTION will be applied to the result containing point
+BEG END), FN will be applied to the result containing point
 BEG."
 
   (lexical-let ((pos (notmuch-search-result-beginning beg))
-		;; End must be a marker in case function changes the
+		;; End must be a marker in case fn changes the
 		;; text.
 		(end (copy-marker end))
 		;; Make sure we examine at least one result, even if
@@ -423,7 +423,7 @@ BEG."
     ;; pos.
     (while (and pos (or (< pos end) first))
       (when (notmuch-search-get-result pos)
-	(funcall function pos))
+	(funcall fn pos))
       (setq pos (notmuch-search-result-end pos)
 	    first nil))))
 ;; Unindent the function argument of notmuch-search-foreach-result so
-- 
2.11.0

  reply	other threads:[~2017-04-08 17:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 11:12 notmuch-emacs and Emacs26 (master) aaermolov
2017-04-07  5:16 ` Thomas Hisch
2017-04-07 11:29   ` David Bremner
2017-04-08 17:03     ` David Bremner [this message]
2017-05-07 11:56       ` [PATCH] emacs/notmuch.el: don't use 'function' as variable name David Bremner
2017-04-21 17:23 ` notmuch-emacs and Emacs26 (master) Steven Allen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170408170329.10196-1-david@tethera.net \
    --to=david@tethera.net \
    --cc=aaermolov@gmail.com \
    --cc=amdragon@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=t.hisch@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).