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

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

[elpa] scratch/hyperbole-merge-7.0.2b afe3db8 06/23: Added 'k' to klink


From: Stefan Monnier
Subject: [elpa] scratch/hyperbole-merge-7.0.2b afe3db8 06/23: Added 'k' to klink ids exported to html;
Date: Tue, 5 Feb 2019 16:11:18 -0500 (EST)

branch: scratch/hyperbole-merge-7.0.2b
commit afe3db80385135235b62c2cb106f5c001b932bfc
Author: Bob Weiner <address@hidden>
Commit: Bob Weiner <address@hidden>

    Added 'k' to klink ids exported to html;
    Added hui-select-get-region*;
    Extended github-reference and gitlab-reference
    with 'people' and 'contributors'
    
    2017-12-20  Bob Weiner  <address@hidden>
    
    * kotl/kexport.el (kexport:html-file-klink)
                      (kexport:html):
                      (kexport:html-replacement-alist): Added 'k' to precede 
klink HTML HREF
        references since these must start with a letter.
    
    * hui-select.el (hui-select-get-region): Added this to be used in other 
libraries.
                    (hui-select-get-region-boundaries): Added and used in 
hui-select-thing.
    
    2017-12-19  Bob Weiner  <address@hidden>
    
    * hib-social.el (github-reference, gitlab-reference): Added "people" 
reference support
        to list people who are part of a formal organization as well as a 
"staff" alias.
        Added "contributors" reference support to list project contributors as 
well.
---
 Changes            |  16 +++++++
 hib-social.el      | 131 ++++++++++++++++++++++++++++++-----------------------
 hui-select.el      |  15 +++++-
 hyrolo.el          |   2 +-
 kotl/kexport.el    |  14 +++---
 man/hyperbole.texi |   2 +-
 6 files changed, 114 insertions(+), 66 deletions(-)

diff --git a/Changes b/Changes
index c43725c..bccbe59 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,19 @@
+2017-12-20  Bob Weiner  <address@hidden>
+
+* kotl/kexport.el (kexport:html-file-klink)
+                  (kexport:html): 
+                  (kexport:html-replacement-alist): Added 'k' to precede klink 
HTML HREF
+    references since these must start with a letter.
+
+* hui-select.el (hui-select-get-region): Added this to be used in other 
libraries.
+                (hui-select-get-region-boundaries): Added and used in 
hui-select-thing.
+
+2017-12-19  Bob Weiner  <address@hidden>
+
+* hib-social.el (github-reference, gitlab-reference): Added "people" reference 
support
+    to list people who are part of a formal organization as well as a "staff" 
alias.
+    Added "contributors" reference support to list project contributors as 
well.
+
 2017-12-19  Bob Weiner  <address@hidden>
 
 * hib-social.el (github-reference): Added =item-id syntax.
diff --git a/hib-social.el b/hib-social.el
index f10eb6c..29df535 100644
--- a/hib-social.el
+++ b/hib-social.el
@@ -91,45 +91,6 @@
 ;;
 
 
