Article View: gnu.emacs.help
Article #189595Re: How to read a word from a buffer for use as a variable in a function.
From: Lawrence Buja
Date: Thu, 03 Jan 1991 18:08
Date: Thu, 03 Jan 1991 18:08
22 lines
1435 bytes
1435 bytes
Thanks for all the suggestions.
The function I ended up using employed the ispell word pick-up.
(defun get-man-on-current-word ()
"Look up man (lower case) or help (mixed case) documentation on current word"
(interactive)
(let (beg end )
(save-excursion
(if (not (looking-at "\\<")) (forward-word -1) )
(setq beg (point))
(forward-word 1)
(setq end (point)))
(setq current-word (buffer-substring beg end)))
(if (equal current-word (downcase current-word))
(shell-command (concat "man " current-word))
(shell-command (concat "help " current-word)) ) )
Lawrence Buja
southern@ncar.ucar.edu
Technical Details
Message-ID:
<9749@ncar.ucar.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!neit.cgd.ucar.edu!southernReferences:
<9718@ncar.ucar.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,b807e53d2a9d4174 X-Google-Attributes: gid103b8b,public X-Google-ArrivalTime: 1991-01-03 14:02:47 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!neit.cgd.ucar.edu!southern From: southern@neit.cgd.ucar.edu (Lawrence Buja) Newsgroups: gnu.emacs.help Subject: Re: How to read a word from a buffer for use as a variable in a function. Message-ID: <9749@ncar.ucar.edu> Date: 3 Jan 91 18:08:57 GMT References: <9718@ncar.ucar.edu> Sender: news@ncar.ucar.edu Organization: Climate and Global Dynamics Division/NCAR, Boulder, CO Lines: 22