+2010-04-12 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * woman.el (woman-bookmark-make-record, woman-bookmark-jump):
+ New functions.
+ (woman-mode): Setup bookmark support.
+
+ * man.el (man-set-default-bookmark-title, man-bookmark-make-record)
+ (man-bookmark-jump): New functions.
+ (Man-mode): Setup bookmark support.
+
2010-04-10 Jari Aalto <jari.aalto@cante.net>
* comint.el (comint-password-prompt-regexp): Use regexp-opt, and
* net/tramp.el (tramp-completion-function-alist)
(tramp-file-name-regexp, tramp-chunksize)
- (tramp-local-coding-commands, tramp-remote-coding-commands): Fix
- docstring.
- (tramp-remote-process-environment): Use `format' instead of
- `concat'.
+ (tramp-local-coding-commands, tramp-remote-coding-commands):
+ Fix docstring.
+ (tramp-remote-process-environment): Use `format' instead of `concat'.
(tramp-handle-directory-files-and-attributes)
(tramp-get-remote-path): Use `copy-tree'.
(tramp-handle-file-name-all-completions): Backward/ XEmacs
`read-file-name-completion-ignore-case' does not exist.
(tramp-do-copy-or-rename-file-directly): Do not use
`tramp-handle-file-remote-p'.
- (tramp-do-copy-or-rename-file-out-of-band): Use
- `tramp-compat-delete-directory'.
+ (tramp-do-copy-or-rename-file-out-of-band):
+ Use `tramp-compat-delete-directory'.
(tramp-do-copy-or-rename-file-out-of-band)
- (tramp-compute-multi-hops, tramp-maybe-open-connection): Use
- `format-spec-make'.
+ (tramp-compute-multi-hops, tramp-maybe-open-connection):
+ Use `format-spec-make'.
(tramp-find-foreign-file-name-handler)
(tramp-advice-make-auto-save-file-name)
(tramp-set-auto-save-file-modes): Remove superfluous check for
(tramp-check-for-regexp): Use (forward-line 1).
(tramp-set-auto-save-file-modes): Adapt version check.
- * net/tramp-compat.el (tramp-advice-file-expand-wildcards): Wrap
- call of `featurep' for 2nd argument.
+ * net/tramp-compat.el (tramp-advice-file-expand-wildcards):
+ Wrap call of `featurep' for 2nd argument.
(tramp-compat-make-temp-file): Simplify fallback implementation.
(tramp-compat-copy-tree): Remove function.
(tramp-compat-delete-directory): Provide implementation for older
Add --author support to git commit.
* vc-git.el (vc-git-checkin): Pass extra-args to the commit command.
(vc-git-log-edit-mode): New minor mode.
- (log-edit-mode, log-edit-extra-flags, log-edit-mode): New
- declarations.
+ (log-edit-mode, log-edit-extra-flags, log-edit-mode):
+ New declarations.
2010-04-09 Eric Raymond <esr@snark.thyrsus.com>
+2010-04-12 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * gnus-sum.el (gnus-summary-bookmark-make-record)
+ (gnus-summary-bookmark-jump): New functions.
+ (gnus-summary-mode): Setup bookmark support.
+
2010-04-01 Andreas Schwab <schwab@linux-m68k.org>
* mm-uu.el (mm-uu-pgp-signed-extract-1): Use buffer-file-coding-system
(gnus-run-mode-hooks 'gnus-summary-mode-hook)
(turn-on-gnus-mailing-list-mode)
(mm-enable-multibyte)
+ ;; Bookmark support.
+ (set (make-local-variable 'bookmark-make-record-function)
+ 'gnus-summary-bookmark-make-record)
(gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
(gnus-update-summary-mark-positions))
(gnus-summary-limit (gnus-sorted-nunion old new))))
(gnus-summary-position-point)))
+;;; BOOKMARK support for GNUS.
+
+(defun gnus-summary-bookmark-make-record ()
+ "Make a bookmark entry for a Gnus buffer."
+ (require 'gnus)
+ (unless (and (eq major-mode 'gnus-summary-mode) gnus-article-current)
+ (error "Please retry from the Gnus summary buffer")) ;[1]
+ (let* ((subject (elt (gnus-summary-article-header) 1))
+ (grp (car gnus-article-current))
+ (art (cdr gnus-article-current))
+ (head (gnus-summary-article-header art))
+ (id (mail-header-id head)))
+ `(,subject
+ ,@(bookmark-make-record-default 'point-only)
+ (group . ,grp) (article . ,art)
+ (message-id . ,id) (handler . gnus-summary-bookmark-jump))))
+
+
+(defun gnus-summary-bookmark-jump (bookmark)
+ "Handler function for record returned by `gnus-summary-bookmark-make-record'.
+BOOKMARK is a bookmark name or a bookmark record."
+ (let ((group (bookmark-prop-get bookmark 'group))
+ (article (bookmark-prop-get bookmark 'article))
+ (id (bookmark-prop-get bookmark 'message-id))
+ buf)
+ (gnus-fetch-group group (list article))
+ (gnus-summary-insert-cached-articles)
+ (gnus-summary-goto-article id nil 'force)
+ (setq buf (current-buffer))
+ (bookmark-default-handler
+ `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark)))))
+
(gnus-summary-make-all-marking-commands)
(gnus-ems-redefine)
:type '(repeat string)
:group 'man)
+(defcustom Man-name-local-regexp "^NOM$"
+ "*The translation of the uppercase word NAME in your language.
+Used in `bookmark-set' to get the default bookmark name."
+ :type 'string :group 'bookmark)
+
(defvar manual-program "man"
"The name of the program that produces man pages.")
(setq imenu-generic-expression (list (list nil Man-heading-regexp 0)))
(set (make-local-variable 'outline-regexp) Man-heading-regexp)
(set (make-local-variable 'outline-level) (lambda () 1))
+ ;; Bookmark support.
+ (set (make-local-variable 'bookmark-make-record-function)
+ 'man-bookmark-make-record)
(Man-build-page-list)
(Man-strip-page-headers)
(Man-unindent)
(setq path nil))
(setq complete-path nil)))
complete-path))
+
+;;; Bookmark Man Support
+
+(defun man-set-default-bookmark-title ()
+ "Set default bookmark title for Man or woman page based \
+on NAME or `Man-name-local-regexp' entry."
+ (save-excursion
+ (goto-char (point-min))
+ (when (or (re-search-forward Man-name-local-regexp nil t)
+ (re-search-forward "^NAME$" nil t))
+ (forward-line 1)
+ (unless (> (skip-chars-forward " ") 0)
+ (skip-chars-forward "\t"))
+ (buffer-substring-no-properties (point) (line-end-position)))))
+
+(defun man-bookmark-make-record ()
+ "Make a bookmark entry for a Man buffer."
+ `(,(man-set-default-bookmark-title)
+ ,@(bookmark-make-record-default 'point-only)
+ (buffer-name . ,(buffer-name (current-buffer)))
+ (handler . man-bookmark-jump)))
+
+(defun man-bookmark-jump (bookmark)
+ "Default bookmark handler for Man buffers."
+ (let* ((buf (bookmark-prop-get bookmark 'buffer-name))
+ (buf-lst (split-string buf))
+ (node (replace-regexp-in-string "\*" "" (car (last buf-lst))))
+ (ind (when (> (length buf-lst) 2) (second buf-lst)))
+ (Man-notify-method (case bookmark-jump-display-function
+ ('switch-to-buffer 'pushy)
+ ('switch-to-buffer-other-window 'friendly)
+ ('display-buffer 'quiet)
+ (t 'friendly))))
+ (man (if ind (format "%s(%s)" node ind) node))
+ (while (get-process "man") (sit-for 1))
+ (bookmark-default-handler
+ `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark)))))
+
\f
;; Init the man package variables, if not already done.
(Man-init-defvars)
;; `make-local-variable' in case imenu not yet loaded!
woman-imenu-generic-expression)
(set (make-local-variable 'imenu-space-replacement) " ")
+ ;; Bookmark support.
+ (set (make-local-variable 'bookmark-make-record-function)
+ 'woman-bookmark-make-record)
;; For reformat ...
;; necessary when reformatting a file in its old buffer:
(setq imenu--last-menubar-index-alist nil)
(recenter 0))))))))
nil) ; for woman-file-readable-p etc.
+;;; Bookmark Woman support.
+
+(defun woman-bookmark-make-record ()
+ "Make a bookmark entry for a Woman buffer."
+ `(,(man-set-default-bookmark-title)
+ ,@(bookmark-make-record-default 'point-only)
+ (filename . ,woman-last-file-name)
+ (handler . woman-bookmark-jump)))
+
+
+(defun woman-bookmark-jump (bookmark)
+ "Default bookmark handler for Woman buffers."
+ (let* ((file (bookmark-prop-get bookmark 'filename))
+ (buf (save-window-excursion
+ (woman-find-file file) (current-buffer))))
+ (bookmark-default-handler
+ `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark)))))
+
(provide 'woman)
;; arch-tag: eea35e90-552f-4712-a94b-d9ffd3db7651