Menu

#40 confluence-get-page-at-point / void-variable thing-at-point-url-regexp

1.8
Fixed
None
Medium
Defect
2016-04-04
2014-12-11
No

Using Emacs 24.4.1 and confluence-el 1.8-beta
When hitting enter on a search result in the confluence search results page, I get an error.

Debugger entered--Lisp error: (void-variable thing-at-point-url-regexp)
confluence-get-page-at-point(nil)
call-interactively(confluence-get-page-at-point nil nil)
command-execute(confluence-get-page-at-point)

There is no variable thing-at-point-url-regexp, but there is a variable "thing-at-point-url-path-regexp". Maybe thing-at-point-url-regexp is an obsolete variable or conversely, only in Emacs 25 if you're using the git version of Emacs?

Discussion

  • James Ahlborn

    James Ahlborn - 2014-12-11

    yep, looks like that is broken in emacs 24.

     
  • James Ahlborn

    James Ahlborn - 2014-12-11
    • status: New --> Accepted
    • assigned_to: James Ahlborn
     
  • Malcolm E Cook

    Malcolm E Cook - 2015-10-16

    +1! Glad to see it is accepted - any chance of a fix???? Thanks James!

     
  • Rupert Swarbrick (BRCM)

    A quick hack that appears to work is to replace the current code in confluence-get-page-at-point with the following:

    (defun confluence-url-at-point ()
      "Search for a URL at the current point, allowing confluence
    Wiki links. Returns a list (URL . TYPE) on success or the
    cons (NIL . NIL) on failure. On success, TYPE is one
    of :NORMAL, :EMBEDDED or :RAW, depending on whether we're looking
    at a normal link, an image/embedded content link, or a raw link."
      (or (and (thing-at-point-looking-at "{include:[ \t]*\\([^|\n}]+\\)}")
               (cons (match-string 1) :normal))
          (and (thing-at-point-looking-at
                "\\[\\(\\([^|\n]*\\)[|]\\)?\\([^]\n]+\\)\\]")
               (cons (match-string 3) :normal))
          (and (thing-at-point-looking-at
                "[!]\\([^]|\n]+\\)\\([|]\\([^]\n]*\\)\\)?[!]")
               (cons (match-string 1) :embedded))
          (cons (thing-at-point 'url) :raw)))
    
    (defun confluence-get-page-at-point (&optional arg)
      "Opens the confluence page at the current point.  If the link is a url,
    opens the page using `browse-url', otherwise attempts to load it as a
    confluence page.  Analogous to M-. (`find-tag').  Any ARG is passed to
    `confluence-get-page-with-url' if nothing is found at point."
      (interactive "P")
      (let ((url-pair (confluence-url-at-point)))
        ;; determine how to handle the link (may be straight-up url)
        (if (car url-pair)
            (let ((url (car url-pair))
                  (type (cdr url-pair)))
              (set-text-properties 0 (length url) nil url)
              (if (eq type :raw)
                  (browse-url url)
                (progn
                  (if (and (eq type :embedded) (not (string-match "\\^" url)))
                      ;; embedded content links are really just attachments
                      (setq url (concat "^" url)))
                  (if confluence-browse-function
                      (funcall confluence-browse-function url)
                    (cfln-simple-browse-function url))))) 
          (confluence-get-page-with-url arg))))
    
     
  • Malcolm E Cook

    Malcolm E Cook - 2015-10-20

    Works for me! Thanks!

     
  • James Ahlborn

    James Ahlborn - 2015-10-21

    Sorry for the delay, should be fixed now.

     
  • James Ahlborn

    James Ahlborn - 2015-10-21
    • status: Accepted --> Fixed
    • Milestone: --> 1.8
     
  • chen shu

    chen shu - 2016-04-04

    the bug still exists in emacs 24.5.1

     
    • James Ahlborn

      James Ahlborn - 2016-05-10

      what version of the confluence code are you using?

       

Log in to post a comment.