aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-01-12 13:07:52 -0500
committerStefan Monnier2015-01-14 08:35:07 -0500
commit81882be7111e361ad072b9512bfefa3430b3e867 (patch)
tree4703f2e6b6ac70990668f88fd55933be83acf114
parent009836b97cdab2b79cfa26c83459db3fd91c94b0 (diff)
downloademacs-81882be7111e361ad072b9512bfefa3430b3e867.tar.gz
emacs-81882be7111e361ad072b9512bfefa3430b3e867.zip
* lisp/net/eww.el: Use lexical-binding.
(eww-links-at-point): Remove unused arg. (eww-mode-map): Inherit from special-mode-map. (eww-mode): Derive from special-mode. Don't use `setq' on a hook.
-rw-r--r--lisp/ChangeLog35
-rw-r--r--lisp/net/eww.el34
2 files changed, 35 insertions, 34 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 072af5b1b91..6e2adc9b8e1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,17 @@
12015-01-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * net/eww.el: Use lexical-binding.
4 (eww-links-at-point): Remove unused arg.
5 (eww-mode-map): Inherit from special-mode-map.
6 (eww-mode): Derive from special-mode. Don't use `setq' on a hook.
7
12015-01-13 Alan Mackenzie <acm@muc.de> 82015-01-13 Alan Mackenzie <acm@muc.de>
2 9
3 Allow compilation during loading of Modes derived from a CC Mode mode. 10 Allow compilation during loading of Modes derived from a CC Mode mode.
4 Fixes debbugs#19206. 11 Fixes debbugs#19206.
5 12
6 * progmodes/cc-bytecomp.el (cc-bytecomp-compiling-or-loading): new 13 * progmodes/cc-bytecomp.el (cc-bytecomp-compiling-or-loading):
7 function which walks the stack to discover whether we're compiling 14 New function which walks the stack to discover whether we're compiling
8 or loading. 15 or loading.
9 (cc-bytecomp-is-compiling): Reformulate, and move towards 16 (cc-bytecomp-is-compiling): Reformulate, and move towards
10 beginning. 17 beginning.
@@ -21,8 +28,8 @@
21 symbol's 'source property. 28 symbol's 'source property.
22 (c-lang-const): Use cc-bytecomp-is-compiling. 29 (c-lang-const): Use cc-bytecomp-is-compiling.
23 30
24 * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Use 31 * progmodes/cc-langs.el (c-make-init-lang-vars-fun):
25 cc-bytecomp-is-compiling. 32 Use cc-bytecomp-is-compiling.
26 33
272015-01-13 Stefan Monnier <monnier@iro.umontreal.ca> 342015-01-13 Stefan Monnier <monnier@iro.umontreal.ca>
28 35
@@ -439,8 +446,8 @@
439 to `pre-command-hook'. 446 to `pre-command-hook'.
440 (xref--xref-buffer-mode-map): Don't remap `next-line' and 447 (xref--xref-buffer-mode-map): Don't remap `next-line' and
441 `previous-line'. Additionally bind `xref-next-line' and 448 `previous-line'. Additionally bind `xref-next-line' and
442 `xref-prev-line' to `n' and `p' respectively. Bind 449 `xref-prev-line' to `n' and `p' respectively.
443 `xref-show-location-at-point' to `C-o'. 450 Bind `xref-show-location-at-point' to `C-o'.
444 451
4452015-01-01 Eli Zaretskii <eliz@gnu.org> 4522015-01-01 Eli Zaretskii <eliz@gnu.org>
446 453
@@ -629,15 +636,15 @@
629 Add argument MSG to display user-friendly message when no process 636 Add argument MSG to display user-friendly message when no process
630 is running. 637 is running.
631 (python-shell-switch-to-shell): Call pop-to-buffer with NORECORD. 638 (python-shell-switch-to-shell): Call pop-to-buffer with NORECORD.
632 (python-shell-make-comint): Rename argument SHOW from POP. Use 639 (python-shell-make-comint): Rename argument SHOW from POP.
633 display-buffer instead of pop-to-buffer. 640 Use display-buffer instead of pop-to-buffer.
634 (run-python): Doc fix. Return process. 641 (run-python): Doc fix. Return process.
635 (python-shell-get-or-create-process): Make obsolete. 642 (python-shell-get-or-create-process): Make obsolete.
636 643
6372014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org> 6442014-12-27 Fabián Ezequiel Gallina <fgallina@gnu.org>
638 645
639 * progmodes/python.el (python-shell-buffer-substring): Handle 646 * progmodes/python.el (python-shell-buffer-substring):
640 cornercase when region sent starts at point-min. 647 Handle cornercase when region sent starts at point-min.
641 648
6422014-12-27 Eli Zaretskii <eliz@gnu.org> 6492014-12-27 Eli Zaretskii <eliz@gnu.org>
643 650
@@ -809,8 +816,8 @@
809 816
8102014-12-25 Filipp Gunbin <fgunbin@fastmail.fm> 8172014-12-25 Filipp Gunbin <fgunbin@fastmail.fm>
811 818
812 * dired-aux.el (dired-maybe-insert-subdir): Make 819 * dired-aux.el (dired-maybe-insert-subdir):
813 dired-maybe-insert-subdir always skip trivial files. 820 Make dired-maybe-insert-subdir always skip trivial files.
814 821
8152014-12-25 Helmut Eller <eller.helmut@gmail.com> 8222014-12-25 Helmut Eller <eller.helmut@gmail.com>
816 Dmitry Gutov <dgutov@yandex.ru> 823 Dmitry Gutov <dgutov@yandex.ru>
@@ -855,8 +862,8 @@
855 862
856 * window.el (mouse-autoselect-window-position-1): New variable. 863 * window.el (mouse-autoselect-window-position-1): New variable.
857 (mouse-autoselect-window-cancel) 864 (mouse-autoselect-window-cancel)
858 (mouse-autoselect-window-select, handle-select-window): With 865 (mouse-autoselect-window-select, handle-select-window):
859 delayed autoselection select window only if mouse moves after 866 With delayed autoselection select window only if mouse moves after
860 selecting its frame. 867 selecting its frame.
861 868
8622014-12-24 Michael Albinus <michael.albinus@gmx.de> 8692014-12-24 Michael Albinus <michael.albinus@gmx.de>
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 71094b1b66d..879eb53115e 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1,4 +1,4 @@
1;;; eww.el --- Emacs Web Wowser 1;;; eww.el --- Emacs Web Wowser -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2013-2015 Free Software Foundation, Inc. 3;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
4 4
@@ -552,7 +552,7 @@ See the `eww-search-prefix' variable for the search engine used."
552 "Return URI of the Web page the current EWW buffer is visiting." 552 "Return URI of the Web page the current EWW buffer is visiting."
553 (plist-get eww-data :url)) 553 (plist-get eww-data :url))
554 554
555(defun eww-links-at-point (&optional pt) 555(defun eww-links-at-point ()
556 "Return list of URIs, if any, linked at point." 556 "Return list of URIs, if any, linked at point."
557 (remq nil 557 (remq nil
558 (list (get-text-property (point) 'shr-url) 558 (list (get-text-property (point) 'shr-url)
@@ -631,17 +631,13 @@ the like."
631 631
632(defvar eww-mode-map 632(defvar eww-mode-map
633 (let ((map (make-sparse-keymap))) 633 (let ((map (make-sparse-keymap)))
634 (suppress-keymap map) 634 (set-keymap-parent map special-mode-map)
635 (define-key map "q" 'quit-window) 635 (define-key map "g" 'eww-reload) ;FIXME: revert-buffer-function instead!
636 (define-key map "g" 'eww-reload)
637 (define-key map "G" 'eww) 636 (define-key map "G" 'eww)
638 (define-key map [?\t] 'shr-next-link) 637 (define-key map [?\t] 'shr-next-link)
639 (define-key map [?\M-\t] 'shr-previous-link) 638 (define-key map [?\M-\t] 'shr-previous-link)
640 (define-key map [backtab] 'shr-previous-link) 639 (define-key map [backtab] 'shr-previous-link)
641 (define-key map [delete] 'scroll-down-command) 640 (define-key map [delete] 'scroll-down-command)
642 (define-key map [?\S-\ ] 'scroll-down-command)
643 (define-key map "\177" 'scroll-down-command)
644 (define-key map " " 'scroll-up-command)
645 (define-key map "l" 'eww-back-url) 641 (define-key map "l" 'eww-back-url)
646 (define-key map "r" 'eww-forward-url) 642 (define-key map "r" 'eww-forward-url)
647 (define-key map "n" 'eww-next-url) 643 (define-key map "n" 'eww-next-url)
@@ -699,21 +695,19 @@ the like."
699 map) 695 map)
700 "Tool bar for `eww-mode'.") 696 "Tool bar for `eww-mode'.")
701 697
702(define-derived-mode eww-mode nil "eww" 698(define-derived-mode eww-mode special-mode "eww"
703 "Mode for browsing the web. 699 "Mode for browsing the web."
704
705\\{eww-mode-map}"
706 (setq-local eww-data (list :title "")) 700 (setq-local eww-data (list :title ""))
707 (setq-local browse-url-browser-function 'eww-browse-url) 701 (setq-local browse-url-browser-function #'eww-browse-url)
708 (setq-local after-change-functions 'eww-process-text-input) 702 (add-hook 'after-change-functions #'eww-process-text-input nil t)
709 (setq-local eww-history nil) 703 (setq-local eww-history nil)
710 (setq-local eww-history-position 0) 704 (setq-local eww-history-position 0)
711 (when (boundp 'tool-bar-map) 705 (when (boundp 'tool-bar-map)
712 (setq-local tool-bar-map eww-tool-bar-map)) 706 (setq-local tool-bar-map eww-tool-bar-map))
713 ;; desktop support 707 ;; desktop support
714 (setq-local desktop-save-buffer 'eww-desktop-misc-data) 708 (setq-local desktop-save-buffer #'eww-desktop-misc-data)
715 ;; multi-page isearch support 709 ;; multi-page isearch support
716 (setq-local multi-isearch-next-buffer-function 'eww-isearch-next-buffer) 710 (setq-local multi-isearch-next-buffer-function #'eww-isearch-next-buffer)
717 (setq truncate-lines t) 711 (setq truncate-lines t)
718 (buffer-disable-undo) 712 (buffer-disable-undo)
719 (setq buffer-read-only t)) 713 (setq buffer-read-only t))
@@ -1056,7 +1050,7 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
1056 (insert value) 1050 (insert value)
1057 (shr-ensure-newline) 1051 (shr-ensure-newline)
1058 (when (< (count-lines start (point)) lines) 1052 (when (< (count-lines start (point)) lines)
1059 (dotimes (i (- lines (count-lines start (point)))) 1053 (dotimes (_ (- lines (count-lines start (point))))
1060 (insert "\n"))) 1054 (insert "\n")))
1061 (setq end (point-marker)) 1055 (setq end (point-marker))
1062 (goto-char start) 1056 (goto-char start)
@@ -1848,7 +1842,7 @@ Also used when saving `eww-history'.")
1848 ;; . 1842 ;; .
1849 r)) 1843 r))
1850 1844
1851(defun eww-desktop-misc-data (directory) 1845(defun eww-desktop-misc-data (_directory)
1852 "Return a property list with data used to restore eww buffers. 1846 "Return a property list with data used to restore eww buffers.
1853This list will contain, as :history, the list, whose first element is 1847This list will contain, as :history, the list, whose first element is
1854the value of `eww-data', and the tail is `eww-history'. 1848the value of `eww-data', and the tail is `eww-history'.
@@ -1896,7 +1890,7 @@ Otherwise, the restored buffer will contain a prompt to do so by using
1896 1890
1897;;; Isearch support 1891;;; Isearch support
1898 1892
1899(defun eww-isearch-next-buffer (&optional buffer wrap) 1893(defun eww-isearch-next-buffer (&optional _buffer wrap)
1900 "Go to the next page to search using `rel' attribute for navigation." 1894 "Go to the next page to search using `rel' attribute for navigation."
1901 (if wrap 1895 (if wrap
1902 (condition-case nil 1896 (condition-case nil