Commit 6aeaa3dc authored by Karl Fogel's avatar Karl Fogel
Browse files

* lisp/bookmark.el: Formatting and doc fixes only:

  (bookmark-search-delay): Shorten doc string to fit in 80 columns.
  (bookmark-bmenu-search): Wrap to fit within 80 columns.  Minor
    grammar and punctuation fixes in doc string.
  (bookmark-read-search-input): Adjust to fit within 80 columns.
parent cc7748fb
2009-11-20 Karl Fogel <karl.fogel@red-bean.com>
* bookmark.el Formatting and doc fixes only:
(bookmark-search-delay): Shorten doc string to fit in 80 columns.
(bookmark-bmenu-search): Wrap to fit within 80 columns.
Minor grammar and punctuation fixes in doc string.
(bookmark-read-search-input): Adjust to fit within 80 columns.
2009-11-20 Tassilo Horn <tassilo@member.fsf.org> 2009-11-20 Tassilo Horn <tassilo@member.fsf.org>
* progmodes/cc-cmds.el (c-forward-into-nomenclature) * progmodes/cc-cmds.el (c-forward-into-nomenclature)
......
...@@ -198,7 +198,7 @@ following in your `.emacs' file: ...@@ -198,7 +198,7 @@ following in your `.emacs' file:
(defcustom bookmark-search-delay 0.2 (defcustom bookmark-search-delay 0.2
"*Display when searching bookmarks is updated all `bookmark-search-delay' seconds." "*When searching bookmarks, redisplay every `bookmark-search-delay' seconds."
:group 'bookmark :group 'bookmark
:type 'integer) :type 'integer)
...@@ -2102,7 +2102,8 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\ ...@@ -2102,7 +2102,8 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
(defun bookmark-read-search-input () (defun bookmark-read-search-input ()
"Read each keyboard input and add it to `bookmark-search-pattern'." "Read each keyboard input and add it to `bookmark-search-pattern'."
(setq bookmark-search-pattern "") ; Always reset pattern to empty string (setq bookmark-search-pattern "") ; Always reset pattern to empty string
(let ((prompt (propertize bookmark-search-prompt 'face '((:foreground "cyan")))) (let ((prompt (propertize bookmark-search-prompt
'face '((:foreground "cyan"))))
(inhibit-quit t) (inhibit-quit t)
(tmp-list ()) (tmp-list ())
char) char)
...@@ -2113,14 +2114,17 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\ ...@@ -2113,14 +2114,17 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
(setq char (read-char (concat prompt bookmark-search-pattern))) (setq char (read-char (concat prompt bookmark-search-pattern)))
(error (throw 'break nil))) (error (throw 'break nil)))
(case char (case char
((or ?\e ?\r) (throw 'break nil)) ; RET or ESC break search loop and lead to [1]. ((or ?\e ?\r) ; RET or ESC break search loop and lead to [1].
(?\d (pop tmp-list) ; Delete last char of `bookmark-search-pattern' with DEL (throw 'break nil))
(setq bookmark-search-pattern (mapconcat 'identity (reverse tmp-list) "")) (?\d (pop tmp-list) ; Delete last char of `bookmark-search-pattern'
(setq bookmark-search-pattern
(mapconcat 'identity (reverse tmp-list) ""))
(throw 'continue nil)) (throw 'continue nil))
(?\C-g (setq bookmark-quit-flag t) (throw 'break nil)) (?\C-g (setq bookmark-quit-flag t) (throw 'break nil))
(t (t
(push (text-char-description char) tmp-list) (push (text-char-description char) tmp-list)
(setq bookmark-search-pattern (mapconcat 'identity (reverse tmp-list) "")) (setq bookmark-search-pattern
(mapconcat 'identity (reverse tmp-list) ""))
(throw 'continue nil)))))))) (throw 'continue nil))))))))
...@@ -2138,17 +2142,20 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\ ...@@ -2138,17 +2142,20 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
;;;###autoload ;;;###autoload
(defun bookmark-bmenu-search () (defun bookmark-bmenu-search ()
"Incremental search of bookmarks matching `bookmark-search-pattern'. "Incrementally search bookmarks matching `bookmark-search-pattern'.
`bookmark-search-pattern' is build incrementally with `bookmark-read-search-input'" `bookmark-search-pattern' is built incrementally with
`bookmark-read-search-input'."
(interactive) (interactive)
(when (string= (buffer-name (current-buffer)) "*Bookmark List*") (when (string= (buffer-name (current-buffer)) "*Bookmark List*")
(let ((bmk (bookmark-bmenu-bookmark))) (let ((bmk (bookmark-bmenu-bookmark)))
(unwind-protect (unwind-protect
(progn (progn
(setq bookmark-search-timer (setq bookmark-search-timer
(run-with-idle-timer bookmark-search-delay 'repeat (run-with-idle-timer
#'(lambda () bookmark-search-delay 'repeat
(bookmark-bmenu-filter-alist-by-regexp bookmark-search-pattern)))) #'(lambda ()
(bookmark-bmenu-filter-alist-by-regexp
bookmark-search-pattern))))
(bookmark-read-search-input)) (bookmark-read-search-input))
(progn ; [1] Stop timer. (progn ; [1] Stop timer.
(bookmark-bmenu-cancel-search) (bookmark-bmenu-cancel-search)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment