emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 6d5bdf7 11/36: Introduce (:hint none)


From: Oleh Krehel
Subject: [elpa] master 6d5bdf7 11/36: Introduce (:hint none)
Date: Sat, 22 Jul 2017 11:22:22 -0400 (EDT)

branch: master
commit 6d5bdf7cb06e05e4b5aa05f7bae887f213ecf10a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Introduce (:hint none)
    
    * hydra-examples.el (hydra-org-agenda-view): New example.
    
    * hydra.el (hydra--format): Revert to the old behavior for (:hint nil).
    Turn off the bottom hint completely for (:hint none).
    
    Fixes #190
---
 hydra-examples.el | 35 +++++++++++++++++++++++++++++++++++
 hydra.el          |  3 +--
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/hydra-examples.el b/hydra-examples.el
index 9264feb..413c937 100644
--- a/hydra-examples.el
+++ b/hydra-examples.el
@@ -290,6 +290,41 @@ _h_   _l_   _o_k        _y_ank
 ;; Recommended binding:
 ;; (global-set-key (kbd "C-x SPC") 'hydra-rectangle/body)
 
+;;** Example 12: org-agenda-view
+(defhydra hydra-org-agenda-view (:hint none)
+  "
+_d_: ?d? day        _g_: time grid=?g?  _a_: arch-trees
+_w_: ?w? week       _[_: inactive       _A_: arch-files
+_t_: ?t? fortnight  _f_: follow=?f?     _r_: clock report=?r?
+_m_: ?m? month      _e_: entry text=?e? _D_: include diary=?D?
+_y_: ?y? year       _q_: quit           _L__l__c_: log = ?l?"
+  ("SPC" org-agenda-reset-view)
+  ("d" org-agenda-day-view (if (eq 'day (org-agenda-cts)) "[x]" "[ ]"))
+  ("w" org-agenda-week-view (if (eq 'week (org-agenda-cts)) "[x]" "[ ]"))
+  ("t" org-agenda-fortnight-view (if (eq 'fortnight (org-agenda-cts)) "[x]" "[ 
]"))
+  ("m" org-agenda-month-view (if (eq 'month (org-agenda-cts)) "[x]" "[ ]"))
+  ("y" org-agenda-year-view (if (eq 'year (org-agenda-cts)) "[x]" "[ ]"))
+  ("l" org-agenda-log-mode (format "% -3S" org-agenda-show-log))
+  ("L" (org-agenda-log-mode '(4)))
+  ("c" (org-agenda-log-mode 'clockcheck))
+  ("f" org-agenda-follow-mode (format "% -3S" org-agenda-follow-mode))
+  ("a" org-agenda-archives-mode)
+  ("A" (org-agenda-archives-mode 'files))
+  ("r" org-agenda-clockreport-mode (format "% -3S" 
org-agenda-clockreport-mode))
+  ("e" org-agenda-entry-text-mode (format "% -3S" org-agenda-entry-text-mode))
+  ("g" org-agenda-toggle-time-grid (format "% -3S" org-agenda-use-time-grid))
+  ("D" org-agenda-toggle-diary (format "% -3S" org-agenda-include-diary))
+  ("!" org-agenda-toggle-deadlines)
+  ("[" (let ((org-agenda-include-inactive-timestamps t))
+         (org-agenda-check-type t 'timeline 'agenda)
+         (org-agenda-redo)
+         (message "Display now includes inactive timestamps as well")))
+  ("q" (message "Abort") :exit t)
+  ("v" nil))
+
+;; Recommended binding:
+;; (define-key org-agenda-mode-map "v" 'hydra-org-agenda-view/body)
+
 ;;* Helpers
 (require 'windmove)
 
diff --git a/hydra.el b/hydra.el
index 5626a4f..6b07dca 100644
--- a/hydra.el
+++ b/hydra.el
@@ -604,8 +604,7 @@ _NAME, BODY, DOCSTRING and HEADS are parameters of 
`defhydra'.
 The expressions can be auto-expanded according to NAME."
   (setq docstring (hydra--strip-align-markers docstring))
   (setq docstring (replace-regexp-in-string "___" "_β_" docstring))
-  (let ((rest (if (and (null (hydra-plist-get-default (cddr body) :hint 1))
-                       (string-match "\\`\n" docstring))
+  (let ((rest (if (eq (plist-get (cddr body) :hint) 'none)
                   ""
                 (hydra--hint body heads)))
         (start 0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]