-;;   Gitlab (remote) reference links
-;;
-;;     address@hidden                                 Display user's home page 
& projects
-;;
-;;     gitlab#rswgnu/hyperbole                   Display user's project
-;;     gl#rswgnu/helm/global_mouse               Display user project's branch
-;;     gl#rswgnu/hyperbole/55a1f0                Display user project's commit 
diff
-;;
-;;     gl#orgs/gitlab/people                     List the org, gitlab's staff
-;;
-;;     (setq hibtypes-gitlab-default-user "rswgnu")
-;;     gitlab#/hyperbole                         Display default user's project
-;;
-;;
-;;     Once you set the default user and project variables, you can leave
-;;     them off any reference links:
-;;
-;;       (setq hibtypes-gitlab-default-user "emacs-helm")
-;;       (setq hibtypes-gitlab-default-project "helm")
-;;
-;;     like so:
-;;
-;;       gl#issues                               List emacs-helm/helm's open 
issues
-;;       gl#1878                                 Display a specific project 
issue
-;;
-;;       gl#pulls                                List project's open pull 
requests
-;;       gl#pull/1871                            Display a specific project 
pull request
-;;
-;;       gl#branches                             List project's branches
-;;       gl#branch/global_mouse                  List files in a specific 
branch
-;;       gl#global_mouse                         You can even leave off the 
`branch' keyword
-;;
-;;       gl#tags                                 List project's tagged 
commits, typically releases
-;;       gl#tag/v2.8.4 or gl#v2.8.4              List files in a specific 
tagged commit
-;;
-;;       gl#commits                              List project's commits
-;;       gl#898e55c                              Display default user and 
default
-;;                                               project commit diff
-
 ;;   Github (remote) reference links
 ;;
 ;;     address@hidden                                 Display user's home page 
& projects
@@ -138,7 +99,8 @@
 ;;     gh#rswgnu/helm/global_mouse               Display user project's branch
 ;;     gh#rswgnu/hyperbole/55a1f0                Display user project's commit 
diff
 ;;
-;;     gh#orgs/github/people                     List the org, github's staff
+;;     gh#orgs/github/people (or staff)          List the org, github's staff
+;;     gh#/github/fetch/contributors             List contributors to github's 
fetch project
 ;;
 ;;     (setq hibtypes-github-default-user "rswgnu")
 ;;     github#/hyperbole                         Display default user's project
@@ -169,6 +131,40 @@
 ;;       gh#898e55c                              Display default user and 
default
 ;;                                               project commit diff
 
+;;   Gitlab (remote) reference links support the same reference types as 
Github (but
+;;   substitute the gl# prefix) plus these additional reference types:
+;;
+;;     gl#/libertybsd/libertybsd-status          Group and project
+;;
+;;     gl#gitlab-org/gitlab-ce/activity          Summarize user's project 
activity
+;;     gl#gitlab-org/gitlab-ce/analytics         Display user project's 
cycle_analytics
+;;     gl#gitlab-org/gitlab-ce/boards            Display user project's 
kanban-type issue boards
+;;
+;;     Once you set the default user and project variables, you can leave
+;;     them off any reference links:
+;;
+;;       (setq hibtypes-gitlab-default-user "gitlab-org")
+;;       (setq hibtypes-gitlab-default-project "gitlab-ce")
+;;
+;;     gl#issues or gl#list                      Display default project's 
issue list
+;;     gl#jobs                                   Display default project's 
computing jobs
+;;     gl#labels                                 Display default project's 
issue categories
+;;     gl#members                                Display default project's 
staff list
+;;     gl#contributors                           Show contributor push 
frequency charts
+;;     gl#merge_requests or gl#pulls             Display default project's 
pull requests
+;;     gl#milestones                             Display default project's 
milestones status
+;;     gl#pages                                  Display default project's web 
pages
+;;     gl#pipelines                              List build and test sequences
+;;     gl#pipeline_charts                        Graphical view of pipeline 
run results across time
+;;     gl#schedules                              Display schedules for project 
pipelines
+;;     gl#snippets                               Project snippets, diffs and 
text with discussion
+;;
+;;     gl#groups                                 List all available groups of 
projects
+;;     gl#projects                               List all available projects
+;;
+;;     gl#milestone=38                           Show a specific project 
milestone
+;;     gl#snippet/1689487                        Show a specific project 
snippet
+
 ;;; Code:
 ;;; ************************************************************************
 ;;; Other required Elisp libraries
@@ -344,7 +340,8 @@ REFERENCE is a string of one of the following forms:
 or  /<project>.
 
 <ref-item> is one of these:
-  one of the words: branches, commits, issues, pulls, status or tags; the 
associated items are listed;
+  one of the words: branches, commits, contributors, issues, people or staff,
+  pulls, status or tags; the associated items are listed;
 
   one of the words: branch, commit, issue, pull or tag followed by a '/' or 
'=' and 
   an item-id; the item is shown;
@@ -386,15 +383,22 @@ PROJECT value is provided, it defaults to the value of
                      ;; /project
                      (setq project (or project (match-string-no-properties 1 
reference))
                            reference nil)))
+              (when (or (and project (string-match 
"\\`\\(members\\|people\\|staff\\)\\'" project))
+                        ;; Change <org-name>/[members|people|staff] to 
/orgs/<org-name>/people.
+                        (and reference (string-match 
"\\`\\(members\\|people\\|staff\\)\\'" reference)))
+                ;; Change <org-name>/project/[people|staff] to 
/orgs/<org-name>/people.
+                (setq project user
+                      user "orgs"
+                      reference "people"))
+              (when (equal reference "contributors")
+                ;; Change /user/project/contributors to 
/user/project/graphs/contributors.
+                (setq ref-type "graphs/"
+                      reference "contributors"))
               (unless (stringp user) (setq user hibtypes-github-default-user))
               (unless (stringp project) (setq project 
hibtypes-github-default-project))
               (when reference
-                (cond ((equal user "orgs")
-                       ;; A specific organization reference
-                       (setq ref-type reference
-                             reference ""))
-                      ((member reference '("branches" "commits" "issues" 
"pulls" "tags"))
-                       ;; All branches, commits, open issues, pull requests or 
commit tags reference
+                (cond ((member reference '("branches" "commits" "contributors" 
"issues" "people" "pulls" "tags"))
+                       ;; All branches, commits, contributors, open issues, 
people, pull requests or commit tags reference
                        (setq ref-type reference
                              reference ""))
                       ((and (< (length reference) 8) (string-match 
"\\`\\([gG][hH]-\\)?[0-9]+\\'" reference))
@@ -420,7 +424,8 @@ PROJECT value is provided, it defaults to the value of
                   (funcall hibtypes-social-display-function
                            (if reference
                                (format url-to-format user project ref-type 
reference)
-                             (format url-to-format user project "" "")))
+                             ;; Remove trailing /
+                             (substring (format url-to-format user project "" 
"") 0 -1)))
                 (cond ((and (null user) (null project))
                        (error "(github-reference): Set 
`hibtypes-github-default-user' and `hibtypes-github-default-project'"))
                       ((null user)
@@ -439,12 +444,14 @@ REFERENCE is a string of one of the following forms:
     <ref-item>
     <user>/<project>/<ref-item>
     <project>/<ref-item>
-or  /<project>.
+    /<group>/<project>
+or  /<project-or-group> (where a group is a collection of projects).
 
 <ref-item> is one of these:
-  one of the words: activity, analytics, boards or kanban, branches, commits, 
issues or
-  list, jobs, labels, members, merge_requests, milestones, pages, pipelines, 
pipeline_charts,
-  pulls, schedules, snippets, status or tags; the associated items are listed;
+  one of the words: activity, analytics, boards or kanban, branches, commits, 
contributors,
+  groups, issues or list, jobs, labels, merge_requests, milestones, pages, 
pipelines,
+  pipeline_charts, members or people or staff, projects, pulls, schedules, 
snippets,
+  status or tags; the associated items are listed;
 
   one of the words: branch, commit(s), issue(s), milestone(s), pull(s), 
snippet(s) or
   tag(s) followed by a '/' or '=' and an item-id; the item is shown;
@@ -486,6 +493,12 @@ PROJECT value is provided, it defaults to the value of
                      ;; /project
                      (setq project (or project (match-string-no-properties 1 
reference))
                            reference nil)))
+              (when (and (null (and user project)) (string-match 
"\\`\\(groups\\|projects\\)\\'" reference))
+                ;; List all available groups of projects or projects.
+                (setq user "explore"
+                      project (match-string-no-properties 1 reference)
+                      ref-type nil
+                      reference nil))
               (unless (stringp user) (setq user hibtypes-gitlab-default-user))
               (unless (stringp project) (setq project 
hibtypes-gitlab-default-project))
               (when (equal project "pages")
@@ -511,14 +524,20 @@ PROJECT value is provided, it defaults to the value of
                        ;; List all issues
                        (setq ref-type "issues"
                              reference ""))
-                      ((equal reference "members")
-                       ;; Members of the project
+                      ((equal reference "contributors")
+                       (setq ref-type "graphs/master"
+                             reference ""))
+                      ((string-match "\\`\\(members\\|people\\|staff\\)\\'" 
reference)
                        (setq ref-type "project_members"
                              reference ""))
                       ((equal reference "pipeline_charts")
                        ;; Continuous Integration Pipeline Charts
                        (setq ref-type "pipelines/charts"
                              reference ""))
+                      ((equal reference "pulls")
+                       ;; Merge requests for the project
+                       (setq ref-type "merge_requests"
+                             reference ""))
                       ((equal reference "schedules")
                        ;; Schedules for CI Pipelines
                        (setq ref-type "pipeline_schedules"
@@ -529,9 +548,9 @@ PROJECT value is provided, it defaults to the value of
                              reference ""))
                       ((member reference '("activity" "branches" "commits" 
"issues" "labels"
                                            "merge_requests" "milestones" 
"pages" "pipelines"
-                                           "pulls" "snippets" "tags"))
+                                           "snippets" "tags"))
                        ;; All activity, branches, commits, cycle analytics, 
open issues, issue labels,
-                       ;; merge requests, milestones, web pages, pull 
requests, code snippets
+                       ;; members, merge requests, milestones, web pages, pull 
requests, code snippets
                        ;; or commit tags reference
                        (setq ref-type reference
                              reference ""))
diff --git a/hui-select.el b/hui-select.el
index 6474acf..a12365e 100644
--- a/hui-select.el
+++ b/hui-select.el
@@ -310,6 +310,19 @@ Also, add language-specific syntax setups to aid in thing 
selection."
                          (setq sentence-end "\\([^ 
\t\n\r>]<\\|>\\(<[^>]*>\\)*\\|[.?!][]\"')}]*\\($\\| $\\|\t\\|  \\)\\)[ \t\n]*")
                          (define-key web-mode-map "\C-c." 
'hui-select-goto-matching-tag))))
 
+(defun hui-select-get-region-boundaries ()
+  "Return the (START . END) boundaries of region for `hui-select-thing'."
+  (or (hui-select-boundaries (point))
+      (when (eq hui-select-previous 'punctuation)
+       (hui-select-word (point)))))
+
+;;;###autoload
+(defun hui-select-get-region ()
+  "Return the region that `hui-select-thing' would select."
+  (let ((region-bounds (hui-select-get-region-boundaries)))
+    (when region-bounds
+      (buffer-substring-no-properties (car region-bounds) (cdr 
region-bounds)))))
+
 ;;;###autoload
 (defun hui-select-thing ()
   "Select a region based on the syntax of the thing at point.
@@ -325,7 +338,7 @@ interactively, the type of selection is displayed in the 
minibuffer."
          ;; Reset selection based on the syntax of character at point.
          (hui-select-reset)
          nil)))
