help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: DWIM region


From: Emanuel Berg
Subject: Re: DWIM region
Date: Sat, 06 Jan 2018 23:14:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

(defun w3m-bookmark-dwim (url &optional title)
  (interactive
   (if (use-region-p)
       (list w3m-current-url (buffer-substring (region-beginning) (region-end)))
     (let ((url-at-point (thing-at-point 'url)))
       (if url-at-point (list url-at-point) ; perhaps these two can...
         (let ((link-url (w3m-url-valid (w3m-anchor)))) ; be flipped!
           (if link-url (list link-url) ; (w3m-anchor-title) here DNC
             (list w3m-current-url w3m-current-title) ))))))
  (w3m-bookmark-add url title) )

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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