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

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

Re: [21.3] [patch] M-x man does not pick word 'snmpd.conf(5)'


From: Andreas Schwab
Subject: Re: [21.3] [patch] M-x man does not pick word 'snmpd.conf(5)'
Date: Sun, 21 Nov 2004 21:06:38 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Jari Aalto <address@hidden> writes:

> --- man.el.orig       2004-11-21 18:05:53.000000000 +0200
> +++ man.el    2004-11-21 18:45:26.000000000 +0200
> @@ -502,23 +502,35 @@
>  (defsubst Man-default-man-entry ()
>    "Make a guess at a default manual entry.
>  This guess is based on the text surrounding the cursor."
> -  (let (word)
> -    (save-excursion
>        ;; Default man entry title is any word the cursor is on, or if
>        ;; cursor not on a word, then nearest preceding word.
> +  ;; Use local syntax table to find correct word in cases like:
> +  ;;    ioctl(2) or brc(1M)
> +  (let* (word
> +      (ret "")
> +      (table (syntax-table))
> +      (orig  (copy-sequence table)))
> +    (modify-syntax-entry ?\( "w" table)
> +    (modify-syntax-entry ?\) "w" table)
> +    (modify-syntax-entry ?. "w" table)  ;; snmpd.conf(5) 
> +    (modify-syntax-entry ?- "w" table)  ;; invoke-rc.d(8)
> +    (set-syntax-table table)
>        (setq word (current-word))
> +    (set-syntax-table orig)

That should use with-syntax-table to not lose the old syntax table in case
of errors or quit (even if it is rather unlikely to occur).

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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