-  (let ((region (hui-select-boundaries (point))))
+  (let ((region (hui-select-get-region-boundaries)))
     (unless region
       (when (eq hui-select-previous 'punctuation)
        (setq region (hui-select-word (point)))))
diff --git a/hyrolo.el b/hyrolo.el
index 00e3f39..1d61a46 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -694,7 +694,7 @@ If ARG is zero, move to the beginning of the current line."
   (if (null arg) (setq arg 1))
   (forward-visible-line arg))
 
-;; Derived from `sort-lines' in "sort.el" since through Emacs 25.0
+;; Derived from `sort-lines' in "sort.el" since through at least Emacs 25.0
 ;; invisible lines are not grouped with the prior visible line, making
 ;; rolo entry (or any record) sorts fail.  This next function fixes that.
 (defun hyrolo-sort-lines (reverse beg end)
diff --git a/kotl/kexport.el b/kotl/kexport.el
index 1e9dc09..cea41c6 100644
--- a/kotl/kexport.el
+++ b/kotl/kexport.el
@@ -88,10 +88,10 @@
    ;; make klinks into hyperlinks
    (cons (concat "&lt;address@hidden" kexport:kcell-reference-regexp
                 "[^&>]*&gt;")
-        "<A HREF=\"#\\1\">\\0</A>")
+        "<A HREF=\"#k\\1\">\\0</A>")
    (cons (format "&lt;address@hidden(%s\\)[^=&>]*&gt;"
                 kexport:kcell-partial-reference-regexp)
-        "<A HREF=\"#\\1\">\\0</A>")
+        "<A HREF=\"#k\\1\">\\0</A>")
    (cons (format "&lt;\\s-*\\([^ \t\n\r,<>]+\\)\\s-*,\\s-*%s[^=&>]*&gt;"
                 kexport:kcell-reference-regexp)
         'kexport:html-file-klink)
@@ -170,7 +170,7 @@ STILL TODO:
                                 title)))
 
     (princ "<HTML><HEAD>\n\n")
