Now on revision 111479. ------------------------------------------------------------ revno: 111479 author: Uwe Brauer (tiny change) committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-01-11 03:06:13 +0000 message: lisp/gnus/mml-smime.el: Add mml-smime-encrypt-to-self * mml-smime.el (mml-smime-encrypt-to-self): New user option analogous to mml2015-encrypt-to-self. (mml-smime-epg-encrypt): Respect mml-smime-encrypt-to-self. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-01-09 05:11:16 +0000 +++ lisp/gnus/ChangeLog 2013-01-11 03:06:13 +0000 @@ -1,3 +1,9 @@ +2013-01-10 Uwe Brauer (tiny change) + + * mml-smime.el (mml-smime-encrypt-to-self): New user option analogous + to mml2015-encrypt-to-self. + (mml-smime-epg-encrypt): Respect mml-smime-encrypt-to-self. + 2013-01-09 Daiki Ueno * mml-smime.el (epg-sub-key-fingerprint): Autoload for === modified file 'lisp/gnus/mml-smime.el' --- lisp/gnus/mml-smime.el 2013-01-09 05:11:16 +0000 +++ lisp/gnus/mml-smime.el 2013-01-11 03:06:13 +0000 @@ -80,6 +80,12 @@ :version "24.4" :type 'boolean) +(defcustom mml-smime-encrypt-to-self nil + "If t, add your own key ID to recipient list when encryption." + :group 'mime-security + :version "24.4" + :type 'boolean) + (defun mml-smime-sign (cont) (let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist)))) (if func @@ -475,13 +481,17 @@ (goto-char (point-max)))) (defun mml-smime-epg-encrypt (cont) - (let ((inhibit-redisplay t) - (context (epg-make-context 'CMS)) - (config (epg-configuration)) - (recipients (message-options-get 'mml-smime-epg-recipients)) - cipher signers - (boundary (mml-compute-boundary cont)) - recipient-key) + (let* ((inhibit-redisplay t) + (context (epg-make-context 'CMS)) + (config (epg-configuration)) + (recipients (message-options-get 'mml-smime-epg-recipients)) + cipher signers + (sender (message-options-get 'message-sender)) + (signer-names (or mml-smime-signers + (if (and mml-smime-sign-with-sender sender) + (list (concat "<" sender ">"))))) + (boundary (mml-compute-boundary cont)) + recipient-key) (unless recipients (setq recipients (apply #'nconc @@ -494,6 +504,10 @@ (message-options-set 'message-recipients (read-string "Recipients: "))) "[ \f\t\n\r\v,]+")))) + (when mml-smime-encrypt-to-self + (unless signer-names + (error "Neither message sender nor mml-smime-signers are set")) + (setq recipients (nconc recipients signer-names))) (if (eq mm-encrypt-option 'guided) (setq recipients (epa-select-keys context "\ ------------------------------------------------------------ revno: 111478 fixes bug: http://debbugs.gnu.org/13387 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-01-10 18:40:58 -0800 message: emacsclient -t should not suspend Emacs server * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal): New functions. * term.c (init_tty): Use them instead of rolling our own code. * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this switches from 'signal' to 'pthread_sigmask', which is safer in multithreaded applications. * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY, which has already arranged for that. (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY. This is the main part of the bug fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-10 17:45:08 +0000 +++ src/ChangeLog 2013-01-11 02:40:58 +0000 @@ -1,3 +1,17 @@ +2013-01-11 Paul Eggert + + emacsclient -t should not suspend Emacs server (Bug#13387) + * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal): + New functions. + * term.c (init_tty): Use them instead of rolling our own code. + * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this + switches from 'signal' to 'pthread_sigmask', which is safer in + multithreaded applications. + * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY, + which has already arranged for that. + (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY. + This is the main part of the bug fix. + 2013-01-10 Rainer Orth (tiny change) * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around === modified file 'src/lisp.h' --- src/lisp.h 2013-01-10 10:30:16 +0000 +++ src/lisp.h 2013-01-11 02:40:58 +0000 @@ -3462,6 +3462,8 @@ extern void sys_subshell (void); extern void sys_suspend (void); extern void discard_tty_input (void); +extern void block_tty_out_signal (void); +extern void unblock_tty_out_signal (void); extern void init_sys_modes (struct tty_display_info *); extern void reset_sys_modes (struct tty_display_info *); extern void init_all_sys_modes (void); === modified file 'src/sysdep.c' --- src/sysdep.c 2013-01-02 16:13:04 +0000 +++ src/sysdep.c 2013-01-11 02:40:58 +0000 @@ -714,6 +714,27 @@ inherited_pgroup = getpid () == pgrp ? 0 : pgrp; } +/* Block and unblock SIGTTOU. */ + +void +block_tty_out_signal (void) +{ +#ifdef SIGTTOU + sigset_t blocked; + sigemptyset (&blocked); + sigaddset (&blocked, SIGTTOU); + pthread_sigmask (SIG_BLOCK, &blocked, 0); +#endif +} + +void +unblock_tty_out_signal (void) +{ +#ifdef SIGTTOU + pthread_sigmask (SIG_SETMASK, &empty_mask, 0); +#endif +} + /* Safely set a controlling terminal FD's process group to PGID. If we are not in the foreground already, POSIX requires tcsetpgrp to deliver a SIGTTOU signal, which would stop us. This is an @@ -725,11 +746,10 @@ tcsetpgrp_without_stopping (int fd, pid_t pgid) { #ifdef SIGTTOU - signal_handler_t handler; block_input (); - handler = signal (SIGTTOU, SIG_IGN); + block_tty_out_signal (); tcsetpgrp (fd, pgid); - signal (SIGTTOU, handler); + unblock_tty_out_signal (); unblock_input (); #endif } === modified file 'src/term.c' --- src/term.c 2013-01-02 16:13:04 +0000 +++ src/term.c 2013-01-11 02:40:58 +0000 @@ -2423,7 +2423,7 @@ if (fd == -1) error ("Can not reopen tty device %s: %s", t->display_info.tty->name, strerror (errno)); - if (strcmp (t->display_info.tty->name, DEV_TTY)) + if (!O_IGNORE_CTTY && strcmp (t->display_info.tty->name, DEV_TTY) != 0) dissociate_if_controlling_tty (fd); t->display_info.tty->output = fdopen (fd, "w+"); @@ -2903,13 +2903,23 @@ terminal->delete_terminal_hook = &delete_tty; } -/* Drop the controlling terminal if fd is the same device. */ +/* If FD is the controlling terminal, drop it. */ static void dissociate_if_controlling_tty (int fd) { - pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ - if (0 <= pgid) - setsid (); + /* If tcgetpgrp succeeds, fd is the controlling terminal, + so dissociate it by invoking setsid. */ + if (0 <= tcgetpgrp (fd) && setsid () < 0) + { +#ifdef TIOCNOTTY + /* setsid failed, presumably because Emacs is already a process + group leader. Fall back on the obsolescent way to dissociate + a controlling tty. */ + block_tty_out_signal (); + ioctl (fd, TIOCNOTTY, 0); + unblock_tty_out_signal (); +#endif + } } /* Create a termcap display on the tty device with the given name and @@ -3030,14 +3040,9 @@ /* On some systems, tgetent tries to access the controlling terminal. */ - { - sigset_t blocked; - sigemptyset (&blocked); - sigaddset (&blocked, SIGTTOU); - pthread_sigmask (SIG_BLOCK, &blocked, 0); - status = tgetent (tty->termcap_term_buffer, terminal_type); - pthread_sigmask (SIG_UNBLOCK, &blocked, 0); - } + block_tty_out_signal (); + status = tgetent (tty->termcap_term_buffer, terminal_type); + unblock_tty_out_signal (); if (status < 0) { ------------------------------------------------------------ revno: 111477 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-01-10 21:26:15 +0100 message: * autorevert.el (auto-revert-notify-enabled): Move up. (auto-revert-use-notify): New defcustom. (auto-revert-mode, global-auto-revert-mode) (auto-revert-notify-add-watch, auto-revert-handler) (auto-revert-buffers): Use `auto-revert-use-notify' instead of `auto-revert-notify-enabled'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-10 15:50:04 +0000 +++ lisp/ChangeLog 2013-01-10 20:26:15 +0000 @@ -1,3 +1,12 @@ +2013-01-10 Michael Albinus + + * autorevert.el (auto-revert-notify-enabled): Move up. + (auto-revert-use-notify): New defcustom. + (auto-revert-mode, global-auto-revert-mode) + (auto-revert-notify-add-watch, auto-revert-handler) + (auto-revert-buffers): Use `auto-revert-use-notify' instead of + `auto-revert-notify-enabled'. + 2013-01-10 Elias Pipping * files.el (auto-mode-alist): Use doc-view for djvu files (bug#13164). === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-01-10 14:27:48 +0000 +++ lisp/autorevert.el 2013-01-10 20:26:15 +0000 @@ -49,7 +49,9 @@ ;; (except that your buffers will be reverted, of course). ;; ;; If Emacs is compiled with file watch support, notifications are -;; used instead of checking the time stamp of the files. +;; used instead of checking the time stamp of the files. You can +;; disable this by setting the user option `auto-revert-use-notify' to +;; nil. ;; ;; After reverting a file buffer, Auto Revert Mode normally puts point ;; at the same position that a regular manual revert would. However, @@ -257,6 +259,28 @@ This variable becomes buffer local when set in any fashion.") (make-variable-buffer-local 'global-auto-revert-ignore-buffer) +(defconst auto-revert-notify-enabled + (or (featurep 'inotify) (featurep 'w32notify)) + "Non-nil when Emacs has been compiled with file watch support.") + +(defcustom auto-revert-use-notify auto-revert-notify-enabled + "If non-nil Auto Revert Mode uses file watch functions. +This requires Emacs being compiled with file watch support (see +`auto-revert-notify-enabled'). You should set this variable +through Custom only." + :group 'auto-revert + :type 'boolean + :set (lambda (variable value) + (set-default variable (and auto-revert-notify-enabled value)) + (if (symbol-value variable) + (add-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch) + (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch) + (when auto-revert-notify-enabled + (dolist (buf (buffer-list)) + (with-current-buffer buf + (auto-revert-notify-rm-watch)))))) + :version "24.4") + ;; Internal variables: (defvar auto-revert-buffer-list () @@ -279,13 +303,6 @@ (set (make-local-variable 'auto-revert-tail-pos) (nth 7 (file-attributes buffer-file-name))))) -(defconst auto-revert-notify-enabled - (or (featurep 'inotify) (featurep 'w32notify)) - "Non-nil when Emacs has been compiled with file watch support.") - -(when auto-revert-notify-enabled - (add-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch)) - (defvar auto-revert-notify-watch-descriptor-hash-list (make-hash-table :test 'equal) "A hash table collecting all file watch descriptors. @@ -320,7 +337,7 @@ (if auto-revert-mode (if (not (memq (current-buffer) auto-revert-buffer-list)) (push (current-buffer) auto-revert-buffer-list)) - (when auto-revert-notify-enabled (auto-revert-notify-rm-watch)) + (when auto-revert-use-notify (auto-revert-notify-rm-watch)) (setq auto-revert-buffer-list (delq (current-buffer) auto-revert-buffer-list))) (auto-revert-set-timer) @@ -426,7 +443,7 @@ (auto-revert-set-timer) (if global-auto-revert-mode (auto-revert-buffers) - (when auto-revert-notify-enabled + (when auto-revert-use-notify (dolist (buf (buffer-list)) (with-current-buffer buf (auto-revert-notify-rm-watch)))))) @@ -458,7 +475,7 @@ (defun auto-revert-notify-add-watch () "Enable file watch for current buffer's associated file." - (when (and buffer-file-name auto-revert-notify-enabled) + (when (and buffer-file-name auto-revert-use-notify) (auto-revert-notify-rm-watch) (let ((func (if (fboundp 'inotify-add-watch) 'inotify-add-watch 'w32-add-watch)) @@ -506,7 +523,7 @@ (setq size (nth 7 (file-attributes buffer-file-name)))))) - (if auto-revert-notify-enabled + (if auto-revert-use-notify ;; There are file watches. auto-revert-notify-modified-p (and (not (file-remote-p buffer-file-name)) @@ -628,7 +645,7 @@ (delq buf auto-revert-buffer-list))) (when (auto-revert-active-p) ;; Enable file watches. - (when (and auto-revert-notify-enabled buffer-file-name + (when (and auto-revert-use-notify buffer-file-name (not auto-revert-notify-watch-descriptor) (auto-revert-notify-add-watch))) (auto-revert-handler))) ------------------------------------------------------------ revno: 111476 fixes bug: http://debbugs.gnu.org/13403 committer: Jan D. branch nick: trunk timestamp: Thu 2013-01-10 18:45:08 +0100 message: * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around x_last_font_name. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-10 10:30:16 +0000 +++ src/ChangeLog 2013-01-10 17:45:08 +0000 @@ -1,3 +1,8 @@ +2013-01-10 Rainer Orth (tiny change) + + * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around + x_last_font_name (Bug#13403). + 2013-01-10 Dmitry Antipov Omit buffer_slot_type_mismatch and use generic predicates to enforce === modified file 'src/gtkutil.c' --- src/gtkutil.c 2013-01-02 16:13:04 +0000 +++ src/gtkutil.c 2013-01-10 17:45:08 +0000 @@ -5041,7 +5041,9 @@ "cancel", 0); update_theme_scrollbar_width (); +#ifdef HAVE_FREETYPE x_last_font_name = NULL; +#endif } #endif /* USE_GTK */ ------------------------------------------------------------ revno: 111475 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13164 author: Elias Pipping committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-01-10 10:50:04 -0500 message: * lisp/files.el (auto-mode-alist): Use doc-view for djvu files. * lisp/doc-view.el (doc-view-document->bitmap): Use doc-view-single-page-converter-function instead of single-page-converter arg; adjust callers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-10 15:36:01 +0000 +++ lisp/ChangeLog 2013-01-10 15:50:04 +0000 @@ -1,3 +1,10 @@ +2013-01-10 Elias Pipping + + * files.el (auto-mode-alist): Use doc-view for djvu files (bug#13164). + * doc-view.el (doc-view-document->bitmap): + Use doc-view-single-page-converter-function instead of + single-page-converter arg; adjust callers. + 2013-01-10 Feng Li (tiny change) * progmodes/which-func.el (which-function): Understand Semantic's use === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2013-01-10 05:05:24 +0000 +++ lisp/doc-view.el 2013-01-10 15:50:04 +0000 @@ -942,7 +942,7 @@ (declare-function clear-image-cache "image.c" (&optional filter)) -(defun doc-view-document->bitmap (pdf png pages single-page-converter) +(defun doc-view-document->bitmap (pdf png pages) "Convert a document file to bitmap images asynchronously. Start by converting PAGES, and then the rest." (if (null pages) @@ -952,7 +952,7 @@ ;; a single page anyway, and of the remaining 1%, few cases will have ;; consecutive pages, it's not worth the trouble. (let ((rest (cdr pages))) - (funcall single-page-converter + (funcall doc-view-single-page-converter-function pdf (format png (car pages)) (car pages) (lambda () (if rest @@ -1066,8 +1066,7 @@ ((or `pdf `djvu) (let ((pages (doc-view-active-pages))) ;; Convert doc to bitmap images starting with the active pages. - (doc-view-document->bitmap doc-view-buffer-file-name png-file pages - doc-view-single-page-converter-function))) + (doc-view-document->bitmap doc-view-buffer-file-name png-file pages))) (_ ;; Convert to PNG images. (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) === modified file 'lisp/files.el' --- lisp/files.el 2013-01-04 02:53:48 +0000 +++ lisp/files.el 2013-01-10 15:50:04 +0000 @@ -2357,7 +2357,7 @@ ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG ("\\.[eE]?[pP][sS]\\'" . ps-mode) - ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) + ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) ("BROWSE\\'" . ebrowse-tree-mode) ------------------------------------------------------------ revno: 111474 author: Feng Li committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-01-10 10:36:01 -0500 message: * lisp/progmodes/which-func.el (which-function): Understand Semantic's use of overlays in imenu--index-alist. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-10 15:01:35 +0000 +++ lisp/ChangeLog 2013-01-10 15:36:01 +0000 @@ -1,3 +1,8 @@ +2013-01-10 Feng Li (tiny change) + + * progmodes/which-func.el (which-function): Understand Semantic's use + of overlays in imenu--index-alist. + 2013-01-10 Wolfgang Jenkner * man.el: Handle different "man -k" behaviors (bug#13160). Use utf-8. === modified file 'lisp/imenu.el' --- lisp/imenu.el 2013-01-02 16:13:04 +0000 +++ lisp/imenu.el 2013-01-10 15:36:01 +0000 @@ -447,6 +447,8 @@ Simple elements in the alist look like (INDEX-NAME . POSITION). POSITION is the buffer position of the item; to go to the item is simply to move point to that position. +POSITION is passed to `imenu-default-goto-function', so it can be a non-number +if that variable has been changed (e.g. Semantic uses overlays for POSITIONs). Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). To \"go to\" a special element means applying FUNCTION === modified file 'lisp/progmodes/which-func.el' --- lisp/progmodes/which-func.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/which-func.el 2013-01-10 15:36:01 +0000 @@ -319,7 +319,9 @@ namestack (cons (car pair) namestack) alist (cdr pair))) - ((number-or-marker-p (setq mark (cdr pair))) + ((or (number-or-marker-p (setq mark (cdr pair))) + (and (overlayp mark) + (setq mark (overlay-start mark)))) (when (and (>= (setq offset (- (point) mark)) 0) (< offset minoffset)) ; Find the closest item. (setq minoffset offset ------------------------------------------------------------ revno: 111473 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13160 author: Wolfgang Jenkner committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-01-10 10:01:35 -0500 message: * lisp/man.el: Handle different "man -k" behaviors. Use utf-8. (Man-man-k-use-anchor): New var. (Man-parse-man-k): New function. (Man-completion-table): Use it. (man): Flush the completion cache between uses. * test/automated/man-tests.el: New file. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-10 14:27:48 +0000 +++ lisp/ChangeLog 2013-01-10 15:01:35 +0000 @@ -1,3 +1,11 @@ +2013-01-10 Wolfgang Jenkner + + * man.el: Handle different "man -k" behaviors (bug#13160). Use utf-8. + (Man-man-k-use-anchor): New var. + (Man-parse-man-k): New function. + (Man-completion-table): Use it. + (man): Flush the completion cache between uses. + 2013-01-10 Michael Albinus * autorevert.el: Add file watch support. === modified file 'lisp/man.el' --- lisp/man.el 2013-01-01 09:11:05 +0000 +++ lisp/man.el 2013-01-10 15:01:35 +0000 @@ -1,4 +1,4 @@ -;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*- +;;; man.el --- browse UNIX manual pages -*- coding: utf-8 -*- ;; Copyright (C) 1993-1994, 1996-1997, 2001-2013 Free Software ;; Foundation, Inc. @@ -276,7 +276,7 @@ :type 'hook :group 'man) -(defvar Man-name-regexp "[-a-zA-Z0-9_­+][-a-zA-Z0-9_.:­+]*" +(defvar Man-name-regexp "[-a-zA-Z0-9_­+][-a-zA-Z0-9_.:­+]*" "Regular expression describing the name of a manpage (without section).") (defvar Man-section-regexp "[0-9][a-zA-Z0-9+]*\\|[LNln]" @@ -780,6 +780,59 @@ ;; but apparently that's not the case in all cases, so let's add a cache. "Cache of completion table of the form (PREFIX . TABLE).") +(defvar Man-man-k-use-anchor + ;; man-db or man-1.* + (memq system-type '(gnu gnu/linux gnu/kfreebsd)) + "If non-nil prepend ^ to the prefix passed to \"man -k\" for completion. +The value should be nil if \"man -k ^PREFIX\" may omit some man +pages whose names start with PREFIX. + +Currently, the default value depends on `system-type' and is +non-nil where the standard man programs are known to behave +properly. Setting the value to nil always gives correct results +but computing the list of completions may take a bit longer.") + +(defun Man-parse-man-k () + "Parse \"man -k\" output and return the list of page names. + +The current buffer should contain the output of a command of the +form \"man -k keyword\", which is traditionally also available with +apropos(1). + +While POSIX man(1p) is a bit vague about what to expect here, +this function tries to parse some commonly used formats, which +can be described in the following informal way, with square brackets +indicating optional parts and whitespace being interpreted +somewhat loosely. + +foo[, bar [, ...]] [other stuff] (sec) - description +foo(sec)[, bar(sec) [, ...]] [other stuff] - description + +For more details and some regression tests, please see +test/automated/man-tests.el in the emacs bzr repository." + (goto-char (point-min)) + ;; See man-tests for data about which systems use which format (hopefully we + ;; will be able to simplify the code if/when some of those formats aren't + ;; used any more). + (let (table) + (while (search-forward-regexp "^\\([^ \t,\n]+\\)\\(.*?\\)\ +\\(?:[ \t]\\(([^ \t,\n]+?)\\)\\)?\\(?:[ \t]+- ?\\(.*\\)\\)?$" nil t) + (let ((section (match-string 3)) + (description (match-string 4)) + (bound (match-end 2))) + (goto-char (match-end 1)) + (while + (progn + ;; The first regexp grouping may already match the section + ;; tacked on to the name, which is ok since for the formats we + ;; claim to support the third (non-shy) grouping does not + ;; match in this case, i.e., section is nil. + (push (propertize (concat (match-string 1) section) + 'help-echo description) + table) + (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t))))) + (nreverse table))) + (defun Man-completion-table (string pred action) (cond ;; This ends up returning t for pretty much any string, and hence leads to @@ -811,16 +864,15 @@ ;; run differently in Man-getpage-in-background, an error ;; here may not necessarily mean that we'll also get an ;; error later. - (ignore-errors - (call-process manual-program nil '(t nil) nil - "-k" (concat "^" prefix)))) - (goto-char (point-min)) - (while (re-search-forward "^\\([^ \t\n]+\\)\\(?: ?\\((.+?)\\)\\(?:[ \t]+- \\(.*\\)\\)?\\)?" nil t) - (push (propertize (concat (match-string 1) (match-string 2)) - 'help-echo (match-string 3)) - table))) - ;; Cache the table for later reuse. - (setq Man-completion-cache (cons prefix table))) + (ignore-errors + (call-process manual-program nil '(t nil) nil + "-k" (concat (when (or Man-man-k-use-anchor + (string-equal prefix "")) + "^") + prefix)))) + (setq table (Man-parse-man-k))) + ;; Cache the table for later reuse. + (setq Man-completion-cache (cons prefix table))) ;; The table may contain false positives since the match is made ;; by "man -k" not just on the manpage's name. (if section @@ -891,6 +943,7 @@ ;; ("man -k" is case-insensitive similarly, so the ;; table has everything available to complete) (completion-ignore-case t) + Man-completion-cache ;Don't cache across calls. (input (completing-read (format "Manual entry%s" (if (string= default-entry "") @@ -1395,7 +1448,7 @@ ;; Update len, in case a reference spans ;; more than two lines (paranoia). len (1- (length word)))) - (if (memq (aref word len) '(?- ?­)) + (if (memq (aref word len) '(?- ?­)) (setq hyphenated (substring word 0 len))) (and (string-match Man-reference-regexp word) (not (member word Man--refpages)) === modified file 'test/ChangeLog' --- test/ChangeLog 2013-01-09 21:29:27 +0000 +++ test/ChangeLog 2013-01-10 15:01:35 +0000 @@ -1,3 +1,7 @@ +2013-01-10 Wolfgang Jenkner + + * automated/man-tests.el: New file. + 2013-01-09 Aaron S. Hawley * automated/undo-tests.el (undo-test0): Adjust error to code change. === added file 'test/automated/man-tests.el' --- test/automated/man-tests.el 1970-01-01 00:00:00 +0000 +++ test/automated/man-tests.el 2013-01-10 15:01:35 +0000 @@ -0,0 +1,118 @@ +;;; man-tests.el --- Test suite for man. + +;; Copyright (C) 2013 Free Software Foundation, Inc. + +;; Author: Wolfgang Jenkner +;; Keywords: help, internal, unix + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) +(require 'man) + +(defconst man-tests-parse-man-k-tests + '(;; GNU/Linux: man-db-2.6.1 + ("\ +sin (3) - sine function +sinf (3) - sine function +sinl (3) - sine function" + . (#("sin(3)" 0 6 (help-echo "sine function")) #("sinf(3)" 0 7 (help-echo "sine function")) #("sinl(3)" 0 7 (help-echo "sine function")))) + ;; GNU/Linux: man-1.6g + ("\ +sin (3) - sine function +sinf [sin] (3) - sine function +sinl [sin] (3) - sine function" + . (#("sin(3)" 0 6 (help-echo "sine function")) #("sinf(3)" 0 7 (help-echo "sine function")) #("sinl(3)" 0 7 (help-echo "sine function")))) + ;; FreeBSD 9 + ("\ +sin(3), sinf(3), sinl(3) - sine functions" + . (#("sin(3)" 0 6 (help-echo "sine functions")) #("sinf(3)" 0 7 (help-echo "sine functions")) #("sinl(3)" 0 7 (help-echo "sine functions")))) + ;; SunOS, Solaris + ;; http://docs.oracle.com/cd/E19455-01/805-6331/usradm-7/index.html + ;; SunOS 4 + ("\ +tset, reset (1) - establish or restore terminal characteristics" + . (#("tset(1)" 0 7 (help-echo "establish or restore terminal characteristics")) #("reset(1)" 0 8 (help-echo "establish or restore terminal characteristics")))) + ;; SunOS 5.7, Solaris + ("\ +reset tset (1b) - establish or restore terminal characteristics +tset tset (1b) - establish or restore terminal characteristics" + . (#("reset(1b)" 0 8 (help-echo "establish or restore terminal characteristics")) #("tset(1b)" 0 7 (help-echo "establish or restore terminal characteristics")))) + ;; Minix 3 + ;; http://www.minix3.org/manpages/html5/whatis.html + ("\ +cawf, nroff (1) - C version of the nroff-like, Amazingly Workable (text) Formatter +whatis (5) - database of online manual pages" + . (#("cawf(1)" 0 7 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("nroff(1)" 0 8 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("whatis(5)" 0 9 (help-echo "database of online manual pages")))) + ;; HP-UX + ;; http://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/man.1.html + ;; Assuming that the line break in the zgrep description was + ;; introduced by the man page formatting. + ("\ +grep, egrep, fgrep (1) - search a file for a pattern +zgrep(1) - search possibly compressed files for a regular expression" + . (#("grep(1)" 0 7 (help-echo "search a file for a pattern")) #("egrep(1)" 0 8 (help-echo "search a file for a pattern")) #("fgrep(1)" 0 8 (help-echo "search a file for a pattern")) #("zgrep(1)" 0 8 (help-echo "search possibly compressed files for a regular expression")))) + ;; AIX + ;; http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.cmds/doc/aixcmds6/whatis.htm + ("\ +ls(1) -Displays the contents of a directory." + . (#("ls(1)" 0 5 (help-echo "Displays the contents of a directory.")))) + ;; https://www.ibm.com/developerworks/mydeveloperworks/blogs/cgaix/entry/catman_0703_102_usr_lbin_mkwhatis_the_error_number_is_1?lang=en + ("\ +loopmount(1) - Associate an image file to a loopback device." + . (#("loopmount(1)" 0 12 (help-echo "Associate an image file to a loopback device.")))) + ) + "List of tests for `Man-parse-man-k'. +Each element is a cons cell whose car is a string containing +man -k output. That should result in the table which is stored +in the cdr of the element.") + +(defun man-tests-name-equal-p (name description string) + (and (equal name string) + (not (next-single-property-change 0 'help-echo string)) + (equal (get-text-property 0 'help-echo string) description))) + +(defun man-tests-parse-man-k-test-case (test) + (let ((temp-buffer (get-buffer-create " *test-man*")) + (man-k-output (car test))) + (unwind-protect + (save-window-excursion + (with-current-buffer temp-buffer + (erase-buffer) + (insert man-k-output) + (let ((result (Man-parse-man-k)) + (checklist (cdr test))) + (while (and checklist result + (man-tests-name-equal-p + (car checklist) + (get-text-property 0 'help-echo + (car checklist)) + (pop result))) + (pop checklist)) + (and (null checklist) (null result))))) + (and (buffer-name temp-buffer) + (kill-buffer temp-buffer))))) + +(ert-deftest man-tests () + "Test man." + (dolist (test man-tests-parse-man-k-tests) + (should (man-tests-parse-man-k-test-case test)))) + +(provide 'man-tests) + +;;; man-tests.el ends here ------------------------------------------------------------ revno: 111472 committer: Michael Albinus + + * autorevert.el: Add file watch support. + (auto-revert-notify-enabled): New defconst. + (auto-revert-notify-watch-descriptor-hash-list) + (auto-revert-notify-watch-descriptor) + (auto-revert-notify-modified-p): New defvars. + (auto-revert-notify-rm-watch, auto-revert-notify-add-watch) + (auto-revert-notify-handler): New defuns. + (auto-revert-mode, global-auto-revert-mode): Remove file watches + when mode is disabled. + (auto-revert-handler): Check for `auto-revert-notify-modified-p'. + (auto-revert-buffers): Add file watches for active buffers. + 2013-01-10 Dmitry Antipov * cus-start.el (toplevel): Only allow float values for === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-01-01 09:11:05 +0000 +++ lisp/autorevert.el 2013-01-10 14:27:48 +0000 @@ -48,6 +48,9 @@ ;; Emacs. You should never even notice that this package is active ;; (except that your buffers will be reverted, of course). ;; +;; If Emacs is compiled with file watch support, notifications are +;; used instead of checking the time stamp of the files. +;; ;; After reverting a file buffer, Auto Revert Mode normally puts point ;; at the same position that a regular manual revert would. However, ;; there is one exception to this rule. If point is at the end of the @@ -276,6 +279,27 @@ (set (make-local-variable 'auto-revert-tail-pos) (nth 7 (file-attributes buffer-file-name))))) +(defconst auto-revert-notify-enabled + (or (featurep 'inotify) (featurep 'w32notify)) + "Non-nil when Emacs has been compiled with file watch support.") + +(when auto-revert-notify-enabled + (add-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch)) + +(defvar auto-revert-notify-watch-descriptor-hash-list + (make-hash-table :test 'equal) + "A hash table collecting all file watch descriptors. +Hash key is a watch descriptor, hash value is the corresponding buffer.") + +(defvar auto-revert-notify-watch-descriptor nil + "The file watch descriptor active for the current buffer.") +(make-variable-buffer-local 'auto-revert-notify-watch-descriptor) + +(defvar auto-revert-notify-modified-p nil + "Non-nil when file has been modified on the file system. +This has been reported by a file watch event.") +(make-variable-buffer-local 'auto-revert-notify-modified-p) + ;; Functions: ;;;###autoload @@ -296,6 +320,7 @@ (if auto-revert-mode (if (not (memq (current-buffer) auto-revert-buffer-list)) (push (current-buffer) auto-revert-buffer-list)) + (when auto-revert-notify-enabled (auto-revert-notify-rm-watch)) (setq auto-revert-buffer-list (delq (current-buffer) auto-revert-buffer-list))) (auto-revert-set-timer) @@ -399,9 +424,12 @@ specifies in the mode line." :global t :group 'auto-revert :lighter global-auto-revert-mode-text (auto-revert-set-timer) - (when global-auto-revert-mode - (auto-revert-buffers))) - + (if global-auto-revert-mode + (auto-revert-buffers) + (when auto-revert-notify-enabled + (dolist (buf (buffer-list)) + (with-current-buffer buf + (auto-revert-notify-rm-watch)))))) (defun auto-revert-set-timer () "Restart or cancel the timer used by Auto-Revert Mode. @@ -418,6 +446,39 @@ auto-revert-interval 'auto-revert-buffers)))) +(defun auto-revert-notify-rm-watch () + "Disable file watch for current buffer's associated file." + (when auto-revert-notify-watch-descriptor + (funcall (if (fboundp 'inotify-rm-watch) 'inotify-rm-watch 'w32-rm-watch) + auto-revert-notify-watch-descriptor) + (remhash auto-revert-notify-watch-descriptor + auto-revert-notify-watch-descriptor-hash-list)) + (setq auto-revert-notify-watch-descriptor nil + auto-revert-notify-modified-p nil)) + +(defun auto-revert-notify-add-watch () + "Enable file watch for current buffer's associated file." + (when (and buffer-file-name auto-revert-notify-enabled) + (auto-revert-notify-rm-watch) + (let ((func (if (fboundp 'inotify-add-watch) + 'inotify-add-watch 'w32-add-watch)) + (aspect (if (fboundp 'inotify-add-watch) + '(close-write) '(last-write-time)))) + (setq auto-revert-notify-watch-descriptor + (funcall func buffer-file-name aspect 'auto-revert-notify-handler)) + (puthash auto-revert-notify-watch-descriptor + (current-buffer) + auto-revert-notify-watch-descriptor-hash-list)))) + +(defun auto-revert-notify-handler (event) + "Handle an event returned from file watch." + (when (listp event) + (let ((buffer + (gethash (car event) auto-revert-notify-watch-descriptor-hash-list))) + (when (bufferp buffer) + (with-current-buffer buffer + (setq auto-revert-notify-modified-p t)))))) + (defun auto-revert-active-p () "Check if auto-revert is active (in current buffer or globally)." (or auto-revert-mode @@ -445,9 +506,12 @@ (setq size (nth 7 (file-attributes buffer-file-name)))))) - (and (not (file-remote-p buffer-file-name)) - (file-readable-p buffer-file-name) - (not (verify-visited-file-modtime buffer))))) + (if auto-revert-notify-enabled + ;; There are file watches. + auto-revert-notify-modified-p + (and (not (file-remote-p buffer-file-name)) + (file-readable-p buffer-file-name) + (not (verify-visited-file-modtime buffer)))))) (and (or auto-revert-mode global-auto-revert-non-file-buffers) revert-buffer-function @@ -456,6 +520,7 @@ (funcall buffer-stale-function t)))) eob eoblist) (when revert + (setq auto-revert-notify-modified-p nil) (when (and auto-revert-verbose (not (eq revert 'fast))) (message "Reverting buffer `%s'." (buffer-name))) @@ -561,7 +626,12 @@ (memq buf auto-revert-buffer-list)) (setq auto-revert-buffer-list (delq buf auto-revert-buffer-list))) - (when (auto-revert-active-p) (auto-revert-handler))) + (when (auto-revert-active-p) + ;; Enable file watches. + (when (and auto-revert-notify-enabled buffer-file-name + (not auto-revert-notify-watch-descriptor) + (auto-revert-notify-add-watch))) + (auto-revert-handler))) ;; Remove dead buffer from `auto-revert-buffer-list'. (setq auto-revert-buffer-list (delq buf auto-revert-buffer-list)))) ------------------------------------------------------------ revno: 111471 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-01-10 14:30:16 +0400 message: Omit buffer_slot_type_mismatch and use generic predicates to enforce the type of per-buffer values where appropriate. * src/lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to predicate, which is how it's really used now. Adjust comment. * src/buffer.h (buffer_slot_type_mismatch): Remove prototype. * src/buffer.c (buffer_slot_type_mismatch): Remove. (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to predicate. Adjust comment. (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for fill-column, left-margin, tab-width, buffer-saved-size, left-margin-width, right-margin-width, left-fringe-width, right-fringe-width, scroll-bar-width and buffer-display-count. Use Qstringp for default-directory, buffer-file-name, buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for line-spacing. * src/data.c (store_symval_forwarding): Adjust to call the predicate. * lisp/cus-start.el (toplevel): Only allow float values for scroll-up-aggressively and scroll-down-aggressively. Allow any number for line-spacing. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-10 05:05:24 +0000 +++ lisp/ChangeLog 2013-01-10 10:30:16 +0000 @@ -1,3 +1,9 @@ +2013-01-10 Dmitry Antipov + + * cus-start.el (toplevel): Only allow float values for + scroll-up-aggressively and scroll-down-aggressively. + Allow any number for line-spacing. + 2013-01-10 Stefan Monnier * doc-view.el (doc-view-pdfdraw-program): Allow "pdfdraw" name. === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2013-01-02 16:13:04 +0000 +++ lisp/cus-start.el 2013-01-10 10:30:16 +0000 @@ -115,12 +115,12 @@ (const :tag "On the right" (down . right)))) (other :tag "On left, no arrows" t))) (scroll-up-aggressively windows - (choice (const :tag "off" nil) number) + (choice (const :tag "off" nil) float) "21.1") (scroll-down-aggressively windows - (choice (const :tag "off" nil) number) + (choice (const :tag "off" nil) float) "21.1") - (line-spacing display (choice (const :tag "none" nil) integer) + (line-spacing display (choice (const :tag "none" nil) number) "22.1") (cursor-in-non-selected-windows cursor boolean nil === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-09 15:07:01 +0000 +++ src/ChangeLog 2013-01-10 10:30:16 +0000 @@ -1,3 +1,23 @@ +2013-01-10 Dmitry Antipov + + Omit buffer_slot_type_mismatch and use generic predicates to enforce + the type of per-buffer values where appropriate. + * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to + predicate, which is how it's really used now. Adjust comment. + * buffer.h (buffer_slot_type_mismatch): Remove prototype. + * buffer.c (buffer_slot_type_mismatch): Remove. + (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to + predicate. Adjust comment. + (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for + fill-column, left-margin, tab-width, buffer-saved-size, + left-margin-width, right-margin-width, left-fringe-width, + right-fringe-width, scroll-bar-width and buffer-display-count. + Use Qstringp for default-directory, buffer-file-name, + buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for + scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for + line-spacing. + * data.c (store_symval_forwarding): Adjust to call the predicate. + 2013-01-09 Juanma Barranquero * w32.c (get_name_and_id, acl_set_file): === modified file 'src/buffer.c' --- src/buffer.c 2013-01-09 13:50:22 +0000 +++ src/buffer.c 2013-01-10 10:30:16 +0000 @@ -4576,27 +4576,7 @@ for (; CONSP (hit_list); hit_list = XCDR (hit_list)) Fdelete_overlay (XCAR (hit_list)); } - -/* Somebody has tried to store a value with an unacceptable type - in the slot with offset OFFSET. */ - -void -buffer_slot_type_mismatch (Lisp_Object newval, int type) -{ - Lisp_Object predicate; - - switch (type) - { - case_Lisp_Int: predicate = Qintegerp; break; - case Lisp_String: predicate = Qstringp; break; - case Lisp_Symbol: predicate = Qsymbolp; break; - default: emacs_abort (); - } - - wrong_type_argument (predicate, newval); -} - - + /*********************************************************************** Allocation with mmap ***********************************************************************/ @@ -5370,25 +5350,23 @@ free (pwd); } -/* Similar to defvar_lisp but define a variable whose value is the Lisp - Object stored in the current buffer. address is the address of the slot - in the buffer that is current now. */ +/* Similar to defvar_lisp but define a variable whose value is the + Lisp_Object stored in the current buffer. LNAME is the Lisp-level + variable name. VNAME is the name of the buffer slot. PREDICATE + is nil for a general Lisp variable. If PREDICATE is non-nil, then + only Lisp values that satisfies the PREDICATE are allowed (except + that nil is allowed too). DOC is a dummy where you write the doc + string as a comment. */ -/* TYPE is nil for a general Lisp variable. - An integer specifies a type; then only Lisp values - with that type code are allowed (except that nil is allowed too). - LNAME is the Lisp-level variable name. - VNAME is the name of the buffer slot. - DOC is a dummy where you write the doc string as a comment. */ -#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \ - do { \ - static struct Lisp_Buffer_Objfwd bo_fwd; \ - defvar_per_buffer (&bo_fwd, lname, vname, type); \ +#define DEFVAR_PER_BUFFER(lname, vname, predicate, doc) \ + do { \ + static struct Lisp_Buffer_Objfwd bo_fwd; \ + defvar_per_buffer (&bo_fwd, lname, vname, predicate); \ } while (0) static void defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, - Lisp_Object *address, Lisp_Object type) + Lisp_Object *address, Lisp_Object predicate) { struct Lisp_Symbol *sym; int offset; @@ -5398,7 +5376,7 @@ bo_fwd->type = Lisp_Fwd_Buffer_Obj; bo_fwd->offset = offset; - bo_fwd->slottype = type; + bo_fwd->predicate = predicate; sym->declared_special = 1; sym->redirect = SYMBOL_FORWARDED; { @@ -5661,7 +5639,7 @@ doc: /* Value of `major-mode' for new buffers. */); DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode), - make_number (Lisp_Symbol), + Qsymbolp, doc: /* Symbol for current buffer's major mode. The default value (normally `fundamental-mode') affects new buffers. A value of nil means to use the current buffer's major mode, provided @@ -5692,17 +5670,17 @@ doc: /* Non-nil if searches and matches should ignore case. */); DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), - make_number (Lisp_Int0), + Qintegerp, doc: /* Column beyond which automatic line-wrapping should happen. Interactively, you can set the buffer local value using \\[set-fill-column]. */); DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin), - make_number (Lisp_Int0), + Qintegerp, doc: /* Column for the default `indent-line-function' to indent to. Linefeed indents to this column in Fundamental mode. */); DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), - make_number (Lisp_Int0), + Qintegerp, doc: /* Distance between tab stops (for display of tab characters), in columns. This should be an integer greater than zero. */); @@ -5787,7 +5765,7 @@ `visual-line-mode'. */); DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory), - make_number (Lisp_String), + Qstringp, doc: /* Name of default directory of current buffer. Should end with slash. To interactively change the default directory, use command `cd'. */); @@ -5800,18 +5778,18 @@ its value may not be a list of functions. */); DEFVAR_PER_BUFFER ("buffer-file-name", &BVAR (current_buffer, filename), - make_number (Lisp_String), + Qstringp, doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); DEFVAR_PER_BUFFER ("buffer-file-truename", &BVAR (current_buffer, file_truename), - make_number (Lisp_String), + Qstringp, doc: /* Abbreviated truename of file visited in current buffer, or nil if none. The truename of a file is calculated by `file-truename' and then abbreviated with `abbreviate-file-name'. */); DEFVAR_PER_BUFFER ("buffer-auto-save-file-name", &BVAR (current_buffer, auto_save_file_name), - make_number (Lisp_String), + Qstringp, doc: /* Name of file for auto-saving current buffer. If it is nil, that means don't auto-save this buffer. */); @@ -5823,7 +5801,7 @@ Backing up is done before the first time the file is saved. */); DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length), - make_number (Lisp_Int0), + Qintegerp, doc: /* Length of current buffer when last read in, saved or auto-saved. 0 initially. -1 means auto-saving turned off until next real save. @@ -5893,23 +5871,23 @@ See also the functions `display-table-slot' and `set-display-table-slot'. */); DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols), - Qnil, + Qintegerp, doc: /* Width of left marginal area for display of a buffer. A value of nil means no marginal area. */); DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols), - Qnil, + Qintegerp, doc: /* Width of right marginal area for display of a buffer. A value of nil means no marginal area. */); DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width), - Qnil, + Qintegerp, doc: /* Width of this buffer's left fringe (in pixels). A value of 0 means no left fringe is shown in this buffer's window. A value of nil means to use the left fringe width from the window's frame. */); DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width), - Qnil, + Qintegerp, doc: /* Width of this buffer's right fringe (in pixels). A value of 0 means no right fringe is shown in this buffer's window. A value of nil means to use the right fringe width from the window's frame. */); @@ -5920,7 +5898,7 @@ A value of nil means to display fringes between margins and buffer text. */); DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width), - Qnil, + Qintegerp, doc: /* Width of this buffer's scroll bars in pixels. A value of nil means to use the scroll bar width from the window's frame. */); @@ -6000,7 +5978,7 @@ cursor type. */); DEFVAR_PER_BUFFER ("scroll-up-aggressively", - &BVAR (current_buffer, scroll_up_aggressively), Qnil, + &BVAR (current_buffer, scroll_up_aggressively), Qfloatp, doc: /* How far to scroll windows upward. If you move point off the bottom, the window scrolls automatically. This variable controls how far it scrolls. The value nil, the default, @@ -6013,7 +5991,7 @@ between 0.0 and 1.0, inclusive. */); DEFVAR_PER_BUFFER ("scroll-down-aggressively", - &BVAR (current_buffer, scroll_down_aggressively), Qnil, + &BVAR (current_buffer, scroll_down_aggressively), Qfloatp, doc: /* How far to scroll windows downward. If you move point off the top, the window scrolls automatically. This variable controls how far it scrolls. The value nil, the default, @@ -6167,7 +6145,7 @@ and they have an ellipsis as well if ELLIPSIS is non-nil. */); DEFVAR_PER_BUFFER ("buffer-display-count", - &BVAR (current_buffer, display_count), Qnil, + &BVAR (current_buffer, display_count), Qintegerp, doc: /* A number incremented each time this buffer is displayed in a window. The function `set-window-buffer' increments it. */); @@ -6226,7 +6204,7 @@ `cursor-in-non-selected-windows'. */); DEFVAR_PER_BUFFER ("line-spacing", - &BVAR (current_buffer, extra_line_spacing), Qnil, + &BVAR (current_buffer, extra_line_spacing), Qnumberp, doc: /* Additional space to put between lines when displaying a buffer. The space is measured in pixels, and put below lines on graphic displays, see `display-graphic-p'. === modified file 'src/buffer.h' --- src/buffer.h 2013-01-09 13:50:22 +0000 +++ src/buffer.h 2013-01-10 10:30:16 +0000 @@ -1078,7 +1078,6 @@ extern void set_buffer_temp (struct buffer *); extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); extern void record_buffer (Lisp_Object); -extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); extern void mmap_set_vars (bool); === modified file 'src/data.c' --- src/data.c 2013-01-02 16:13:04 +0000 +++ src/data.c 2013-01-10 10:30:16 +0000 @@ -914,13 +914,11 @@ case Lisp_Fwd_Buffer_Obj: { int offset = XBUFFER_OBJFWD (valcontents)->offset; - Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; + Lisp_Object predicate = XBUFFER_OBJFWD (valcontents)->predicate; - if (!(NILP (type) || NILP (newval) - || (XINT (type) == Lisp_Int0 - ? INTEGERP (newval) - : XTYPE (newval) == XINT (type)))) - buffer_slot_type_mismatch (newval, XINT (type)); + if (!NILP (predicate) && !NILP (newval) + && NILP (call1 (predicate, newval))) + wrong_type_argument (predicate, newval); if (buf == NULL) buf = current_buffer; === modified file 'src/lisp.h' --- src/lisp.h 2013-01-09 13:50:22 +0000 +++ src/lisp.h 2013-01-10 10:30:16 +0000 @@ -1450,7 +1450,8 @@ { enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */ int offset; - Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */ + /* One of Qnil, Qintegerp, Qsymbolp, Qstringp, Qfloatp or Qnumberp. */ + Lisp_Object predicate; }; /* struct Lisp_Buffer_Local_Value is used in a symbol value cell when ------------------------------------------------------------ revno: 111470 committer: Michael Albinus + + * tramp.texi (Default Host): Introduce `tramp-default-host-alist'. + 2013-01-09 Bastien Guerry * org.texi (Pushing to MobileOrg): Add footnote about using === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-01-05 21:18:01 +0000 +++ doc/misc/tramp.texi 2013-01-10 07:34:48 +0000 @@ -1279,8 +1279,8 @@ @end lisp @noindent -See the documentation for the variable -@code{tramp-default-user-alist} for more details. +See the documentation for the variable @code{tramp-default-user-alist} +for more details. One trap to fall in must be known. If @value{tramp} finds a default user, this user will be passed always to the connection command as @@ -1338,6 +1338,18 @@ because @samp{/:} is the prefix for quoted file names. @end ifset +@vindex tramp-default-host-alist +Like with methods and users, you can also specify different default +hosts for certain method/user combinations via the variable +@code{tramp-default-host-alist}. Usually, this isn't necessary, +because @code{tramp-default-host} should be sufficient. For some +methods, like @code{adb}, that default value must be overwritten, +which is already the initial value of @code{tramp-default-host-alist}. + +@noindent +See the documentation for the variable @code{tramp-default-host-alist} +for more details. + @node Multi-hops @section Connecting to a remote host using multiple hops