emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Remove redundant #' around lambdas
@ 2021-03-30 14:34 Stefan Kangas
  2021-03-31  4:11 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kangas @ 2021-03-30 14:34 UTC (permalink / raw)
  To: Org-mode

[-- Attachment #1: Type: text/plain, Size: 44 bytes --]

Please find attached a minor cleanup patch.

[-- Attachment #2: 0001-Remove-redundant-around-lambdas.patch --]
[-- Type: text/x-diff, Size: 11046 bytes --]

From 7fcad2bd12ea1833db72494e799df64a5576c6fa Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Tue, 30 Mar 2021 16:19:06 +0200
Subject: [PATCH] Remove redundant #' around lambdas

* contrib/lisp/org-choose.el (org-choose-get-highest-mark-index)
(org-choose-get-fn-map-group, org-choose-keep-sensible)
(org-choose-setup-vars):
* lisp/org-mouse.el (org-mode-hook, org-mouse-context-menu)
(org-mouse-popup-global-menu):
* lisp/ox-beamer.el (org-beamer--format-section):
* lisp/ox.el (org-export-insert-default-template): Remove redundant #'
around lambdas.
---
 contrib/lisp/org-choose.el |  36 +++++-----
 lisp/org-mouse.el          | 130 ++++++++++++++++++-------------------
 lisp/ox-beamer.el          |   2 +-
 lisp/ox.el                 |   2 +-
 4 files changed, 85 insertions(+), 85 deletions(-)

diff --git a/contrib/lisp/org-choose.el b/contrib/lisp/org-choose.el
index c791a862e..839a38b28 100644
--- a/contrib/lisp/org-choose.el
+++ b/contrib/lisp/org-choose.el
@@ -175,8 +175,8 @@ Each entry is an `org-choose-mark-data.'" )
       (pushnew (cons text tail)
 	       org-choose-mark-data
 	       :test
-	       #'(lambda (a b)
-		   (equal (car a) (car b)))))))
+               (lambda (a b)
+                 (equal (car a) (car b)))))))
 
 ;;; org-choose-filter-tail
 (defun org-choose-filter-tail (raw)
@@ -347,8 +347,8 @@ setting was changed."
 		   org-todo-log-states)
 		;;Map over group
 		(funcall map-over-entries
-			 #'(lambda ()
-			     (apply func-d473 args-46k))))))))
+                         (lambda ()
+                           (apply func-d473 args-46k))))))))
     ;;Remove the marker
     (set-marker entry-pos nil)))
 
@@ -371,18 +371,18 @@ setting was changed."
 
 (defun org-choose-get-fn-map-group ()
   "Return a function to map over the group"
-  #'(lambda (fn)
-      (require 'org-agenda) ;; `org-map-entries' seems to need it.
-      (save-excursion
-	(unless (org-up-heading-safe)
-	  (error "Choosing is only supported between siblings in a tree, not on top level"))
-	(let
-	    ((level (org-reduced-level (org-outline-level))))
-	  (save-restriction
-	    (org-map-entries
-	     fn
-	     (format "LEVEL=%d" level)
-	     'tree))))))
+  (lambda (fn)
+    (require 'org-agenda) ;; `org-map-entries' seems to need it.
+    (save-excursion
+      (unless (org-up-heading-safe)
+        (error "Choosing is only supported between siblings in a tree, not on top level"))
+      (let
+          ((level (org-reduced-level (org-outline-level))))
+        (save-restriction
+          (org-map-entries
+           fn
+           (format "LEVEL=%d" level)
+           'tree))))))
 
 ;;; org-choose-get-highest-mark-index
 
@@ -396,8 +396,8 @@ If there is none, return 0"
        (indexes-list
 	(remove nil
 		(funcall map-over-entries
-			 #'(lambda ()
-			     (org-choose-get-entry-index keywords))))))
+                         (lambda ()
+                           (org-choose-get-entry-index keywords))))))
     (if
 	indexes-list
 	(apply #'max indexes-list)
diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el
index 5c222ea70..32897e6d9 100644
--- a/lisp/org-mouse.el
+++ b/lisp/org-mouse.el
@@ -501,7 +501,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
      ("Check Tags"
       ,@(org-mouse-keyword-menu
 	 (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
-	 #'(lambda (tag) (org-tags-sparse-tree nil tag)))
+         (lambda (tag) (org-tags-sparse-tree nil tag)))
       "--"
       ["Custom Tag ..." org-tags-sparse-tree t])
      ["Check Phrase ..." org-occur]
@@ -511,26 +511,26 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
      ("Display Tags"
       ,@(org-mouse-keyword-menu
 	 (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
-	 #'(lambda (tag) (org-tags-view nil tag)))
+         (lambda (tag) (org-tags-view nil tag)))
       "--"
       ["Custom Tag ..." org-tags-view t])
      ["Display Calendar" org-goto-calendar t]
      "--"
      ,@(org-mouse-keyword-menu
 	(mapcar 'car org-agenda-custom-commands)
-	#'(lambda (key)
-	    (eval `(org-agenda nil (string-to-char ,key))))
+        (lambda (key)
+          (eval `(org-agenda nil (string-to-char ,key))))
 	nil
-	#'(lambda (key)
-	    (let ((entry (assoc key org-agenda-custom-commands)))
-	      (org-mouse-clip-text
-	       (cond
-		((stringp (nth 1 entry)) (nth 1 entry))
-		((stringp (nth 2 entry))
-		 (concat (org-mouse-agenda-type (nth 1 entry))
-			 (nth 2 entry)))
-		(t "Agenda Command `%s'"))
-	       30))))
+        (lambda (key)
+          (let ((entry (assoc key org-agenda-custom-commands)))
+            (org-mouse-clip-text
+             (cond
+              ((stringp (nth 1 entry)) (nth 1 entry))
+              ((stringp (nth 2 entry))
+               (concat (org-mouse-agenda-type (nth 1 entry))
+                       (nth 2 entry)))
+              (t "Agenda Command `%s'"))
+             30))))
      "--"
      ["Delete Blank Lines" delete-blank-lines
       :visible (org-mouse-empty-line)]
@@ -795,8 +795,8 @@ This means, between the beginning of line and the point."
 	   ("Tags and Priorities"
 	    ,@(org-mouse-keyword-menu
 	       (org-mouse-priority-list)
-	       #'(lambda (keyword)
-		   (org-mouse-set-priority (string-to-char keyword)))
+               (lambda (keyword)
+                 (org-mouse-set-priority (string-to-char keyword)))
 	       priority "Priority %s")
 	    "--"
 	    ,@(org-mouse-tag-menu))
@@ -856,55 +856,55 @@ This means, between the beginning of line and the point."
     (mouse-drag-region event)))
 
 (add-hook 'org-mode-hook
-	  #'(lambda ()
-	      (setq org-mouse-context-menu-function 'org-mouse-context-menu)
-
-	      (when (memq 'context-menu org-mouse-features)
-		(org-defkey org-mouse-map [mouse-3] nil)
-		(org-defkey org-mode-map [mouse-3] 'org-mouse-show-context-menu))
-	      (org-defkey org-mode-map [down-mouse-1] 'org-mouse-down-mouse)
-	      (when (memq 'context-menu org-mouse-features)
-		(org-defkey org-mouse-map [C-drag-mouse-1] 'org-mouse-move-tree)
-		(org-defkey org-mouse-map [C-down-mouse-1] 'org-mouse-move-tree-start))
-	      (when (memq 'yank-link org-mouse-features)
-		(org-defkey org-mode-map [S-mouse-2] 'org-mouse-yank-link)
-		(org-defkey org-mode-map [drag-mouse-3] 'org-mouse-yank-link))
-	      (when (memq 'move-tree org-mouse-features)
-		(org-defkey org-mouse-map [drag-mouse-3] 'org-mouse-move-tree)
-		(org-defkey org-mouse-map [down-mouse-3] 'org-mouse-move-tree-start))
-
-	      (when (memq 'activate-stars org-mouse-features)
-		(font-lock-add-keywords
-		 nil
-		 `((,org-outline-regexp
-		    0 `(face org-link mouse-face highlight keymap ,org-mouse-map)
-		    'prepend))
-		 t))
-
-	      (when (memq 'activate-bullets org-mouse-features)
-		(font-lock-add-keywords
-		 nil
-		 `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +"
-		    (1 `(face org-link keymap ,org-mouse-map mouse-face highlight)
-		       'prepend)))
-		 t))
-
-	      (when (memq 'activate-checkboxes org-mouse-features)
-		(font-lock-add-keywords
-		 nil
-		 `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)"
-		    (2 `(face bold keymap ,org-mouse-map mouse-face highlight) t)))
-		 t))
-
-	      (defadvice org-open-at-point (around org-mouse-open-at-point activate)
-		(let ((context (org-context)))
-		  (cond
-		   ((assq :headline-stars context) (org-cycle))
-		   ((assq :checkbox context) (org-toggle-checkbox))
-		   ((assq :item-bullet context)
-		    (let ((org-cycle-include-plain-lists t)) (org-cycle)))
-		   ((org-footnote-at-reference-p) nil)
-		   (t ad-do-it))))))
+          (lambda ()
+            (setq org-mouse-context-menu-function 'org-mouse-context-menu)
+
+            (when (memq 'context-menu org-mouse-features)
+              (org-defkey org-mouse-map [mouse-3] nil)
+              (org-defkey org-mode-map [mouse-3] 'org-mouse-show-context-menu))
+            (org-defkey org-mode-map [down-mouse-1] 'org-mouse-down-mouse)
+            (when (memq 'context-menu org-mouse-features)
+              (org-defkey org-mouse-map [C-drag-mouse-1] 'org-mouse-move-tree)
+              (org-defkey org-mouse-map [C-down-mouse-1] 'org-mouse-move-tree-start))
+            (when (memq 'yank-link org-mouse-features)
+              (org-defkey org-mode-map [S-mouse-2] 'org-mouse-yank-link)
+              (org-defkey org-mode-map [drag-mouse-3] 'org-mouse-yank-link))
+            (when (memq 'move-tree org-mouse-features)
+              (org-defkey org-mouse-map [drag-mouse-3] 'org-mouse-move-tree)
+              (org-defkey org-mouse-map [down-mouse-3] 'org-mouse-move-tree-start))
+
+            (when (memq 'activate-stars org-mouse-features)
+              (font-lock-add-keywords
+               nil
+               `((,org-outline-regexp
+                  0 `(face org-link mouse-face highlight keymap ,org-mouse-map)
+                  'prepend))
+               t))
+
+            (when (memq 'activate-bullets org-mouse-features)
+              (font-lock-add-keywords
+               nil
+               `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +"
+                  (1 `(face org-link keymap ,org-mouse-map mouse-face highlight)
+                     'prepend)))
+               t))
+
+            (when (memq 'activate-checkboxes org-mouse-features)
+              (font-lock-add-keywords
+               nil
+               `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)"
+                  (2 `(face bold keymap ,org-mouse-map mouse-face highlight) t)))
+               t))
+
+            (defadvice org-open-at-point (around org-mouse-open-at-point activate)
+              (let ((context (org-context)))
+                (cond
+                 ((assq :headline-stars context) (org-cycle))
+                 ((assq :checkbox context) (org-toggle-checkbox))
+                 ((assq :item-bullet context)
+                  (let ((org-cycle-include-plain-lists t)) (org-cycle)))
+                 ((org-footnote-at-reference-p) nil)
+                 (t ad-do-it))))))
 
 (defun org-mouse-move-tree-start (_event)
   (interactive "e")
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 102797666..dd721c470 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -384,7 +384,7 @@ used as a communication channel."
 				 'beamer object contents info)))
 		      (if (org-string-nw-p code) (concat "\\protect" code)
 			code)))))
-	     (mapcar #'(lambda (type) (cons type protected-output))
+             (mapcar (lambda (type) (cons type protected-output))
 		     '(bold footnote-reference italic strike-through timestamp
 			    underline))))
 	  headline
diff --git a/lisp/ox.el b/lisp/ox.el
index 0253c1617..f705bc83a 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3115,7 +3115,7 @@ locally for the subtree through node properties."
     (when options
       (let ((items
 	     (mapcar
-	      #'(lambda (opt) (format "%s:%S" (car opt) (cdr opt)))
+              (lambda (opt) (format "%s:%S" (car opt) (cdr opt)))
 	      (sort options (lambda (k1 k2) (string< (car k1) (car k2)))))))
 	(if subtreep
 	    (org-entry-put
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Remove redundant #' around lambdas
  2021-03-30 14:34 [PATCH] Remove redundant #' around lambdas Stefan Kangas
@ 2021-03-31  4:11 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2021-03-31  4:11 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Org-mode

Stefan Kangas writes:

> Please find attached a minor cleanup patch.

Thank you.  Pushed (3089fcd69).


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-31  4:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 14:34 [PATCH] Remove redundant #' around lambdas Stefan Kangas
2021-03-31  4:11 ` Kyle Meyer

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).