-    (princ "<A ID=\"top\"></A><A ID=\"0\"></A>\n")
+    (princ "<A ID=\"top\"></A><A ID=\"k0\"></A>\n")
     (princ (format "<TITLE>%s</TITLE>\n" title))
     (if kexport:html-description
        (princ (format "<META ID=\"description\" CONTENT=\"%s\">\n"
@@ -196,8 +196,8 @@ STILL TODO:
           (setq i (1- i)))
         (princ "<TABLE><TR>\n")
         (setq label (kcell-view:label))
-        (princ (format "<A ID=\"%s\"></A>" label))
-        (princ (format "<A ID=\"%s\"></A>\n" (kcell-view:idstamp)))
+        (princ (format "<A ID=\"k%s\"></A>" label))
+        (princ (format "<A ID=\"k%s\"></A>\n" (kcell-view:idstamp)))
         (princ "<TD WIDTH=2% VALIGN=top><PRE>\n")
         (princ (format
                 "<FONT %s>%s%s</FONT></PRE></TD>\n"
@@ -236,8 +236,8 @@ Works exclusively within a call to 
`hypb:replace-match-string'."
                             (match-end 1))))
     (if (equal filename (file-name-nondirectory
                         kexport:input-filename))
-       "<A HREF=\"#\\2\">\\0</A>"
-      (format "<A HREF=\"file://%s#\\2\">\\0</A>"
+       "<A HREF=\"#k\\2\">\\0</A>"
+      (format "<A HREF=\"file://%s#k\\2\">\\0</A>"
              (expand-file-name filename
                                (if kexport:input-filename
                                    (file-name-directory
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index e219197..4a6aa37 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -1517,7 +1517,7 @@ windows, instead use the @bkbd{M-o t 
<id-of-window-to-display-item-in>} key sequ
 @c normally under Hyperbole.
 
 @c The code for Smart Key modifiers can be found in
address@hidden @address@hidden@{hyperb:address@hidden/hmouse-mod.el}.
address@hidden @address@hidden:address@hidden/hmouse-mod.el}.
 
 
 @node Buttons, Menus, Smart Keys, Top



reply via email to

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